Added the muffler upgrade (#2928)
* Added flag for ability to play sound. * Added muffler functionality * Added muffler to upgrade advancement * Added muffler model * Added muffler lang entry * Added muffler placeholder texture * Added muffler recipe + toast * Added muffler tooltip
This commit is contained in:
parent
b14a4c72a1
commit
a574c7f67e
12 changed files with 135 additions and 5 deletions
|
@ -89,8 +89,13 @@ public class AbstractBlockBlockEntity extends GenericMachineBlockEntity implemen
|
|||
//BlockBreakerProcessable
|
||||
@Override
|
||||
public void playSound() {
|
||||
if (RecipeCrafter.soundHandler != null) {
|
||||
if (RecipeCrafter.soundHandler != null && canPlaySound()) {
|
||||
RecipeCrafter.soundHandler.playSound(false, this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaySound() {
|
||||
return !isMuffled();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,9 +23,19 @@ public interface BlockProcessable extends IUpgradeHandler, RedstoneConfigurable,
|
|||
*/
|
||||
boolean consumeEnergy(int amount);
|
||||
|
||||
|
||||
/**
|
||||
* <b>Play a sound to the Minecraft world</b>
|
||||
*
|
||||
* @see #canPlaySound()
|
||||
*/
|
||||
void playSound();
|
||||
|
||||
/**
|
||||
* <b>If a sound can be played.</b>
|
||||
*
|
||||
* @see #playSound()
|
||||
*/
|
||||
default boolean canPlaySound() {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1496,6 +1496,9 @@ public class TRContent {
|
|||
if (aesu != null) {
|
||||
aesu.superconductors += TechRebornConfig.superConductorCount;
|
||||
}
|
||||
}),
|
||||
MUFFLER((blockEntity, handler, stack) -> {
|
||||
blockEntity.muffle();
|
||||
});
|
||||
|
||||
public String name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue