Skip to content

Commit

Permalink
Merge pull request #6 from Prometheus0000/add-chisel
Browse files Browse the repository at this point in the history
Add more durable chisel
  • Loading branch information
Dream-Master authored Oct 31, 2020
2 parents aed35c3 + 06dadab commit 6916e91
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/main/java/team/chisel/Features.java
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,11 @@ void addItems() {
ItemChisel chisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.IRON).setCreativeTab(ChiselTabs.tabChisel);
ItemChisel diamondChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.DIAMOND).setCreativeTab(ChiselTabs.tabChisel);
ItemChisel obsidianChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.OBSIDIAN).setCreativeTab(ChiselTabs.tabChisel);
ItemChisel netherStarChisel = (ItemChisel) new ItemChisel(ItemChisel.ChiselType.NETHERSTAR).setCreativeTab(ChiselTabs.tabChisel);
GameRegistry.registerItem(chisel, "chisel");
GameRegistry.registerItem(diamondChisel, "diamondChisel");
GameRegistry.registerItem(obsidianChisel, "obsidianChisel");
GameRegistry.registerItem(netherStarChisel, "netherStarChisel");
}

@Override
Expand All @@ -472,10 +474,12 @@ void addRecipes() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.chisel), " YY", " YY", "X ", 'X', "stickWood", 'Y', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.diamondChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', "gemDiamond"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.obsidianChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', Blocks.obsidian));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.netherStarChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', "netherStar"));
} else {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.chisel), " Y", "X ", 'X', "stickWood", 'Y', "ingotIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.diamondChisel), " Y", "X ", 'X', "stickWood", 'Y', "gemDiamond"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.obsidianChisel), " Y", "X ", 'X', "stickWood", 'Y', Blocks.obsidian));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselItems.netherStarChisel), " YY", " YY", "x ", 'x', "stickWood", 'Y', "netherStar"));
}
}
},
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/team/chisel/config/Configurations.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ public class Configurations {
public static int ironChiselMaxDamage;
public static int diamondChiselMaxDamage;
public static int obsidianChiselMaxDamage;
public static int netherStarChiselMaxDamage;
public static boolean ironChiselCanLeftClick;
public static boolean ironChiselHasModes;
public static int ironChiselAttackDamage;
public static int diamondChiselAttackDamage;
public static int obsidianChiselAttackDamage;
public static int netherStarChiselAttackDamage;
public static boolean allowChiselCrossColors;

public static boolean useRoadLineTool;
Expand Down Expand Up @@ -102,6 +104,7 @@ public static boolean refreshConfig() {
ironChiselMaxDamage = config.getInt("ironChiselMaxDamage", category, 500, 1, Short.MAX_VALUE, "The max damage of the standard iron chisel.");
diamondChiselMaxDamage = config.getInt("diamondChiselMaxDamage", category, 5000, 1, Short.MAX_VALUE, "The max damage of the diamond chisel.");
obsidianChiselMaxDamage = config.getInt("obsidianChiselMaxDamage", category, 2500, 1, Short.MAX_VALUE, "The max damage of the obsidian chisel.");
netherStarChiselMaxDamage = config.getInt("netherStarChiselMaxDamage", category, 32767, 1, Short.MAX_VALUE, "The max damage of the nether star chisel.");
ironChiselCanLeftClick = config.get(category, "ironChiselCanLeftClick", true, "If this is true, the iron chisel can left click chisel blocks. If false, it cannot.").getBoolean();
ironChiselHasModes = config.get(category, "ironChiselHasModes", false, "If this is true, the iron chisel can change its chisel mode just as the diamond chisel can.").getBoolean();
allowChiselCrossColors = config.get(category, "allowChiselCrossColors", true, "Should someone be able to chisel something into a different color.").getBoolean();
Expand All @@ -112,6 +115,8 @@ public static boolean refreshConfig() {
"The extra attack damage points (in half hearts) that the diamond chisel inflicts when it is used to attack an entity.").getInt();
obsidianChiselAttackDamage = config.get(category, "obsidianChiselAttackDamage", 4,
"The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.").getInt();
netherStarChiselAttackDamage = config.get(category, "netherStarChiselAttackDamage", 6,
"The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.").getInt();

/* block */
category = "block";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/team/chisel/init/ChiselItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public final class ChiselItems {
public static final ItemChisel chisel = null;
public static final ItemChisel diamondChisel = null;
public static final ItemChisel obsidianChisel = null;
public static final ItemChisel netherStarChisel = null;
public static final ItemCloudInABottle cloudinabottle = null;
public static final ItemBallOMoss ballomoss = null;
public static final ItemSmashingRock smashingrock = null;
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/team/chisel/item/chisel/ItemChisel.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public class ItemChisel extends Item implements IChiselItem {
public enum ChiselType {
IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage),
DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage),
OBSIDIAN(Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage);
OBSIDIAN(Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage),
NETHERSTAR(Configurations.netherStarChiselMaxDamage, Configurations.netherStarChiselAttackDamage);

final int maxDamage;
final int attackDamage;
Expand Down Expand Up @@ -74,8 +75,9 @@ public boolean getIsRepairable(ItemStack damagedItem, ItemStack repairMaterial)
return repairMaterial.getItem().equals(Items.iron_ingot);
case OBSIDIAN:
return repairMaterial.getItem().equals(Item.getItemFromBlock(Blocks.obsidian));
case NETHERSTAR:
return repairMaterial.getItem().equals(Items.nether_star);
}

return false;
}

Expand All @@ -93,11 +95,11 @@ public void addInformation(ItemStack stack, EntityPlayer player, List list, bool
String lc2 = I18n.format(base + "lc2");
String modes = I18n.format(base + "modes");
list.add(gui);
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselCanLeftClick) {
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselCanLeftClick) {
list.add(lc1);
list.add(lc2);
}
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselHasModes) {
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselHasModes) {
list.add("");
list.add(modes);
}
Expand Down Expand Up @@ -139,11 +141,11 @@ public boolean onChisel(World world, ItemStack chisel, ICarvingVariation target)

@Override
public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata) {
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselCanLeftClick;
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselCanLeftClick;
}

@Override
public boolean hasModes(ItemStack chisel) {
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || Configurations.ironChiselHasModes;
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN || type == ChiselType.NETHERSTAR || Configurations.ironChiselHasModes;
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/chisel/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ item.chisel.chisel.desc.modes=Has multiple modes for chiseling.

item.chisel.chisel_diamond.name=Diamond Chisel
item.chisel.chisel_obsidian.name=Obsidian Chisel
item.chisel.chisel_netherstar.name=Nether Star Chisel

item.ballMoss.name=Ball O' Moss
item.ballMoss.desc=Right-Click to throw. This will turn Cobblestone to Moss Stone on impact.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6916e91

Please sign in to comment.