Skip to content

Commit

Permalink
Rename Hammer to Mallet, and add sprite localization and help text.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlgorithmX2 committed Dec 6, 2017
1 parent 9b6a5c5 commit e54da0e
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 11 deletions.
Expand Up @@ -123,7 +123,7 @@ public EnumActionResult hitWithTool(
{
// deployment

if ( usingHammer( handStack ) )
if ( usingMallet( handStack ) )
{
beginPlacement( player );
return EnumActionResult.SUCCESS;
Expand Down Expand Up @@ -198,7 +198,7 @@ else if ( handStack.getItem() == ChiselsAndBits.getItems().itemWrench )
{
// capture

if ( usingHammer( handStack ) )
if ( usingMallet( handStack ) )
{
beginCapture( player );
return EnumActionResult.SUCCESS;
Expand Down Expand Up @@ -279,10 +279,10 @@ private void sendUpdate()
NetworkRouter.instance.sendToServer( getConfiguration() );
}

private boolean usingHammer(
private boolean usingMallet(
ItemStack handStack )
{
return ModUtil.notEmpty( handStack ) && handStack.getItem() == ChiselsAndBits.getItems().itemHammer;
return ModUtil.notEmpty( handStack ) && handStack.getItem() == ChiselsAndBits.getItems().itemMallet;
}

private void adjustSize(
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mod/chiselsandbits/core/ClientSide.java
Expand Up @@ -286,6 +286,7 @@ public void registerItemModels()
registerMesh( modItems.itemChiselDiamond, 0, new ModelResourceLocation( new ResourceLocation( modId, "chisel_diamond" ), "inventory" ) );
registerMesh( modItems.itemBitBag, 0, new ModelResourceLocation( new ResourceLocation( modId, "bit_bag" ), "inventory" ) );
registerMesh( modItems.itemWrench, 0, new ModelResourceLocation( new ResourceLocation( modId, "wrench_wood" ), "inventory" ) );
registerMesh( modItems.itemMallet, 0, new ModelResourceLocation( new ResourceLocation( modId, "mallet_wood" ), "inventory" ) );
registerMesh( modItems.itemBitSawDiamond, 0, new ModelResourceLocation( new ResourceLocation( modId, "bitsaw_diamond" ), "inventory" ) );
registerMesh( modItems.itemTapeMeasure, 0, new ModelResourceLocation( new ResourceLocation( modId, "tape_measure" ), "inventory" ) );

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mod/chiselsandbits/helpers/LocalStrings.java
Expand Up @@ -97,7 +97,7 @@ public enum LocalStrings
BitOptionPlace( "bitoption.place" ),
BitOptionReplace( "bitoption.replace" ),

HelpHammer( "help.hammer" );
HelpMallet( "help.mallet" );

private final String string;

Expand Down
Expand Up @@ -4,7 +4,9 @@

import mod.chiselsandbits.blueprints.EntityBlueprint;
import mod.chiselsandbits.core.ChiselsAndBits;
import mod.chiselsandbits.core.ClientSide;
import mod.chiselsandbits.helpers.LocalStrings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
Expand All @@ -18,10 +20,10 @@
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ItemHammer extends Item
public class ItemMallet extends Item
{

public ItemHammer()
public ItemMallet()
{
setMaxStackSize( 1 );
}
Expand Down Expand Up @@ -77,7 +79,7 @@ public void addInformation(
final ITooltipFlag advanced )
{
super.addInformation( stack, worldIn, tooltip, advanced );
ChiselsAndBits.getConfig().helpText( LocalStrings.HelpHammer, tooltip );
ChiselsAndBits.getConfig().helpText( LocalStrings.HelpMallet, tooltip, ClientSide.instance.getKeyName( Minecraft.getMinecraft().gameSettings.keyBindUseItem ) );
}

}
6 changes: 3 additions & 3 deletions src/main/java/mod/chiselsandbits/registry/ModItems.java
Expand Up @@ -7,7 +7,7 @@
import mod.chiselsandbits.items.ItemBitSaw;
import mod.chiselsandbits.items.ItemChisel;
import mod.chiselsandbits.items.ItemChiseledBit;
import mod.chiselsandbits.items.ItemHammer;
import mod.chiselsandbits.items.ItemMallet;
import mod.chiselsandbits.items.ItemMirrorPrint;
import mod.chiselsandbits.items.ItemNegativePrint;
import mod.chiselsandbits.items.ItemPositivePrint;
Expand All @@ -29,7 +29,7 @@ public class ModItems extends ModRegistry
final public ItemNegativePrint itemNegativeprint;

final public ItemBlueprint itemBlueprint;
final public ItemHammer itemHammer;
final public ItemMallet itemMallet;

final public ItemBitBag itemBitBag;
final public ItemWrench itemWrench;
Expand All @@ -52,7 +52,7 @@ public ModItems(
itemBitSawDiamond = registerItem( config.enableBitSaw, new ItemBitSaw(), "bitsaw_diamond" );
itemBlockBit = registerItem( config.enableChisledBits, new ItemChiseledBit(), "block_bit" );
itemBlueprint = registerItem( config.enableBlueprints, new ItemBlueprint(), "blueprint" );
itemHammer = registerItem( config.enableBlueprints, new ItemHammer(), "hammer" );
itemMallet = registerItem( config.enableBlueprints, new ItemMallet(), "mallet_wood" );
itemTapeMeasure = registerItem( config.enableTapeMeasure, new ItemTapeMeasure(), "tape_measure" );
registerItem( config.enableAPITestingItem, new ItemApiDebug(), "debug" );
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/chiselsandbits/lang/en_us.lang
Expand Up @@ -22,6 +22,8 @@ tile.mod.chiselsandbits.bittank.name=Chiseled Fluid Bit Tank
item.mod.chiselsandbits.block_bit.name=Chiseled Bit
item.mod.chiselsandbits.bit_bag.name=Chiseled Bit Bag
item.mod.chiselsandbits.wrench_wood.name=Wooden Wrench

item.mod.chiselsandbits.mallet_wood.name=Mallet
item.mod.chiselsandbits.blueprint.name=Blueprint
item.mod.chiselsandbits.blueprint_written.name=Blueprint - Written

Expand Down Expand Up @@ -103,6 +105,7 @@ mod.chiselsandbits.help.filled=Filled
mod.chiselsandbits.help.chiseled_block={} to place;{} to ignore block grid;Mouse Wheel to cycle placement rotation.
mod.chiselsandbits.help.bit_bag=Automatically re-stock, and store bits.
mod.chiselsandbits.help.wrench={} blocks to rotate.
mod.chiselsandbits.help.mallet={} to write/construct blue prints.
mod.chiselsandbits.help.bit={} to chisel;{} to place;Use {} to display menu.
mod.chiselsandbits.help.positiveprint={} to write;{} to chisel/place or Craft with bits/bags.;Mouse Wheel to cycle rotation;Use {} to display menu.
mod.chiselsandbits.help.negativeprint={} to write;{} to chisel.;Mouse Wheel to cycle rotation.
Expand Down
@@ -0,0 +1,6 @@
{
"parent":"chiselsandbits:item/tool",
"textures": {
"layer0":"chiselsandbits:items/mallet_wood"
}
}
19 changes: 19 additions & 0 deletions src/main/resources/assets/chiselsandbits/recipes/mallet_wood.json
@@ -0,0 +1,19 @@
{
"result": {
"item": "chiselsandbits:mallet_wood"
},
"pattern": [
"WS"
],
"type": "minecraft:crafting_shaped",
"key": {
"S": {
"type": "forge:ore_dict",
"ore": "stickWood"
},
"W": {
"type": "forge:ore_dict",
"ore": "plankWood"
}
}
}
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 e54da0e

Please sign in to comment.