Merge remote-tracking branch 'upstream/master'

This commit is contained in:
CptSpaceToaster committed 2014-12-24 13:48:50 -05:00
commit ebc4f7cb6d
152 files changed
+477 -575

No files matched your search

@@ -1,15 +1,5 @@
package com.cricketcraft.chisel;
import java.io.File;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import com.cricketcraft.chisel.block.BlockCarvable;
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
@@ -30,7 +20,6 @@ import com.cricketcraft.chisel.proxy.CommonProxy;
import com.cricketcraft.chisel.utils.General;
import com.cricketcraft.chisel.world.GeneratorLimestone;
import com.cricketcraft.chisel.world.GeneratorMarble;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.FMLLog;
@@ -38,12 +27,8 @@ import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
@@ -51,15 +36,24 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.Type;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import java.io.File;
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "com.cricketcraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;")
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "com.cricketcraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;after:Thaumcraft")
public class Chisel
{
public static final String MOD_ID = "chisel";
public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType("dig.stone", MOD_ID + ":step.templeblock", 1.0f, 1.0f);
public static final String MOD_NAME = "Chisel 2";
public static final String VERSION = "2.1.3";
public static final String VERSION = "2.2.0";
public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType("holystone", 1.0f, 1.0f);
public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f);
public static boolean multipartLoaded = false;
@@ -183,7 +177,6 @@ public class Chisel
proxy.init();
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(new ChiselLeftClick());
FMLCommonHandler.instance().bus().register(instance);
FMLInterModComms.sendMessage("Waila", "register", "com.cricketcraft.chisel.Waila.register");
@@ -1,191 +0,0 @@
package com.cricketcraft.chisel;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent;
import com.cricketcraft.chisel.api.ChiselMode;
import com.cricketcraft.chisel.carving.CarvingVariation;
import com.cricketcraft.chisel.client.GeneralChiselClient;
import com.cricketcraft.chisel.init.ModBlocks;
import com.cricketcraft.chisel.init.ModItems;
import com.cricketcraft.chisel.item.ItemChisel;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class ChiselLeftClick
{
HashMap<String, Long> chiselUseTime = new HashMap<String, Long>();
HashMap<String, String> chiselUseLocation = new HashMap<String, String>();
Random random = new Random();
public static void setBlock(World world, int x, int y, int z, ChiselMode chiselMode, Block previousBlock, int previousMetadata, Block newBlock, int newMetadata, ForgeDirection direction) {
if (chiselMode == ChiselMode.SINGLE)
{
world.setBlock(x, y, z, newBlock, newMetadata, 2);
} else if (chiselMode == ChiselMode.CIRCLETHREE)
{
int radius = 1;
for (int i = -radius; i <= radius; i++)
for (int j = -radius; j <= radius; j++)
{
//TODO facing stuff so this can be anywhere
if (world.getBlock(x + i, y, z + j) != null)
{
if (world.getBlock(x + i, y, z + j) == previousBlock && world.getBlockMetadata(x + i, y, z + j) == previousMetadata) {
int shiftedX = x;
int shiftedY = y;
int shiftedZ = z;
world.setBlock(shiftedX, shiftedY, shiftedZ, newBlock, newMetadata, 2);
}
}
}
}
}
@SubscribeEvent
public void onPlayerClick(PlayerInteractEvent event) {
if (event.action != PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) return;
if (!Configurations.enableChiseling) return;
EntityPlayer player = event.entityPlayer;
ItemStack stack = player.getHeldItem();
if (stack == null || stack.getItem() != ModItems.chisel) return;
World world = event.world;
int x = event.x;
int y = event.y;
int z = event.z;
Block block = world.getBlock(x, y, z);
int blockMeta = world.getBlockMetadata(x, y, z);
ItemStack chiselTarget = null;
if (stack.stackTagCompound != null) {
chiselTarget = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget"));
}
boolean chiselHasBlockInside = true;
if (chiselTarget == null) {
chiselHasBlockInside = false;
Long useTime = chiselUseTime.get(player.getCommandSenderName());
String loc = chiselUseLocation.get(player.getCommandSenderName());
if (useTime != null && chiselUseLocation != null && loc.equals(x + "|" + y + "|" + z)) {
long cooldown = 20;
long time = world.getWorldInfo().getWorldTotalTime();
if (time > useTime - cooldown && time < useTime + cooldown) return; //noReplace = true;
}
CarvingVariation[] variations = ItemChisel.carving.getVariations(block, blockMeta);
if (variations == null || variations.length < 2) return; //noReplace = true;
else {
int index = -1;
//Find the index of the next block in the variation list
for (int i = 0; i < variations.length; ++i) {
CarvingVariation currVariation = variations[i];
//If the metadata matches, then we are interested in the block AFTER this one
if (currVariation.block.equals(block) && currVariation.meta == blockMeta) {
index = i + 1;
}
}
//If no index was found, something is wrong. Return.
if (index < 0) {
return;
}
//If the the current block is the last in the list, loop back to the first
else if (index >= variations.length) {
index = 0;
}
CarvingVariation var = variations[index];
chiselTarget = new ItemStack(var.block, 1, var.damage);
}
}
Item result = null;
int targetMeta = 0;
Item target = chiselTarget.getItem();
targetMeta = chiselTarget.getItemDamage();
boolean match = ItemChisel.carving.isVariationOfSameClass(Block.getBlockFromItem(target), targetMeta, block, blockMeta);
result = target;
/* special case: stone can be carved to cobble and bricks */
if (Configurations.chiselStoneToCobbleBricks) {
if (!match && block.equals(Blocks.stone) && Block.getBlockFromItem(target).equals(ModBlocks.cobblestone))
match = true;
if (!match && block.equals(Blocks.stone) && Block.getBlockFromItem(target).equals(ModBlocks.stoneBrick))
match = true;
}
if (!match)
return; //noReplace = true;
int updateValue = 1;
if (!world.isRemote || chiselHasBlockInside) {
world.setBlock(x, y, z, Block.getBlockFromItem(result), targetMeta, updateValue);
world.markBlockForUpdate(x, y, z);
}
switch (FMLCommonHandler.instance().getEffectiveSide()) {
case SERVER:
chiselUseTime.put(player.getCommandSenderName(), world.getWorldInfo().getWorldTotalTime());
chiselUseLocation.put(player.getCommandSenderName(), x + "|" + y + "|" + z);
try {
//TODO chisel left click thingy
// Packet packet = Chisel.packet.create(Packets.CHISELED).writeInt(x).writeInt(y).writeInt(z);
// Chisel.packet.sendToAllAround(packet, new TargetPoint(player.dimension, x, y, z, 30.0f));
} catch (Exception e) {
e.printStackTrace();
}
break;
case CLIENT:
if (chiselHasBlockInside) {
String sound = ItemChisel.carving.getVariationSound(result, chiselTarget.getItemDamage());
GeneralChiselClient.spawnChiselEffect(x, y, z, sound);
}
break;
default:
break;
}
stack.damageItem(1, player);
if (stack.stackSize == 0) {
player.inventory.mainInventory[player.inventory.currentItem] = chiselHasBlockInside ? chiselTarget : null;
}
}
@SubscribeEvent
public void onBlockBreak(BlockEvent.BreakEvent event) {
if (!Configurations.enableChiseling) return;
EntityPlayer player = event.getPlayer();
ItemStack stack = player.getHeldItem();
if (stack == null || stack.getItem() != ModItems.chisel) return;
event.setCanceled(true);
}
}
@@ -12,8 +12,6 @@ public class Configurations
public static boolean blockDescriptions;
public static boolean ghostCloud;
public static boolean allowMossy;
public static boolean chiselStoneToCobbleBricks;
public static boolean enableChiseling;
public static boolean chiselRecipe;
public static boolean autoChisel;
public static boolean fancy;
@@ -34,8 +32,6 @@ public class Configurations
disableCTM = !config.get("client", "connectedTextures", true, "Enable connected textures").getBoolean(true);
fancy = config.get("client", "fancyLeaves", true, "Enable fancy textures").getBoolean(true);
blockDescriptions = config.get("client", "tooltipsUseBlockDescriptions", true, "Make variations of blocks have the same name, and use the description in tooltip to distinguish them.").getBoolean(true);
chiselStoneToCobbleBricks = config.get("general", "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left-click.").getBoolean(true);
enableChiseling = config.get("general", "enableChiselingLeftClicking", false, "Change blocks to another block using the Chisel and left-click.").getBoolean(false);
ghostCloud = config.get("general", "doesCloudRenderLikeGhost", true).getBoolean(true);
factoryBlockAmount = config.get("general", "amountYouGetFromFactoryBlockCrafting", 32).getInt(32);
allowMossy = config.get("general", "allowCobbleToMossyInChisel", true).getBoolean(true);
@@ -134,5 +134,19 @@ public class Crafting {
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.jackolantern[x]), new Object[]{new ItemStack(ModBlocks.pumpkin[x], 1), new ItemStack(Item.getItemFromBlock(Blocks.torch), 1)});
}
}
if(Configurations.featureEnabled("technical")){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.technical, Configurations.factoryBlockAmount, 0), new Object[]{"xyx", "yxy", "xyx", 'x', "stone", 'y', Items.iron_ingot}));
}
if(Configurations.featureEnabled("chest")){
for(int x = 0; x < 16; x++){
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.present[x]), new Object[]{new ItemStack(Blocks.chest, 1), new ItemStack(Items.dye, 1, x)});
}
}
if(Configurations.featureEnabled("warningSign")){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.sign, 4, 0), new Object[]{"xxx", "xyx", "xxx", 'x', "stone", 'y', Items.sign}));
}
}
}
@@ -4,5 +4,11 @@ import com.cricketcraft.chisel.carving.CarvableVariation;
public interface ICarvable
{
/**
* This grabs the variations possible
* @param metadata This is the metadata that a block will use and the basis of chisel
* Traditionally you make an instance of CarvableHelper ex. CarvableHelper carverHelper = new CarvableHelper();
* In this method you return carverHelper.getVariation(metadata) and that should be all you need if you register it correctly.
*/
public CarvableVariation getVariation(int metadata);
}
@@ -54,21 +54,6 @@ public class BlockAutoChisel extends BlockContainer{
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;
}
@@ -78,19 +63,6 @@ public class BlockAutoChisel extends BlockContainer{
super.breakBlock(world, x, y, z, block, par6);
}
@Override
public int damageDropped(int metadata){
return metadata;
}
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List subItems){
for(int x = 0; x < 4; x++){
subItems.add(new ItemStack(this, 1, x));
}
}
private void dropItems(World world, int x, int y, int z) {
Random random = new Random();
TileEntity tileEntity = world.getTileEntity(x, y, z);
@@ -1,7 +1,12 @@
package com.cricketcraft.chisel.block;
import java.util.List;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.ICarvable;
import com.cricketcraft.chisel.carving.CarvableHelper;
import com.cricketcraft.chisel.carving.CarvableVariation;
import com.cricketcraft.chisel.init.ModTabs;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -10,14 +15,7 @@ import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.ICarvable;
import com.cricketcraft.chisel.carving.CarvableHelper;
import com.cricketcraft.chisel.carving.CarvableVariation;
import com.cricketcraft.chisel.init.ModTabs;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
public class BlockCarvable extends Block implements ICarvable {
public CarvableHelper carverHelper;
@@ -30,6 +28,8 @@ public class BlockCarvable extends Block implements ICarvable {
public BlockCarvable(Material m) {
super(m);
carverHelper = new CarvableHelper();
setResistance(10.0F);
setHardness(2.0F);
setCreativeTab(ModTabs.tabChiselBlocks);
}
@@ -1,11 +1,18 @@
package com.cricketcraft.chisel.block;
import net.minecraft.block.BlockTorch;
import net.minecraft.client.renderer.texture.IIconRegister;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.ICarvable;
import com.cricketcraft.chisel.carving.CarvableHelper;
import com.cricketcraft.chisel.carving.CarvableVariation;
import com.cricketcraft.chisel.init.ModTabs;
public class BlockCarvableTorch extends BlockCarvable
public class BlockCarvableTorch extends BlockTorch implements ICarvable
{
public CarvableHelper carverHelper;
private String texLocation;
public BlockCarvableTorch()
{
@@ -15,9 +22,15 @@ public class BlockCarvableTorch extends BlockCarvable
setCreativeTab(ModTabs.tabChiselBlocks);
}
@Override
public int getRenderType()
{
return 2;
@Override
public CarvableVariation getVariation(int metadata) {
return carverHelper.getVariation(metadata);
}
@Override
public void registerBlockIcons(IIconRegister icon){
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/"+ texLocation);
}
public void setInformation(String textureLocation){
this.texLocation = textureLocation;
}
}
@@ -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,37 +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 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;
}
}
@@ -70,42 +109,6 @@ public class BlockPresent extends BlockContainer implements ICarvable {
return true;
}
public ResourceLocation getResourceSingle(int metadata) {
if (isChristmas) {
switch (metadata) {
case 1:
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;
@@ -363,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
@@ -1,12 +0,0 @@
package com.cricketcraft.chisel.block;
import net.minecraft.block.material.Material;
public class BlockVoidstone extends BlockMarbleTexturedOre {
public BlockVoidstone(String s) {
super(Material.rock, s);
setHardness(5.0F);
setResistance(10.0F);
}
}
@@ -1,35 +0,0 @@
package com.cricketcraft.chisel.block;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
public class ItemBlockAutoChisel extends ItemBlock{
private final String[] names = {"base", "speed", "automation", "stack"};
private int metadata;
public ItemBlockAutoChisel(Block block) {
super(block);
setHasSubtypes(true);
}
@Override
public int getMetadata(int meta){
return meta;
}
@Override
public String getUnlocalizedName(ItemStack itemStack){
return getUnlocalizedName() + "." + names[itemStack.getItemDamage()];
}
@Override
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4){
list.add(StatCollector.translateToLocal(getUnlocalizedName() + "." + names[itemStack.getItemDamage()] + ".desc"));
}
}
@@ -1,5 +1,8 @@
package com.cricketcraft.chisel.block.tileentity;
import com.cricketcraft.chisel.init.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
@@ -11,14 +14,14 @@ import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TileEntityAutoChisel extends TileEntity implements ISidedInventory {
private final int BASE = 0, TARGET = 1, OUTPUT = 2, AUTOMATION = 3, STACK = 4, SPEED = 5;
private boolean isAutomated, isStackMode, isFaster;
private static EntityItem ghostItem;
boolean equal = false;
private ItemStack[] inventory = new ItemStack[3];
private ItemStack[] inventory = new ItemStack[6];
private String name = "autoChisel";
@Override
@@ -66,36 +69,74 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
@Override
public void updateEntity() {
if (!worldObj.isRemote && worldObj.getWorldTime() % 20 == 0) {
if (inventory[0] != null && inventory[1] != null) {
if (inventory[0].getItem() instanceof ItemBlock && inventory[1].getItem() instanceof ItemBlock) {
if (inventory[0].getItem() == inventory[1].getItem()) {
equal = true;
} else {
equal = false;
}
if (equal) {
if (inventory[0].stackSize < 0) {
inventory[0] = null;
}
if (inventory[1].stackSize < 0) {
inventory[1] = null;
}
if(inventory[SPEED] == new ItemStack(ModItems.upgrade, 1, 0)){
isFaster = true;
} else {
isFaster = false;
}
if (inventory[1].stackSize < 0) {
inventory[1] = null;
}
if(inventory[AUTOMATION] == new ItemStack(ModItems.upgrade, 1, 1)){
isAutomated = true;
} else {
isAutomated = false;
}
if (inventory[2] == null) {
setInventorySlotContents(2, new ItemStack(inventory[1].getItem(), 1, inventory[1].getItemDamage()));
decrStackSize(0, 1);
} else {
if (inventory[0].stackSize != 0 && inventory[2].stackSize <= getInventoryStackLimit()) {
decrStackSize(0, 1);
inventory[2].stackSize++;
if(inventory[STACK] == new ItemStack(ModItems.upgrade, 1, 2)){
isStackMode = true;
} else {
isStackMode = false;
}
if(isFaster){
if(!worldObj.isRemote && worldObj.getWorldTime() % 10 == 0){
if(inventory[BASE] != null && inventory[TARGET] != null){
if(inventory[BASE].getItem() instanceof ItemBlock && inventory[TARGET].getItem() instanceof ItemBlock){
if(inventory[BASE].getUnlocalizedName().equalsIgnoreCase(inventory[TARGET].getUnlocalizedName())){
if(isStackMode){
if(inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()){
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 64, inventory[TARGET].getItemDamage());
inventory[BASE] = null;
}
}
} else {
inventory[0] = null;
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 1, inventory[TARGET].getItemDamage());
inventory[BASE].stackSize--;
} else if(inventory[BASE].stackSize != 0){
inventory[OUTPUT].stackSize++;
inventory[BASE].stackSize--;
} else {
inventory[BASE] = null;
}
}
}
}
}
}
} else {
if(!worldObj.isRemote && worldObj.getWorldTime() % 40 == 0){
if(inventory[BASE] != null && inventory[TARGET] != null){
if(inventory[BASE].getItem() instanceof ItemBlock && inventory[TARGET].getItem() instanceof ItemBlock){
if(inventory[BASE].getUnlocalizedName().equalsIgnoreCase(inventory[TARGET].getUnlocalizedName())){
if(isStackMode){
if(inventory[BASE].stackSize == inventory[BASE].getMaxStackSize()){
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 64, inventory[TARGET].getItemDamage());
inventory[BASE] = null;
}
}
} else {
if(inventory[OUTPUT] == null){
inventory[OUTPUT] = new ItemStack(inventory[TARGET].getItem(), 1, inventory[TARGET].getItemDamage());
inventory[BASE].stackSize--;
} else if(inventory[BASE].stackSize != 0){
inventory[OUTPUT].stackSize++;
inventory[BASE].stackSize--;
} else {
inventory[BASE] = null;
}
}
}
}
@@ -179,7 +220,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return new int[3];
return new int[6];
}
@Override
@@ -189,12 +230,22 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
@Override
public boolean canInsertItem(int slot, ItemStack itemStack, int side) {
if(isAutomated){
if(side != 0 || side != 1 && slot == BASE){
return true;
}
}
return false;
}
@Override
public boolean canExtractItem(int slot, ItemStack itemStack, int side) {
return true;
if(isAutomated){
if(side == 0 || side == 1 && slot == OUTPUT){
return true;
}
}
return false;
}
@Override
@@ -1,22 +1,25 @@
package com.cricketcraft.chisel.block.tileentity;
import java.util.Iterator;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.AxisAlignedBB;
import com.cricketcraft.chisel.block.BlockPresent;
import com.cricketcraft.chisel.inventory.ContainerPresent;
import com.cricketcraft.chisel.inventory.InventoryLargePresent;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ContainerChest;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.AxisAlignedBB;
import java.util.Iterator;
import java.util.List;
public class TileEntityPresent extends TileEntityChest {
public TileEntityPresent() {
public int type;
private int ticksSinceSync;
public TileEntityPresent(int type) {
this.type = type;
}
@Override
@@ -114,78 +117,96 @@ public class TileEntityPresent extends TileEntityChest {
@Override
public void updateEntity() {
super.updateEntity();
checkForAdjacentPresents();
this.checkForAdjacentChests();
++this.ticksSinceSync;
float f;
if (!worldObj.isRemote && numPlayersUsing != 0 && (+xCoord + yCoord + zCoord) % 200 == 0) {
numPlayersUsing = 0;
if (!this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0)
{
this.numPlayersUsing = 0;
f = 5.0F;
List<?> list = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - f, yCoord - f, zCoord - f, (xCoord + 1) + f, (yCoord + 1) + f, (zCoord + 1) + f));
Iterator<?> iterator = list.iterator();
List list = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox((double)((float)this.xCoord - f), (double)((float)this.yCoord - f), (double)((float)this.zCoord - f), (double)((float)(this.xCoord + 1) + f), (double)((float)(this.yCoord + 1) + f), (double)((float)(this.zCoord + 1) + f)));
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
EntityPlayer player = (EntityPlayer) iterator.next();
while (iterator.hasNext())
{
EntityPlayer entityplayer = (EntityPlayer)iterator.next();
if (player.openContainer instanceof ContainerPresent) {
IInventory inventory = ((ContainerPresent) player.openContainer).getLowerPresentInventory();
if (entityplayer.openContainer instanceof ContainerPresent)
{
IInventory iinventory = ((ContainerChest)entityplayer.openContainer).getLowerChestInventory();
if (inventory == this || inventory instanceof InventoryLargePresent && ((InventoryLargePresent) inventory).isPartOfLargePresent(this)) {
++numPlayersUsing;
if (iinventory == this || iinventory instanceof InventoryLargePresent && ((InventoryLargePresent)iinventory).isPartOfLargePresent(this))
{
++this.numPlayersUsing;
}
}
}
}
prevLidAngle = lidAngle;
this.prevLidAngle = this.lidAngle;
f = 0.1F;
double d2;
if (numPlayersUsing > 0 && lidAngle == 0.0F && adjacentChestZNeg == null && adjacentChestXNeg == null) {
double d1 = xCoord + 0.5D;
d2 = xCoord + 0.5D;
if (adjacentChestZPos != null) {
if (this.numPlayersUsing > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null)
{
double d1 = (double)this.xCoord + 0.5D;
d2 = (double)this.zCoord + 0.5D;
if (this.adjacentChestZPos != null)
{
d2 += 0.5D;
}
if (adjacentChestXPos != null) {
if (this.adjacentChestXPos != null)
{
d1 += 0.5D;
}
worldObj.playSoundEffect(d1, yCoord + 0.5D, d2, "random.chestopen", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F);
this.worldObj.playSoundEffect(d1, (double)this.yCoord + 0.5D, d2, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
}
if (numPlayersUsing == 0 && lidAngle > 0.0F || numPlayersUsing > 0 && lidAngle < 1.0F) {
float f1 = lidAngle;
if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F)
{
float f1 = this.lidAngle;
if (numPlayersUsing > 0) {
lidAngle += f;
} else {
lidAngle -= f;
if (this.numPlayersUsing > 0)
{
this.lidAngle += f;
}
else
{
this.lidAngle -= f;
}
if (lidAngle > 1.0F) {
lidAngle = 1.0F;
if (this.lidAngle > 1.0F)
{
this.lidAngle = 1.0F;
}
float f2 = 0.5F;
if (lidAngle < f2 && f1 >= f2 && adjacentChestZNeg == null && adjacentChestXNeg == null) {
d2 = xCoord + 0.5D;
double d0 = zCoord + 0.5D;
if (this.lidAngle < f2 && f1 >= f2 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null)
{
d2 = (double)this.xCoord + 0.5D;
double d0 = (double)this.zCoord + 0.5D;
if (adjacentChestZPos != null) {
if (this.adjacentChestZPos != null)
{
d0 += 0.5D;
}
if (adjacentChestXPos != null) {
if (this.adjacentChestXPos != null)
{
d2 += 0.5D;
}
worldObj.playSoundEffect(d2, yCoord + 0.5D, d0, "random.chestclosed", 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F);
this.worldObj.playSoundEffect(d2, (double)this.yCoord + 0.5D, d0, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
}
if (lidAngle < 0.0F) {
lidAngle = 0.0F;
if (this.lidAngle < 0.0F)
{
this.lidAngle = 0.0F;
}
}
}
@@ -204,12 +225,10 @@ public class TileEntityPresent extends TileEntityChest {
@Override
public void closeInventory() {
if (getBlockType() instanceof BlockPresent) {
--numPlayersUsing;
worldObj.addBlockEvent(xCoord, yCoord, zCoord, getBlockType(), 1, numPlayersUsing);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord - 1, zCoord, getBlockType());
}
numPlayersUsing = 0;
worldObj.addBlockEvent(xCoord, yCoord, zCoord, getBlockType(), 1, numPlayersUsing);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType());
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord - 1, zCoord, getBlockType());
}
@Override
@@ -1,19 +1,22 @@
package com.cricketcraft.chisel.client.render.item;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.block.BlockPresent;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.model.ModelChest;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import com.cricketcraft.chisel.Chisel;
import cpw.mods.fml.client.FMLClientHandler;
public class ItemPresentRenderer implements IItemRenderer {
private final ModelChest model = new ModelChest();
BlockPresent present;
private int meta;
public ItemPresentRenderer(int type){
present = new BlockPresent(type);
this.meta = type;
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return type != ItemRenderType.FIRST_PERSON_MAP;
@@ -26,16 +29,16 @@ public class ItemPresentRenderer implements IItemRenderer {
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Chisel.MOD_ID, "textures/blocks/present/red.png"));
FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(Chisel.MOD_ID, present.getKindOfChest(meta) + ".png"));
switch (type) {
case ENTITY:
renderBlock(0.0F, 0.0F, 0.0F);
renderBlock(0.0F, 1.0F, 0.0F);
break;
case EQUIPPED:
renderBlock(0.0F, 0.0F, 0.0F);
renderBlock(0.5F, 1.5F, 0.5F);
break;
case EQUIPPED_FIRST_PERSON:
renderBlock(0.0F, 0.0F, 0.0F);
renderBlock(0.5F, 1.0F, 0.5F);
break;
case INVENTORY:
renderInventory(1.0F, 1.0F, 1.0F);
@@ -1,29 +1,21 @@
package com.cricketcraft.chisel.client.render.tile;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.block.BlockPresent;
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
import cpw.mods.fml.common.FMLLog;
import net.minecraft.block.Block;
import net.minecraft.block.BlockChest;
import net.minecraft.client.model.ModelChest;
import net.minecraft.client.model.ModelLargeChest;
import net.minecraft.client.renderer.tileentity.TileEntityChestRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.cricketcraft.chisel.block.BlockPresent;
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
import cpw.mods.fml.common.FMLLog;
public class RenderPresent extends TileEntityChestRenderer {
private ModelChest chest = new ModelChest();
private ModelChest doubleChest = new ModelLargeChest();
//TODO: this will be changed so it actually chescks after I have crate textures :)
//private boolean isChristmas = true;
public RenderPresent() {
}
public void renderTileEntityAt(TileEntityPresent present, double x, double y, double z, float partialTicks) {
@@ -35,9 +27,9 @@ public class RenderPresent extends TileEntityChestRenderer {
Block block = present.getBlockType();
i = present.getBlockMetadata();
if (block instanceof BlockChest && i == 0) {
if (block instanceof BlockPresent && i == 0) {
try {
((BlockChest) block).func_149954_e(present.getWorldObj(), present.xCoord, present.yCoord, present.zCoord);
((BlockPresent) block).changeMetadataBasedOffSpecs(present.getWorldObj(), present.xCoord, present.yCoord, present.zCoord);
} catch (ClassCastException e) {
FMLLog.severe("[Chisel 2] Attempted to render a present at %d, %d, %d that was not a present", present.xCoord, present.yCoord, present.zCoord);
}
@@ -49,15 +41,7 @@ public class RenderPresent extends TileEntityChestRenderer {
if (present.adjacentChestZNeg == null && present.adjacentChestXNeg == null) {
BlockPresent blockPresent = (BlockPresent) present.getWorldObj().getBlock(present.xCoord, present.yCoord, present.zCoord);
ModelChest modelchest;
if (present.adjacentChestXPos == null && present.adjacentChestZPos == null) {
modelchest = this.chest;
this.bindTexture(blockPresent.getResourceSingle(1));
} else {
modelchest = this.doubleChest;
this.bindTexture(blockPresent.getResourceDouble(1));
}
this.bindTexture(new ResourceLocation(Chisel.MOD_ID, blockPresent.getKindOfChest(present.type) + ".png"));
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@@ -114,8 +98,8 @@ public class RenderPresent extends TileEntityChestRenderer {
f1 = 1.0F - f1;
f1 = 1.0F - f1 * f1 * f1;
modelchest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2.0F);
modelchest.renderAll();
this.chest.chestLid.rotateAngleX = -(f1 * (float) Math.PI / 2.0F);
this.chest.renderAll();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -76,7 +76,6 @@ public class FMPIntegration implements IModIntegration{
registerMaterial(ModBlocks.factory, 0, 12);
registerMaterial(ModBlocks.factory, 14, 14);
registerMaterial(ModBlocks.stainedGlass[0]); //White
registerMaterial(ModBlocks.stainedGlass[4]); //Yellow
registerMaterial(ModBlocks.stainedGlass[8]); //Light Gray
registerMaterial(ModBlocks.stainedGlass[12]); //Brown
registerMaterial(ModBlocks.woolenClay);
@@ -105,7 +105,6 @@ public class MarbleCompatibility
void action()
{
Carving.chisel.addVariation("marble", block, 0, 99);
block.setHarvestLevel("chisel", 0, 0);
}
};
@@ -115,7 +114,6 @@ public class MarbleCompatibility
void action()
{
Carving.chisel.addVariation("marble", block, 0, 99);
block.setHarvestLevel("chisel", 0, 0);
}
};
@@ -125,7 +123,6 @@ public class MarbleCompatibility
void action()
{
Carving.chisel.addVariation("marble", block, 0, 99);
block.setHarvestLevel("chisel", 0, 0);
}
};
@@ -135,7 +132,6 @@ public class MarbleCompatibility
void action()
{
Carving.chisel.addVariation("limestone", block, 0, 99);
block.setHarvestLevel("chisel", 0, 0);
}
};
new ClassBlockCompat("emasher.core.EmasherCore", "limestone")
@@ -144,7 +140,6 @@ public class MarbleCompatibility
void action()
{
Carving.chisel.addVariation("limestone", block, 0, 99);
block.setHarvestLevel("chisel", 0, 0);
}
};
@@ -156,10 +151,8 @@ public class MarbleCompatibility
Block[] blocks = (Block[]) cl.getField("blocks").get(null);
Carving.chisel.addVariation("marble", blocks[0], 2, 99);
blocks[0].setHarvestLevel("chisel", 0, 2);
Carving.chisel.addVariation("limestone", blocks[0], 3, 99);
blocks[0].setHarvestLevel("chisel", 0, 3);
}
};
}
@@ -8,6 +8,7 @@ import com.cricketcraft.chisel.carving.CarvableVariation;
import com.cricketcraft.chisel.carving.Carving;
import com.cricketcraft.chisel.item.ItemCarvable;
import com.cricketcraft.chisel.item.ItemMarbleSlab;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
@@ -71,21 +72,24 @@ public class ModBlocks {
public static BlockCarvable laboratory;
public static BlockCarvablePumpkin[] pumpkin = new BlockCarvablePumpkin[16];
public static BlockCarvablePumpkin[] jackolantern = new BlockCarvablePumpkin[16];
public static BlockVoidstone voidstone;
public static BlockVoidstone voidstone2;
public static BlockCarvable voidstone;
public static BlockMarbleTexturedOre voidstone2;
public static BlockVoidstonePillar voidstonePillar;
public static BlockVoidstonePillar2 voidstonePillar2;
public static Block autoChisel;
public static BlockPresent present;
public static BlockPresent[] present = new BlockPresent[16];
public static BlockSnakestone snakestone;
public static BlockSnakestone sandSnakestone;
public static BlockSnakestoneObsidian obsidianSnakestone;
public static BlockCarvable hexPlating;
public static BlockCarvable technical;
public static BlockCarvableGlass technical2;
public static BlockCarvable bone;
public static BlockCarvable scorching;
public static BlockCarvable brickCustom;
public static BlockCarvableTorch torch;
public static BlockCarvableTorch[] torch = new BlockCarvableTorch[16];
public static BlockCarvable sign;
public static BlockCarvable arcane;
// 1.7
public static BlockCarvableGlass[] stainedGlass = new BlockCarvableGlass[4];
@@ -95,7 +99,7 @@ public class ModBlocks {
{
if(Configurations.featureEnabled("autoChisel")){
autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChisel").setCreativeTab(ModTabs.tabChisel).setBlockName("autoChisel").setBlockTextureName(Chisel.MOD_ID + ":factory/circuit");
GameRegistry.registerBlock(autoChisel, ItemBlockAutoChisel.class, "autoChisel");
GameRegistry.registerBlock(autoChisel, "autoChisel");
Chisel.proxy.registerTileEntities();
}
@@ -692,8 +696,8 @@ public class ModBlocks {
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.1.desc"), 1, "dirt/netherbricks");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.2.desc"), 2, "dirt/bricks3");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.3.desc"), 3, "dirt/cobble");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.4.desc"), 4, "dirt/reinforced");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.5.desc"), 5, "dirt/dirt-reinforced");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.4.desc"), 4, "dirt/reinforcedCobbleDirt");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.5.desc"), 5, "dirt/reinforcedDirt");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.6.desc"), 6, "dirt/happy");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.7.desc"), 7, "dirt/bricks2");
dirt.carverHelper.addVariation(StatCollector.translateToLocal("tile.dirt.8.desc"), 8, "dirt/bricks+dirt2");
@@ -1336,16 +1340,16 @@ public class ModBlocks {
}
if (Configurations.featureEnabled("chest")) {
//TODO: will be done at winter time
present = (BlockPresent) new BlockPresent().setHardness(2.5F).setStepSound(Block.soundTypeWood);
Carving.chisel.addVariation("chest", Blocks.chest, 0, 0);
present.carverHelper.addVariation(StatCollector.translateToLocal("tile.present.1.desc"), 1, present, 1);
present.carverHelper.register(present, "present");
for(int x = 0; x < 16; x++){
present[x] = (BlockPresent) new BlockPresent(x).setHardness(2.0F).setResistance(10.0F).setBlockName("present");
GameRegistry.registerBlock(present[x], "chest" + x);
Carving.chisel.addVariation("present", present[x], 0, (x + 1));
}
Carving.chisel.registerOre("chest", "chest");
}
if(Configurations.featureEnabled("voidstone")){
voidstone = (BlockVoidstone) new BlockVoidstone(null).setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabChiselBlocks);
voidstone = (BlockCarvable) new BlockCarvable().setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabChiselBlocks).setHardness(5.0F).setResistance(10.0F);
voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.0.desc"), 0, "voidstone/raw");
voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.1.desc"), 1, "voidstone/quarters");
voidstone.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.2.desc"), 2, "voidstone/smooth");
@@ -1358,7 +1362,7 @@ public class ModBlocks {
voidstone.carverHelper.register(voidstone, "voidstone");
Carving.chisel.registerOre("voidstone", "voidstone");
voidstone2 = (BlockVoidstone) new BlockVoidstone(Chisel.MOD_ID + ":voidstone/animated/void").setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabChiselBlocks);
voidstone2 = (BlockMarbleTexturedOre) new BlockMarbleTexturedOre(Material.rock, Chisel.MOD_ID + ":voidstone/animated/void").setStepSound(Block.soundTypeStone).setCreativeTab(ModTabs.tabChiselBlocks).setHardness(5.0F).setResistance(10.0F);
voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.0.desc"), 0, "voidstone/animated/raw");
voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.1.desc"), 1, "voidstone/animated/quarters");
voidstone2.carverHelper.addVariation(StatCollector.translateToLocal("tile.voidstone.2.desc"), 2, "voidstone/animated/smooth");
@@ -1475,11 +1479,23 @@ public class ModBlocks {
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.6.desc"), 6, "technical/fanStill");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.7.desc"), 7, "technical/vent");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.8.desc"), 8, "technical/ventGlowing");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.9.desc"), 9, "technical/insulation");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.9.desc"), 9, "technical/insulationv2");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.10.desc"), 10, "technical/spinningStuffAnim");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.11.desc"), 11, "technical/cables");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.12.desc"), 12, "technical/rustyBoltedPlates");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.13.desc"), 13, "technical/grate");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.14.desc"), 14, "technical/fanMalfunction");
technical.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.15.desc"), 15, "technical/grateRusty");
technical.carverHelper.register(technical, "technical");
Carving.chisel.registerOre("technical", "technical");
technical2 = (BlockCarvableGlass) new BlockCarvableGlass().setHardness(2.0F).setResistance(10F);
technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.0.desc"), 0, "technical/scaffoldTransparent");
technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.4.desc"), 1, "technical/fanFastTransparent");
technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.6.desc"), 2, "technical/fanStillTransparent");
technical2.carverHelper.addVariation(StatCollector.translateToLocal("tile.technical.14.desc"), 3, "technical/fanStillTransparent");
technical2.carverHelper.register(technical2, "technical2");
Carving.chisel.registerOre("technical2", "technical2");
}
if(Configurations.featureEnabled("bone"))
{
@@ -1516,19 +1532,39 @@ public class ModBlocks {
brickCustom.carverHelper.register(brickCustom, "brickCustom");
Carving.chisel.registerOre("brickCustom", "brickCustom");
}
/*if(Configurations.featureEnabled("torch"))
if(Configurations.featureEnabled("torch"))
{
torch = (BlockCarvableTorch) new BlockCarvableTorch().setLightLevel(0.8F);
Carving.chisel.addVariation("torch", Blocks.torch, 0, 0);
torch.carverHelper.addVariation(StatCollector.translateToLocal("tile.torch.1.desc"), 1, "torch/candle");
torch.carverHelper.addVariation(StatCollector.translateToLocal("tile.torch.2.desc"), 2, "torch/candle-holder");
torch.carverHelper.addVariation(StatCollector.translateToLocal("tile.torch.3.desc"), 3, "torch/lantern");
torch.carverHelper.addVariation(StatCollector.translateToLocal("tile.torch.4.desc"), 4, "torch/lantern-letters");
torch.carverHelper.addVariation(StatCollector.translateToLocal("tile.torch.5.desc"), 5, "torch/lamp");
torch.carverHelper.addVariation(StatCollector.translateToLocal("tile.torch.6.desc"), 6, "torch/lamp-tall");
torch.carverHelper.register(torch, "torch");
for(int metadata = 0; metadata < 6; metadata++){
torch[metadata] = (BlockCarvableTorch) new BlockCarvableTorch().setBlockName("torch").setCreativeTab(ModTabs.tabChiselBlocks);
torch[metadata].setInformation("torch" + (metadata + 1));
GameRegistry.registerBlock(torch[metadata], "torch" + (metadata + 1));
Carving.chisel.addVariation("torch", torch[metadata], 0, (metadata + 1));
}
Carving.chisel.registerOre("torch", "torch");
}*/
}
if(Configurations.featureEnabled("warningSign"))
{
sign = (BlockCarvable) new BlockCarvable(Material.iron).setHardness(2.0F).setResistance(10.0F);
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.0.desc"), 0, "warning/rad");
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.1.desc"), 1, "warning/bio");
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.2.desc"), 2, "warning/fire");
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.3.desc"), 3, "warning/explosion");
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.4.desc"), 4, "warning/death");
sign.carverHelper.register(sign, "warningSign");
Carving.chisel.registerOre("warningSign", "warningSign");
}
if(Configurations.featureEnabled("arcane") && Loader.isModLoaded("Thaumcraft"))
{
arcane = (BlockCarvable) new BlockCarvable(Material.rock).setStepSound(Block.soundTypeStone);
Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 6, 0);
Carving.chisel.addVariation("arcane", GameRegistry.findBlock("Thaumcraft", "blockCosmeticSolid"), 7, 1);
arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.1.desc"), 0, "arcane/largetile");
arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.2.desc"), 1, "arcane/moon");
arcane.carverHelper.addVariation(StatCollector.translateToLocal("tile.arcane.3.desc"), 2, "arcane/moon-thaumium");
arcane.carverHelper.register(arcane, "arcane");
Carving.chisel.registerOre("arcane", "arcane");
}
}
}
@@ -1,13 +1,12 @@
package com.cricketcraft.chisel.inventory;
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
public class ContainerAutoChisel extends Container {
public static TileEntityAutoChisel autoChisel;
@@ -21,6 +20,10 @@ public class ContainerAutoChisel extends Container {
addSlotToContainer(new Slot(tileEntityAutoChisel, 0, 53, 15));
addSlotToContainer(new Slot(tileEntityAutoChisel, 1, 78, 51));
addSlotToContainer(new Slot(tileEntityAutoChisel, 2, 103, 15));
addSlotToContainer(new Slot(tileEntityAutoChisel, 3, 151, 51));
addSlotToContainer(new Slot(tileEntityAutoChisel, 4, 151, 31));
addSlotToContainer(new Slot(tileEntityAutoChisel, 5, 151, 11));
bindPlayerInventory(player);
}
@@ -86,4 +89,4 @@ public class ContainerAutoChisel extends Container {
return itemStack;
}
}
}
@@ -1,38 +1,24 @@
package com.cricketcraft.chisel.item;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import com.cricketcraft.chisel.Chisel;
import com.cricketcraft.chisel.api.ChiselMode;
import com.cricketcraft.chisel.api.IChiselMode;
import com.cricketcraft.chisel.carving.CarvableHelper;
import com.cricketcraft.chisel.carving.Carving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
public class ItemChisel extends ItemTool implements IChiselMode {
private static final HashSet<String> toolSet = new HashSet<String>();
import java.util.List;
public class ItemChisel extends Item implements IChiselMode {
public static Carving carving = Carving.chisel;
public ItemChisel() {
super(1, ToolMaterial.IRON, CarvableHelper.getChiselBlockSet());
super();
setMaxStackSize(1);
setMaxDamage(500);
efficiencyOnProperMaterial = 100f;
setUnlocalizedName("chisel");
toolSet.add("chisel");
}
@Override
public Set<String> getToolClasses(ItemStack stack) {
return toolSet;
}
@Override
@@ -42,11 +28,6 @@ public class ItemChisel extends ItemTool implements IChiselMode {
return itemstack;
}
@Override
public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player) {
return true;
}
@Override
public ChiselMode getChiselMode(ItemStack itemStack) {
return ChiselMode.SINGLE;
@@ -16,7 +16,7 @@ import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
public class ItemUpgrade extends BaseItem{
public IIcon[] icons = new IIcon[6];
public IIcon[] icons = new IIcon[3];
public ItemUpgrade(String unlocalizedName) {
super();
@@ -1,21 +1,8 @@
package com.cricketcraft.chisel.proxy;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient;
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
import com.cricketcraft.chisel.client.render.BlockAdvancedMarbleRenderer;
import com.cricketcraft.chisel.client.render.BlockCarpetRenderer;
import com.cricketcraft.chisel.client.render.BlockEldritchRenderer;
import com.cricketcraft.chisel.client.render.BlockMarblePaneRenderer;
import com.cricketcraft.chisel.client.render.BlockMarblePillarRenderer;
import com.cricketcraft.chisel.client.render.BlockMarbleStairsRenderer;
import com.cricketcraft.chisel.client.render.BlockNoCTMRenderer;
import com.cricketcraft.chisel.client.render.BlockRoadLineRenderer;
import com.cricketcraft.chisel.client.render.BlockSnakeStoneRenderer;
import com.cricketcraft.chisel.client.render.BlockTexturedOreRenderer;
import com.cricketcraft.chisel.client.render.*;
import com.cricketcraft.chisel.client.render.item.ItemAutoChiselRenderer;
import com.cricketcraft.chisel.client.render.item.ItemChiselRenderer;
import com.cricketcraft.chisel.client.render.item.ItemPresentRenderer;
@@ -26,9 +13,11 @@ import com.cricketcraft.chisel.entity.EntityCloudInABottle;
import com.cricketcraft.chisel.entity.EntitySmashingRock;
import com.cricketcraft.chisel.init.ModBlocks;
import com.cricketcraft.chisel.init.ModItems;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient;
public class ClientProxy extends CommonProxy
{
@@ -58,7 +47,9 @@ public class ClientProxy extends CommonProxy
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPresent.class, new RenderPresent());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.autoChisel), new ItemAutoChiselRenderer());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.present), new ItemPresentRenderer());
for(int x = 0; x < 16; x++){
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.present[x]), new ItemPresentRenderer(x));
}
RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ModItems.itemCloudInABottle));
RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ModItems.itemBallOMoss));