-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start sound addition * Tool sounds, start * Config time * More sounds * science * Acquire all machine sounds * Set remaining simple machine sounds * All remaining sounds * All remaining sounds * Pick selected wrench sound * Refactor onAttached calls * May or may not fix CME * Compressor.ogg fixes * More sound fixes * More sound fixes * Get hammers to do muffling toggling * Implement @Zalgo239's hum.ogg * Requested changes * Typo * Requested changes round 2 * Requested changes round 2 * Try to fix formatting, try 2 * Try to fix formatting, try 3 * Move to ToolChainsaw * add ability to make MetaItem records * Fix unobfuscated mapping * Use field_72769_h * Wrench rotation sounds * Re-cherry-pick Kila's commit Co-authored-by: DStrand1 <[email protected]> Co-authored-by: Yefancy <[email protected]>
- Loading branch information
1 parent
dd5f91e
commit e3e2960
Showing
83 changed files
with
976 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package gregtech.api.capability.tool; | ||
|
||
public interface IHammerItem { | ||
|
||
boolean damageItem(int damage, boolean simulate); | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/gregtech/api/items/metaitem/MusicDiscStats.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package gregtech.api.items.metaitem; | ||
|
||
import gregtech.api.items.metaitem.stats.IItemBehaviour; | ||
import gregtech.api.items.metaitem.stats.IMusicDisc; | ||
import net.minecraft.block.BlockJukebox; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.stats.StatList; | ||
import net.minecraft.util.*; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
public class MusicDiscStats implements IMusicDisc, IItemBehaviour { | ||
|
||
private final SoundEvent sound; | ||
|
||
public MusicDiscStats(SoundEvent sound) { | ||
this.sound = sound; | ||
} | ||
|
||
@SideOnly(Side.CLIENT) | ||
@Override | ||
public SoundEvent getSound() { | ||
return sound; | ||
} | ||
|
||
@Override | ||
public ActionResult<ItemStack> onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { | ||
IBlockState iblockstate = world.getBlockState(pos); | ||
ItemStack itemStack = player.getHeldItem(hand); | ||
if (iblockstate.getBlock() == Blocks.JUKEBOX && !(Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)) { | ||
if (!world.isRemote) { | ||
((BlockJukebox)Blocks.JUKEBOX).insertRecord(world, pos, iblockstate, itemStack); | ||
world.playEvent(1010, pos, itemStack.getItemDamage()); | ||
itemStack.shrink(1); | ||
player.addStat(StatList.RECORD_PLAYED); | ||
} | ||
|
||
return ActionResult.newResult(EnumActionResult.SUCCESS, itemStack); | ||
} else { | ||
return ActionResult.newResult(EnumActionResult.PASS, itemStack); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/gregtech/api/items/metaitem/stats/IMusicDisc.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package gregtech.api.items.metaitem.stats; | ||
|
||
import net.minecraft.util.SoundEvent; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
public interface IMusicDisc extends IItemComponent { | ||
|
||
@SideOnly(Side.CLIENT) | ||
SoundEvent getSound(); | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/gregtech/api/items/toolitem/HammerItemStat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package gregtech.api.items.toolitem; | ||
|
||
import gregtech.api.capability.GregtechCapabilities; | ||
import gregtech.api.capability.tool.IHammerItem; | ||
import gregtech.api.capability.tool.IWrenchItem; | ||
import gregtech.api.items.metaitem.stats.IItemCapabilityProvider; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.common.capabilities.Capability; | ||
import net.minecraftforge.common.capabilities.ICapabilityProvider; | ||
|
||
public class HammerItemStat implements IItemCapabilityProvider { | ||
|
||
@Override | ||
public ICapabilityProvider createProvider(ItemStack itemStack) { | ||
return new CapabilityProvider(itemStack); | ||
} | ||
|
||
private static class CapabilityProvider extends AbstractToolItemCapabilityProvider<IHammerItem> implements IHammerItem { | ||
|
||
public CapabilityProvider(ItemStack itemStack) { | ||
super(itemStack); | ||
} | ||
|
||
@Override | ||
protected Capability<IHammerItem> getCapability() { | ||
return GregtechCapabilities.CAPABILITY_HAMMER; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.