From 63af23ebffbf4b4defa776debac9e9f8dfb8b770 Mon Sep 17 00:00:00 2001 From: tterrag1098 Date: Fri, 16 Jan 2015 22:45:57 -0500 Subject: [PATCH] Fix formatting issues in last commit --- .../com/cricketcraft/chisel/Features.java | 17 +- .../cricketcraft/chisel/carving/Carving.java | 230 +++++++++--------- 2 files changed, 126 insertions(+), 121 deletions(-) diff --git a/src/main/java/com/cricketcraft/chisel/Features.java b/src/main/java/com/cricketcraft/chisel/Features.java index 62b3a8a7..b3e776fc 100644 --- a/src/main/java/com/cricketcraft/chisel/Features.java +++ b/src/main/java/com/cricketcraft/chisel/Features.java @@ -694,8 +694,10 @@ public enum Features { // TODO Overlay is WIP @Override void addBlocks() { - BlockCarvable futura = (BlockCarvable) new BlockCarvable(Material.rock/* , "futura/screenOverlay-ctm" */).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F) - .setResistance(10F); + BlockCarvable futura = (BlockCarvable) new BlockCarvable(Material.rock/* + * , + * "futura/screenOverlay-ctm" + */).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10F); futura.carverHelper.addVariation("tile.futura.0.desc", 0, "futura/WIP/screenMetallicWIP"); futura.carverHelper.addVariation("tile.futura.1.desc", 1, "futura/WIP/screenCyanWIP"); futura.carverHelper.addVariation("tile.futura.2.desc", 2, "futura/WIP/controllerWIP"); @@ -1481,7 +1483,8 @@ public enum Features { BlockCarvable nether_brick = (BlockCarvable) new BlockCarvable(Material.rock).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(2.0F).setResistance(10.0F) .setStepSound(Block.soundTypeStone); Carving.chisel.addVariation("nether_brick", Blocks.nether_brick, 0, 0); - // netherBrick.carverHelper.addVariation("Nether brick", 0, Blocks.nether_brick); + // netherBrick.carverHelper.addVariation("Nether brick", 0, + // Blocks.nether_brick); nether_brick.carverHelper.addVariation("tile.netherBrick.1.desc", 1, "netherbrick/a1-netherbrick-brinstar"); nether_brick.carverHelper.addVariation("tile.netherBrick.2.desc", 2, "netherbrick/a1-netherbrick-classicspatter"); nether_brick.carverHelper.addVariation("tile.netherBrick.3.desc", 3, "netherbrick/a1-netherbrick-guts"); @@ -1724,7 +1727,7 @@ public enum Features { */ RAILCRAFT("Railcraft"), - RC_ABYSSAL_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { + RC_ABYSSAL_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) { @Override void addBlocks() { @@ -1896,7 +1899,8 @@ public enum Features { @Override void addRecipes() { if (meta == 0) { - // The following recipe is due to bugs with Chisel 1.5.1 to 1.5.6a + // The following recipe is due to bugs with Chisel 1.5.1 to + // 1.5.6a GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 0), "X", 'X', new ItemStack(ChiselBlocks.sandstone, 1, 0)); // The following recipe is due to bug with Chisel 1.5.6b GameRegistry.addRecipe(new ItemStack(Blocks.sandstone, 1, 1), "X", 'X', new ItemStack(ChiselBlocks.sandstone, 1, 1)); @@ -1994,7 +1998,8 @@ public enum Features { GameRegistry.registerBlock(obsidian_snakestone, ItemCarvable.class, "obsidian_snakestone"); Carving.chisel.addVariation("obsidian", obsidian_snakestone, 1, 16); Carving.chisel.addVariation("obsidian", obsidian_snakestone, 13, 17); - // Carving.chisel.registerOre("obsidianSnakestone", "obsidianSnakestone"); + // Carving.chisel.registerOre("obsidianSnakestone", + // "obsidianSnakestone"); } }, diff --git a/src/main/java/com/cricketcraft/chisel/carving/Carving.java b/src/main/java/com/cricketcraft/chisel/carving/Carving.java index 84b11c63..fa585da2 100644 --- a/src/main/java/com/cricketcraft/chisel/carving/Carving.java +++ b/src/main/java/com/cricketcraft/chisel/carving/Carving.java @@ -16,152 +16,152 @@ import com.cricketcraft.chisel.api.carving.ICarvingVariation; public class Carving { - GroupList groups = new GroupList(); + GroupList groups = new GroupList(); - public static final Carving chisel = new Carving(); - public static final Carving needle = new Carving(); + public static final Carving chisel = new Carving(); + public static final Carving needle = new Carving(); - private Carving() { - } + private Carving() { + } - public List getVariations(Block block, int metadata) { - ICarvingGroup group = getGroup(block, metadata); - if(group == null) - return null; + public List getVariations(Block block, int metadata) { + ICarvingGroup group = getGroup(block, metadata); + if (group == null) + return null; - return group.getVariations(); - } + return group.getVariations(); + } - public String getOre(Block block, int metadata) { - ICarvingGroup group = getGroup(block, metadata); - if(group == null) - return null; + public String getOre(Block block, int metadata) { + ICarvingGroup group = getGroup(block, metadata); + if (group == null) + return null; - return group.getOreName(); - } + return group.getOreName(); + } - public ArrayList getItems(ItemStack chiseledItem) { - ArrayList items = new ArrayList(); + public ArrayList getItems(ItemStack chiseledItem) { + ArrayList items = new ArrayList(); - int damage = chiseledItem.getItemDamage(); + int damage = chiseledItem.getItemDamage(); - ICarvingGroup group = getGroup(Block.getBlockFromItem(chiseledItem.getItem()), damage); - if(group == null) - return items; + ICarvingGroup group = getGroup(Block.getBlockFromItem(chiseledItem.getItem()), damage); + if (group == null) + return items; - HashMap mapping = new HashMap(); + HashMap mapping = new HashMap(); - List variations = group.getVariations(); + List variations = group.getVariations(); - if(!group.getVariations().isEmpty()) { - for (ICarvingVariation v : variations) { + if (!group.getVariations().isEmpty()) { + for (ICarvingVariation v : variations) { - String key = Block.getIdFromBlock(v.getBlock()) + "|" + v.getItemMeta(); - if(mapping.containsKey(key)) - continue; - mapping.put(key, 1); + String key = Block.getIdFromBlock(v.getBlock()) + "|" + v.getItemMeta(); + if (mapping.containsKey(key)) + continue; + mapping.put(key, 1); - items.add(new ItemStack(v.getBlock(), 1, v.getItemMeta())); - } - } + items.add(new ItemStack(v.getBlock(), 1, v.getItemMeta())); + } + } - ArrayList ores; - String oreName = group.getOreName(); - if(oreName != null && ((ores = OreDictionary.getOres(oreName)) != null)) { - for (ItemStack stack : ores) { + ArrayList ores; + String oreName = group.getOreName(); + if (oreName != null && ((ores = OreDictionary.getOres(oreName)) != null)) { + for (ItemStack stack : ores) { - String key = Item.getIdFromItem(stack.getItem()) + "|" + stack.getItemDamage(); - if(mapping.containsKey(key)) - continue; - mapping.put(key, 2); + String key = Item.getIdFromItem(stack.getItem()) + "|" + stack.getItemDamage(); + if (mapping.containsKey(key)) + continue; + mapping.put(key, 2); - items.add(stack); - } - } + items.add(stack); + } + } - return items; - } + return items; + } - public ICarvingGroup getGroup(Block block, int metadata) { - int[] ids = OreDictionary.getOreIDs(new ItemStack(block, metadata)); - if(ids.length > 0) { - for (int id : ids) { - ICarvingGroup oreGroup = groups.getGroupByOre(OreDictionary.getOreName(id)); - if(oreGroup != null) { - return oreGroup; - } - } - } + public ICarvingGroup getGroup(Block block, int metadata) { + int[] ids = OreDictionary.getOreIDs(new ItemStack(block, metadata)); + if (ids.length > 0) { + for (int id : ids) { + ICarvingGroup oreGroup = groups.getGroupByOre(OreDictionary.getOreName(id)); + if (oreGroup != null) { + return oreGroup; + } + } + } - return groups.getGroup(block, metadata); - } + return groups.getGroup(block, metadata); + } - public ICarvingGroup getGroup(String name) { - return groups.getGroupByName(name); - } + public ICarvingGroup getGroup(String name) { + return groups.getGroupByName(name); + } - public void addVariation(String groupName, Block block, int metadata, int order) { - if(block == null) { - throw new NullPointerException("Cannot add variation in group " + groupName + " for null block."); - } + public void addVariation(String groupName, Block block, int metadata, int order) { + if (block == null) { + throw new NullPointerException("Cannot add variation in group " + groupName + " for null block."); + } - ICarvingVariation variation = new CarvingVariation(block, metadata, order); - addVariation(groupName, variation); - } + ICarvingVariation variation = new CarvingVariation(block, metadata, order); + addVariation(groupName, variation); + } - public void addVariation(String groupName, ICarvingVariation variation) { - if(groupName == null) { - throw new NullPointerException("Cannot add variation to null group name."); - } else if(variation == null) { - throw new NullPointerException("Cannot add variation in group " + groupName + " for null variation."); - } + public void addVariation(String groupName, ICarvingVariation variation) { + if (groupName == null) { + throw new NullPointerException("Cannot add variation to null group name."); + } else if (variation == null) { + throw new NullPointerException("Cannot add variation in group " + groupName + " for null variation."); + } - ICarvingGroup group = groups.getGroupByName(groupName); + ICarvingGroup group = groups.getGroupByName(groupName); - if(group == null) { - group = new CarvingGroup(groupName); - addGroup(group); - } + if (group == null) { + group = new CarvingGroup(groupName); + addGroup(group); + } - groups.addVariation(groupName, variation); - } + groups.addVariation(groupName, variation); + } - public void addGroup(ICarvingGroup group) { - groups.add(group); - } + public void addGroup(ICarvingGroup group) { + groups.add(group); + } - public void registerOre(String name, String oreName) { - ICarvingGroup group = groups.getGroupByName(name); - if(group != null) { - group.setOreName(oreName); - } else { - throw new NullPointerException("Cannot register ore name for group " + name + ", as it does not exist."); - } - } + public void registerOre(String name, String oreName) { + ICarvingGroup group = groups.getGroupByName(name); + if (group != null) { + group.setOreName(oreName); + } else { + throw new NullPointerException("Cannot register ore name for group " + name + ", as it does not exist."); + } + } - public void setVariationSound(String name, String sound) { - ICarvingGroup group = groups.getGroupByName(name); - if(group != null) { - group.setSound(sound); - } else { - throw new NullPointerException("Cannot set sound for group " + name + ", as it does not exist."); - } - } + public void setVariationSound(String name, String sound) { + ICarvingGroup group = groups.getGroupByName(name); + if (group != null) { + group.setSound(sound); + } else { + throw new NullPointerException("Cannot set sound for group " + name + ", as it does not exist."); + } + } - public String getVariationSound(Block block, int metadata) { - return getVariationSound(Item.getItemFromBlock(block), metadata); - } + public String getVariationSound(Block block, int metadata) { + return getVariationSound(Item.getItemFromBlock(block), metadata); + } - public String getVariationSound(Item item, int metadata) { - ICarvingGroup group = groups.getGroup(Block.getBlockFromItem(item), metadata); - String sound = group == null ? null : group.getSound(); - return sound == null ? Chisel.MOD_ID + ":chisel.fallback" : sound; - } + public String getVariationSound(Item item, int metadata) { + ICarvingGroup group = groups.getGroup(Block.getBlockFromItem(item), metadata); + String sound = group == null ? null : group.getSound(); + return sound == null ? Chisel.MOD_ID + ":chisel.fallback" : sound; + } - public List getSortedGroupNames() { - List names = new ArrayList(); - names.addAll(groups.getNames()); - Collections.sort(names); - return names; - } + public List getSortedGroupNames() { + List names = new ArrayList(); + names.addAll(groups.getNames()); + Collections.sort(names); + return names; + } }