mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
Fix formatting issues in last commit
This commit is contained in:
1 parent
ab2b3e8421
commit
63af23ebff
2 files changed
+126
-121
No files matched your search
@@ -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");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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<ICarvingVariation> getVariations(Block block, int metadata) {
|
||||
ICarvingGroup group = getGroup(block, metadata);
|
||||
if(group == null)
|
||||
return null;
|
||||
public List<ICarvingVariation> 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<ItemStack> getItems(ItemStack chiseledItem) {
|
||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
public ArrayList<ItemStack> getItems(ItemStack chiseledItem) {
|
||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
||||
|
||||
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<String, Integer> mapping = new HashMap<String, Integer>();
|
||||
HashMap<String, Integer> mapping = new HashMap<String, Integer>();
|
||||
|
||||
List<ICarvingVariation> variations = group.getVariations();
|
||||
List<ICarvingVariation> 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<ItemStack> ores;
|
||||
String oreName = group.getOreName();
|
||||
if(oreName != null && ((ores = OreDictionary.getOres(oreName)) != null)) {
|
||||
for (ItemStack stack : ores) {
|
||||
ArrayList<ItemStack> 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<String> getSortedGroupNames() {
|
||||
List<String> names = new ArrayList<String>();
|
||||
names.addAll(groups.getNames());
|
||||
Collections.sort(names);
|
||||
return names;
|
||||
}
|
||||
public List<String> getSortedGroupNames() {
|
||||
List<String> names = new ArrayList<String>();
|
||||
names.addAll(groups.getNames());
|
||||
Collections.sort(names);
|
||||
return names;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user