fix glock stuff

This commit is contained in:
Sunskimmer822 2022-07-18 17:34:31 -07:00
parent 2274852c9b
commit 8bbecbf135
5 changed files with 11 additions and 8 deletions

View File

@ -116,9 +116,9 @@ public class Shitmod implements ModInitializer {
public static final ToolItem COPPER_HOE = new copperHoe(copperMaterial.INSTANCE, -3, -1f, new Item.Settings().group(Shitmod.TOOLS_GROUP).maxDamage(250));
public static final Item GLOCK = new glock(new Item.Settings().group(Shitmod.TOOLS_GROUP).maxDamage(1000));
public static final Item GLOCK = new glock(new FabricItemSettings().group(Shitmod.TOOLS_GROUP).maxDamage(1000).rarity(Rarity.EPIC));
public static final SoundEvent GLOCK_NOISE = new SoundEvent(new Identifier("shitmod:glock"));
public static final SoundEvent GLOCK_NOISE = new SoundEvent(new Identifier("shitmod:glock_noise"));
@Override
public void onInitialize() {

View File

@ -22,8 +22,11 @@ public class glock extends Item{
arro.setVelocity(playerEntity, playerEntity.getPitch(), playerEntity.getHeadYaw(), 0f, 100, 0);
arro.setOwner(playerEntity);
world.spawnEntity(arro);
world.playSound(playerEntity.getX(), playerEntity.getY(), playerEntity.getZ(), Shitmod.GLOCK_NOISE, SoundCategory.PLAYERS, 1f, 1f, true);
if (!world.isClient()) {
world.playSound(null, playerEntity.getX(), playerEntity.getY(), playerEntity.getZ(), Shitmod.GLOCK_NOISE, SoundCategory.NEUTRAL, 1f, 1f, 1);
}
playerEntity.getMainHandStack().damage(1,playerEntity,e-> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
playerEntity.getItemCooldownManager().set(this, 20);
return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, playerEntity.getStackInHand(hand));
}

View File

@ -42,5 +42,5 @@
"itemGroup.shitmod.general": "Shitmod Misc",
"itemGroup.shitmod.tools": "Shitmod Tools",
"item.shitmod.glock": "Glock",
"subtitles.shitmod.glock": "Glock Fires"
"subtitles.shitmod.glock_noise": "Glock Fires"
}

View File

@ -1,8 +1,8 @@
{
"glocknoise": {
"subtitle": "subtitles.shitmod.glock",
"shitmod": [
"shitmod:glock"
"glock_noise": {
"subtitle": "subtitles.shitmod.glock_noise",
"sounds": [
"shitmod:glock_noise"
]
}
}