规范化代码
This commit is contained in:
parent
53aa88788e
commit
411791cc43
22 changed files with 72 additions and 112 deletions
|
@ -63,7 +63,7 @@ public class AmmoBarOverlay {
|
|||
|
||||
event.getGuiGraphics().drawString(
|
||||
Minecraft.getInstance().font,
|
||||
"[" + TargetModKeyMappings.FIREMODE.getKey().getDisplayName().getString() + "]",
|
||||
"[" + TargetModKeyMappings.FIRE_MODE.getKey().getDisplayName().getString() + "]",
|
||||
w - 111.5f,
|
||||
h - 20,
|
||||
0xFFFFFF,
|
||||
|
|
|
@ -5,7 +5,6 @@ import net.minecraft.commands.CommandSource;
|
|||
import net.minecraft.commands.CommandSourceStack;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
@ -28,13 +27,13 @@ public class MediumExpCommand {
|
|||
double z = arguments.getSource().getPosition().z();
|
||||
|
||||
if (!world.isClientSide()) {
|
||||
world.playSound(null, BlockPos.containing(x, y + 1, z), TargetModSounds.EXP.get(), SoundSource.BLOCKS, 8, 1);
|
||||
world.playSound(null, BlockPos.containing(x, y + 1, z), TargetModSounds.EXPFAR.get(), SoundSource.BLOCKS, 16, 1);
|
||||
world.playSound(null, BlockPos.containing(x, y + 1, z), TargetModSounds.EXPVERYFAR.get(), SoundSource.BLOCKS, 32, 1);
|
||||
world.playSound(null, BlockPos.containing(x, y + 1, z), TargetModSounds.EXPLOSION.get(), SoundSource.BLOCKS, 8, 1);
|
||||
world.playSound(null, BlockPos.containing(x, y + 1, z), TargetModSounds.EXPLOSION_FAR.get(), SoundSource.BLOCKS, 16, 1);
|
||||
world.playSound(null, BlockPos.containing(x, y + 1, z), TargetModSounds.EXPLOSION_VERY_FAR.get(), SoundSource.BLOCKS, 32, 1);
|
||||
} else {
|
||||
world.playLocalSound(x, (y + 1), z, TargetModSounds.EXP.get(), SoundSource.BLOCKS, 24, 1, false);
|
||||
world.playLocalSound(x, (y + 1), z, TargetModSounds.EXPFAR.get(), SoundSource.BLOCKS, 24, 1, false);
|
||||
world.playLocalSound(x, (y + 1), z, TargetModSounds.EXPVERYFAR.get(), SoundSource.BLOCKS, 64, 1, false);
|
||||
world.playLocalSound(x, (y + 1), z, TargetModSounds.EXPLOSION.get(), SoundSource.BLOCKS, 24, 1, false);
|
||||
world.playLocalSound(x, (y + 1), z, TargetModSounds.EXPLOSION_FAR.get(), SoundSource.BLOCKS, 24, 1, false);
|
||||
world.playLocalSound(x, (y + 1), z, TargetModSounds.EXPLOSION_VERY_FAR.get(), SoundSource.BLOCKS, 64, 1, false);
|
||||
}
|
||||
|
||||
if (world instanceof ServerLevel server) {
|
||||
|
|
|
@ -168,7 +168,7 @@ public class Target1Entity extends PathfinderMob implements GeoEntity, AnimatedE
|
|||
if (entity instanceof Target1Entity target1) {
|
||||
target1.setHealth(target1.getMaxHealth());
|
||||
|
||||
sourceEntity.level().playLocalSound(sourceEntity.blockPosition(), TargetModSounds.TARGETDOWN.get(), SoundSource.PLAYERS, 100, 1, false);
|
||||
sourceEntity.level().playLocalSound(sourceEntity.blockPosition(), TargetModSounds.TARGET_DOWN.get(), SoundSource.PLAYERS, 100, 1, false);
|
||||
|
||||
if (sourceEntity instanceof Player player)
|
||||
player.displayClientMessage(Component.literal(("Target Down " + new java.text.DecimalFormat("##.#").format((entity.position()).distanceTo((sourceEntity.position()))) + "M")), true);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package net.mcreator.target.headshot;
|
||||
//import com.mrcrayfish.guns.Config;
|
||||
|
||||
import net.mcreator.target.init.TargetModEntities;
|
||||
import net.minecraft.util.Mth;
|
||||
|
@ -20,8 +19,6 @@ import java.util.LinkedList;
|
|||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
//TODO retrieve this data from a datapack
|
||||
|
||||
/**
|
||||
* Author: MrCrayfish
|
||||
*/
|
||||
|
@ -103,9 +100,6 @@ public class BoundingBoxManager {
|
|||
|
||||
@SubscribeEvent(receiveCanceled = true)
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
// if(!Config.COMMON.gameplay.improvedHitboxes.get())
|
||||
// return;
|
||||
|
||||
if (event.side == LogicalSide.SERVER && event.phase == TickEvent.Phase.END) {
|
||||
if (event.player.isSpectator()) {
|
||||
playerBoxes.remove(event.player);
|
||||
|
|
|
@ -1,26 +1,15 @@
|
|||
package net.mcreator.target.headshot;
|
||||
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* This interface used to create hit box definitions of an entity's head. This has to be registered with
|
||||
* {@link com.mrcrayfish.guns.common.BoundingBoxManager#registerHeadshotBox(EntityType, IHeadshotBox)}
|
||||
* in order for projectiles to be able to perform a headshot on the given entity.
|
||||
* <p>
|
||||
* Author: MrCrayfish
|
||||
*/
|
||||
public interface IHeadshotBox<T extends Entity> {
|
||||
/**
|
||||
* Gets a bounding box of the given entity's head in the world. This method can either return an
|
||||
* axis aligned box or null for no hit box.
|
||||
*
|
||||
* @param entity the entity to create a headshot box from
|
||||
* @return an axis aligned box of the entity's head
|
||||
*/
|
||||
|
||||
@Nullable
|
||||
AABB getHeadshotBox(T entity);
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.mcreator.target.TargetMod;
|
||||
|
@ -17,6 +16,7 @@ import net.minecraftforge.registries.RegistryObject;
|
|||
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||
public class TargetModAttributes {
|
||||
public static final DeferredRegister<Attribute> ATTRIBUTES = DeferredRegister.create(ForgeRegistries.ATTRIBUTES, TargetMod.MODID);
|
||||
|
||||
public static final RegistryObject<Attribute> MORTAR_PITCH = ATTRIBUTES.register("mortar_pitch", () -> (new RangedAttribute("attribute." + TargetMod.MODID + ".mortar_pitch", 70, 20, 89)).setSyncable(true));
|
||||
public static final RegistryObject<Attribute> SPREAD = ATTRIBUTES.register("spread", () -> (new RangedAttribute("attribute." + TargetMod.MODID + ".spread", 0, 0, 1024)).setSyncable(true));
|
||||
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
/*
|
||||
* MCreator note: This file will be REGENERATED on each build.
|
||||
*/
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.mcreator.target.TargetMod;
|
||||
|
@ -13,6 +9,7 @@ import net.minecraftforge.registries.RegistryObject;
|
|||
|
||||
public class TargetModBlocks {
|
||||
public static final DeferredRegister<Block> REGISTRY = DeferredRegister.create(ForgeRegistries.BLOCKS, TargetMod.MODID);
|
||||
|
||||
public static final RegistryObject<Block> SANDBAG = REGISTRY.register("sandbag", SandbagBlock::new);
|
||||
public static final RegistryObject<Block> BARBED_WIRE = REGISTRY.register("barbed_wire", BarbedWireBlock::new);
|
||||
public static final RegistryObject<Block> JUMPPAD_BLOCK = REGISTRY.register("jumppad_block", JumppadBlockBlock::new);
|
||||
|
|
|
@ -30,7 +30,8 @@ public class TargetModKeyMappings {
|
|||
isDownOld = isDown;
|
||||
}
|
||||
};
|
||||
public static final KeyMapping DOUBLEJUMPINPUT = new KeyMapping("key.target.doublejumpinput", GLFW.GLFW_KEY_SPACE, "key.categories.target") {
|
||||
|
||||
public static final KeyMapping DOUBLE_JUMP = new KeyMapping("key.target.double_jump", GLFW.GLFW_KEY_SPACE, "key.categories.target") {
|
||||
private boolean isDownOld = false;
|
||||
|
||||
@Override
|
||||
|
@ -45,7 +46,8 @@ public class TargetModKeyMappings {
|
|||
isDownOld = isDown;
|
||||
}
|
||||
};
|
||||
public static final KeyMapping FIREMODE = new KeyMapping("key.target.firemode", GLFW.GLFW_KEY_N, "key.categories.target") {
|
||||
|
||||
public static final KeyMapping FIRE_MODE = new KeyMapping("key.target.fire_mode", GLFW.GLFW_KEY_N, "key.categories.target") {
|
||||
private boolean isDownOld = false;
|
||||
|
||||
@Override
|
||||
|
@ -58,6 +60,7 @@ public class TargetModKeyMappings {
|
|||
isDownOld = isDown;
|
||||
}
|
||||
};
|
||||
|
||||
public static final KeyMapping ZOOM = new KeyMapping("key.target.zoom", InputConstants.Type.MOUSE, GLFW.GLFW_MOUSE_BUTTON_RIGHT, "key.categories.target") {
|
||||
private boolean isDownOld = false;
|
||||
|
||||
|
@ -67,22 +70,23 @@ public class TargetModKeyMappings {
|
|||
if (isDownOld != isDown && isDown && Minecraft.getInstance().player != null) {
|
||||
TargetMod.PACKET_HANDLER.sendToServer(new ZoomMessage(0, 0));
|
||||
ZoomMessage.pressAction(Minecraft.getInstance().player, 0);
|
||||
ZOOM_LASTPRESS = System.currentTimeMillis();
|
||||
ZOOM_LAST_PRESS = System.currentTimeMillis();
|
||||
} else if (isDownOld != isDown && Minecraft.getInstance().player != null) {
|
||||
int dt = (int) (System.currentTimeMillis() - ZOOM_LASTPRESS);
|
||||
int dt = (int) (System.currentTimeMillis() - ZOOM_LAST_PRESS);
|
||||
TargetMod.PACKET_HANDLER.sendToServer(new ZoomMessage(1, dt));
|
||||
ZoomMessage.pressAction(Minecraft.getInstance().player, 1);
|
||||
}
|
||||
isDownOld = isDown;
|
||||
}
|
||||
};
|
||||
private static long ZOOM_LASTPRESS = 0;
|
||||
|
||||
private static long ZOOM_LAST_PRESS = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void registerKeyMappings(RegisterKeyMappingsEvent event) {
|
||||
event.register(RELOAD);
|
||||
event.register(DOUBLEJUMPINPUT);
|
||||
event.register(FIREMODE);
|
||||
event.register(DOUBLE_JUMP);
|
||||
event.register(FIRE_MODE);
|
||||
event.register(ZOOM);
|
||||
}
|
||||
|
||||
|
@ -92,8 +96,8 @@ public class TargetModKeyMappings {
|
|||
public static void onClientTick(TickEvent.ClientTickEvent event) {
|
||||
if (Minecraft.getInstance().screen == null) {
|
||||
RELOAD.consumeClick();
|
||||
DOUBLEJUMPINPUT.consumeClick();
|
||||
FIREMODE.consumeClick();
|
||||
DOUBLE_JUMP.consumeClick();
|
||||
FIRE_MODE.consumeClick();
|
||||
ZOOM.consumeClick();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
/*
|
||||
* MCreator note: This file will be REGENERATED on each build.
|
||||
*/
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.mcreator.target.TargetMod;
|
||||
|
@ -15,6 +11,7 @@ import net.minecraftforge.registries.RegistryObject;
|
|||
|
||||
public class TargetModMenus {
|
||||
public static final DeferredRegister<MenuType<?>> REGISTRY = DeferredRegister.create(ForgeRegistries.MENU_TYPES, TargetMod.MODID);
|
||||
|
||||
public static final RegistryObject<MenuType<MortarGUIMenu>> MORTAR_GUI = REGISTRY.register("mortar_gui", () -> IForgeMenuType.create(MortarGUIMenu::new));
|
||||
public static final RegistryObject<MenuType<GunRecycleGuiMenu>> GUN_RECYCLE_GUI = REGISTRY.register("gun_recycle_gui", () -> IForgeMenuType.create(GunRecycleGuiMenu::new));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
/*
|
||||
* MCreator note: This file will be REGENERATED on each build.
|
||||
*/
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.mcreator.target.TargetMod;
|
||||
|
@ -13,5 +9,6 @@ import net.minecraftforge.registries.RegistryObject;
|
|||
|
||||
public class TargetModMobEffects {
|
||||
public static final DeferredRegister<MobEffect> REGISTRY = DeferredRegister.create(ForgeRegistries.MOB_EFFECTS, TargetMod.MODID);
|
||||
|
||||
public static final RegistryObject<MobEffect> SHOCK = REGISTRY.register("shock", ShockMobEffect::new);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
/*
|
||||
* MCreator note: This file will be REGENERATED on each build.
|
||||
*/
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.mcreator.target.client.model.entity.*;
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
/*
|
||||
* MCreator note: This file will be REGENERATED on each build.
|
||||
*/
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.mcreator.target.client.gui.GunRecycleGuiScreen;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.mcreator.target.TargetMod;
|
||||
|
@ -8,8 +7,10 @@ import net.minecraftforge.registries.DeferredRegister;
|
|||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class TargetModSounds {
|
||||
public static final DeferredRegister<SoundEvent> REGISTRY = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, TargetMod.MODID);
|
||||
|
||||
public static final RegistryObject<SoundEvent> TASER_FIRE_1P = REGISTRY.register("taser_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "taser_fire_1p")));
|
||||
public static final RegistryObject<SoundEvent> TASER_FIRE_3P = REGISTRY.register("taser_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "taser_fire_3p")));
|
||||
public static final RegistryObject<SoundEvent> TASER_RELOAD = REGISTRY.register("taser_reload", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "taser_reload")));
|
||||
|
@ -19,15 +20,15 @@ public class TargetModSounds {
|
|||
public static final RegistryObject<SoundEvent> TRACHELIUM_FAR = REGISTRY.register("trachelium_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "trachelium_far")));
|
||||
public static final RegistryObject<SoundEvent> TRACHELIUM_VERYFAR = REGISTRY.register("trachelium_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "trachelium_veryfar")));
|
||||
public static final RegistryObject<SoundEvent> TRACHELIUM_RELOAD = REGISTRY.register("trachelium_reload", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "trachelium_reload")));
|
||||
public static final RegistryObject<SoundEvent> TRIGGERCLICK = REGISTRY.register("triggerclick", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "triggerclick")));
|
||||
public static final RegistryObject<SoundEvent> TRIGGER_CLICK = REGISTRY.register("triggerclick", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "triggerclick")));
|
||||
public static final RegistryObject<SoundEvent> HIT = REGISTRY.register("hit", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hit")));
|
||||
public static final RegistryObject<SoundEvent> TARGETDOWN = REGISTRY.register("targetdown", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "targetdown")));
|
||||
public static final RegistryObject<SoundEvent> TARGET_DOWN = REGISTRY.register("targetdown", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "targetdown")));
|
||||
public static final RegistryObject<SoundEvent> INDICATION = REGISTRY.register("indication", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "indication")));
|
||||
public static final RegistryObject<SoundEvent> JUMP = REGISTRY.register("jump", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "jump")));
|
||||
public static final RegistryObject<SoundEvent> DOUBLEJUMP = REGISTRY.register("doublejump", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "doublejump")));
|
||||
public static final RegistryObject<SoundEvent> EXP = REGISTRY.register("exp", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "exp")));
|
||||
public static final RegistryObject<SoundEvent> EXPFAR = REGISTRY.register("expfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "expfar")));
|
||||
public static final RegistryObject<SoundEvent> EXPVERYFAR = REGISTRY.register("expveryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "expveryfar")));
|
||||
public static final RegistryObject<SoundEvent> DOUBLE_JUMP = REGISTRY.register("doublejump", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "doublejump")));
|
||||
public static final RegistryObject<SoundEvent> EXPLOSION = REGISTRY.register("exp", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "exp")));
|
||||
public static final RegistryObject<SoundEvent> EXPLOSION_FAR = REGISTRY.register("expfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "expfar")));
|
||||
public static final RegistryObject<SoundEvent> EXPLOSION_VERY_FAR = REGISTRY.register("expveryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "expveryfar")));
|
||||
public static final RegistryObject<SoundEvent> HUNTING_RIFLE_FIRE_1P = REGISTRY.register("hunting_rifle_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hunting_rifle_fire_1p")));
|
||||
public static final RegistryObject<SoundEvent> HUNTING_RIFLE_FIRE_3P = REGISTRY.register("hunting_rifle_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hunting_rifle_fire_3p")));
|
||||
public static final RegistryObject<SoundEvent> HUNTING_RIFLE_FAR = REGISTRY.register("hunting_rifle_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "hunting_rifle_far")));
|
||||
|
@ -77,7 +78,7 @@ public class TargetModSounds {
|
|||
public static final RegistryObject<SoundEvent> MORTAR_FIRE = REGISTRY.register("mortar_fire", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "mortar_fire")));
|
||||
public static final RegistryObject<SoundEvent> MORTAR_LOAD = REGISTRY.register("mortar_load", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "mortar_load")));
|
||||
public static final RegistryObject<SoundEvent> MORTAR_DISTANT = REGISTRY.register("mortar_distant", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "mortar_distant")));
|
||||
public static final RegistryObject<SoundEvent> FIRERATE = REGISTRY.register("firerate", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "firerate")));
|
||||
public static final RegistryObject<SoundEvent> FIRE_RATE = REGISTRY.register("firerate", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "firerate")));
|
||||
public static final RegistryObject<SoundEvent> M_4_FIRE_1P = REGISTRY.register("m_4_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_4_fire_1p")));
|
||||
public static final RegistryObject<SoundEvent> M_4_FIRE_3P = REGISTRY.register("m_4_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_4_fire_3p")));
|
||||
public static final RegistryObject<SoundEvent> M_4_FAR = REGISTRY.register("m_4_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_4_far")));
|
||||
|
@ -151,7 +152,7 @@ public class TargetModSounds {
|
|||
public static final RegistryObject<SoundEvent> M_60_VERYFAR = REGISTRY.register("m_60_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_60_veryfar")));
|
||||
public static final RegistryObject<SoundEvent> M_60_RELOAD_NORMAL = REGISTRY.register("m_60_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_60_reload_normal")));
|
||||
public static final RegistryObject<SoundEvent> M_60_RELOAD_EMPTY = REGISTRY.register("m_60_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_60_reload_empty")));
|
||||
public static final RegistryObject<SoundEvent> LIGHTSABER = REGISTRY.register("lightsaber", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "lightsaber")));
|
||||
public static final RegistryObject<SoundEvent> LIGHT_SABER = REGISTRY.register("lightsaber", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "lightsaber")));
|
||||
public static final RegistryObject<SoundEvent> SVD_FIRE_1P = REGISTRY.register("svd_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "svd_fire_1p")));
|
||||
public static final RegistryObject<SoundEvent> SVD_FIRE_3P = REGISTRY.register("svd_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "svd_fire_3p")));
|
||||
public static final RegistryObject<SoundEvent> SVD_FAR = REGISTRY.register("svd_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "svd_far")));
|
||||
|
@ -176,7 +177,7 @@ public class TargetModSounds {
|
|||
public static final RegistryObject<SoundEvent> M_870_FIRE_3P = REGISTRY.register("m_870_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_870_fire_3p")));
|
||||
public static final RegistryObject<SoundEvent> M_870_FAR = REGISTRY.register("m_870_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_870_far")));
|
||||
public static final RegistryObject<SoundEvent> M_870_VERYFAR = REGISTRY.register("m_870_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_870_veryfar")));
|
||||
public static final RegistryObject<SoundEvent> M_870_PREPAREALT = REGISTRY.register("m_870_preparealt", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_870_preparealt")));
|
||||
public static final RegistryObject<SoundEvent> M_870_RELOADLOOP = REGISTRY.register("m_870_reloadloop", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_870_reloadloop")));
|
||||
public static final RegistryObject<SoundEvent> BULLETSUPPLY = REGISTRY.register("bulletsupply", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bulletsupply")));
|
||||
public static final RegistryObject<SoundEvent> M_870_PREPARE_ALT = REGISTRY.register("m_870_preparealt", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_870_preparealt")));
|
||||
public static final RegistryObject<SoundEvent> M_870_RELOAD_LOOP = REGISTRY.register("m_870_reloadloop", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "m_870_reloadloop")));
|
||||
public static final RegistryObject<SoundEvent> BULLET_SUPPLY = REGISTRY.register("bulletsupply", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("target", "bulletsupply")));
|
||||
}
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
|
||||
/*
|
||||
* MCreator note: This file will be REGENERATED on each build.
|
||||
*/
|
||||
package net.mcreator.target.init;
|
||||
|
||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||
|
@ -18,76 +14,75 @@ public class TargetModTrades {
|
|||
public static void registerTrades(VillagerTradesEvent event) {
|
||||
if (event.getType() == VillagerProfession.WEAPONSMITH) {
|
||||
event.getTrades().get(1).add(new BasicItemListing(new ItemStack(TargetModItems.TASER_BLUEPRINT.get()),
|
||||
|
||||
new ItemStack(Items.EMERALD), 16, 5, 0.05f));
|
||||
|
||||
event.getTrades().get(2).add(new BasicItemListing(new ItemStack(Items.EMERALD, 10),
|
||||
|
||||
new ItemStack(TargetModItems.STEEL_ACTION.get()), 12, 5, 0.05f));
|
||||
event.getTrades().get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD, 32),
|
||||
|
||||
event.getTrades().get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD, 32),
|
||||
new ItemStack(TargetModItems.M_4_BLUEPRINT.get()), 10, 50, 0.05f));
|
||||
event.getTrades().get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD, 32),
|
||||
|
||||
event.getTrades().get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD, 32),
|
||||
new ItemStack(TargetModItems.M_79_BLUEPRINT.get()), 10, 50, 0.05f));
|
||||
event.getTrades().get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD, 32),
|
||||
|
||||
event.getTrades().get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD, 32),
|
||||
new ItemStack(TargetModItems.MARLIN_BLUEPRINT.get()), 10, 50, 0.05f));
|
||||
|
||||
event.getTrades().get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD, 32),
|
||||
|
||||
new ItemStack(TargetModItems.AK_47_BLUEPRINT.get()), 10, 50, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.HUNTING_RIFLE_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.RPG_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.HK_416_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.RPK_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.VECTOR_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.MK_14_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.M_60_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.SVD_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
new ItemStack(TargetModItems.M_870_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, 64),
|
||||
|
||||
new ItemStack(TargetModItems.M_98B_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
|
||||
event.getTrades().get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD),
|
||||
|
||||
new ItemStack(TargetModItems.DEVOTION_BLUEPRINT.get()), 10, 80, 0.05f));
|
||||
event.getTrades().get(2).add(new BasicItemListing(new ItemStack(Items.EMERALD, 8),
|
||||
|
||||
event.getTrades().get(2).add(new BasicItemListing(new ItemStack(Items.EMERALD, 8),
|
||||
new ItemStack(TargetModItems.STEEL_BARREL.get()), 12, 5, 0.05f));
|
||||
|
||||
event.getTrades().get(2).add(new BasicItemListing(new ItemStack(Items.EMERALD, 6),
|
||||
|
||||
new ItemStack(TargetModItems.STEEL_TRIGGER.get()), 12, 5, 0.05f));
|
||||
|
||||
event.getTrades().get(2).add(new BasicItemListing(new ItemStack(Items.EMERALD, 8),
|
||||
|
||||
new ItemStack(TargetModItems.STEEL_SPRING.get()), 12, 5, 0.05f));
|
||||
event.getTrades().get(3).add(new BasicItemListing(new ItemStack(Items.EMERALD, 16),
|
||||
|
||||
event.getTrades().get(3).add(new BasicItemListing(new ItemStack(Items.EMERALD, 16),
|
||||
new ItemStack(TargetModItems.CEMENTED_CARBIDE_BARREL.get()), 12, 10, 0.05f));
|
||||
|
||||
event.getTrades().get(3).add(new BasicItemListing(new ItemStack(Items.EMERALD, 20),
|
||||
|
||||
new ItemStack(TargetModItems.CEMENTED_CARBIDE_ACTION.get()), 10, 10, 0.05f));
|
||||
|
||||
event.getTrades().get(3).add(new BasicItemListing(new ItemStack(Items.EMERALD, 16),
|
||||
|
||||
new ItemStack(TargetModItems.CEMENTED_CARBIDE_SPRING.get()), 10, 10, 0.05f));
|
||||
event.getTrades().get(3).add(new BasicItemListing(new ItemStack(Items.EMERALD, 12),
|
||||
|
||||
event.getTrades().get(3).add(new BasicItemListing(new ItemStack(Items.EMERALD, 12),
|
||||
new ItemStack(TargetModItems.CEMENTED_CARBIDE_TRIGGER.get()), 10, 10, 0.05f));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public abstract class AmmoSupplierItem extends Item {
|
|||
|
||||
if (!level.isClientSide()) {
|
||||
player.displayClientMessage(Component.translatable("item.target.ammo_supplier.supply", Component.translatable(this.type.translatableKey).getString(), ammoToAdd), false);
|
||||
level.playSound(null, player.blockPosition(), TargetModSounds.BULLETSUPPLY.get(), SoundSource.PLAYERS, 1, 1);
|
||||
level.playSound(null, player.blockPosition(), TargetModSounds.BULLET_SUPPLY.get(), SoundSource.PLAYERS, 1, 1);
|
||||
}
|
||||
return InteractionResultHolder.consume(stack);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public class CreativeAmmoBox extends Item {
|
|||
|
||||
if (!level.isClientSide()) {
|
||||
player.displayClientMessage(Component.translatable("item.target.ammo_supplier.creative"), false);
|
||||
level.playSound(null, player.blockPosition(), TargetModSounds.BULLETSUPPLY.get(), SoundSource.VOICE, 1, 1);
|
||||
level.playSound(null, player.blockPosition(), TargetModSounds.BULLET_SUPPLY.get(), SoundSource.VOICE, 1, 1);
|
||||
}
|
||||
return InteractionResultHolder.consume(stack);
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ public class M870Item extends GunItem implements GeoItem, AnimatedItem {
|
|||
|
||||
@Override
|
||||
public Set<SoundEvent> getReloadSound() {
|
||||
return Set.of(TargetModSounds.M_870_PREPAREALT.get(), TargetModSounds.M_870_RELOADLOOP.get());
|
||||
return Set.of(TargetModSounds.M_870_PREPARE_ALT.get(), TargetModSounds.M_870_RELOAD_LOOP.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -18,11 +18,6 @@ public class ShockMobEffect extends MobEffect {
|
|||
super(MobEffectCategory.BENEFICIAL, -256);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescriptionId() {
|
||||
return "effect.target.shock";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAttributeModifiers(LivingEntity entity, AttributeMap attributeMap, int amplifier) {
|
||||
if (!entity.level().isClientSide()) {
|
||||
|
|
|
@ -51,9 +51,9 @@ public class DoubleJumpMessage {
|
|||
if ((entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new TargetModVariables.PlayerVariables())).playerDoubleJump) {
|
||||
entity.setDeltaMovement(new Vec3((1 * entity.getLookAngle().x), 0.8, (1 * entity.getLookAngle().z)));
|
||||
if (!level.isClientSide()) {
|
||||
level.playSound(null, BlockPos.containing(x, y, z), TargetModSounds.DOUBLEJUMP.get(), SoundSource.BLOCKS, 1, 1);
|
||||
level.playSound(null, BlockPos.containing(x, y, z), TargetModSounds.DOUBLE_JUMP.get(), SoundSource.BLOCKS, 1, 1);
|
||||
} else {
|
||||
level.playLocalSound(x, y, z, TargetModSounds.DOUBLEJUMP.get(), SoundSource.BLOCKS, 1, 1, false);
|
||||
level.playLocalSound(x, y, z, TargetModSounds.DOUBLE_JUMP.get(), SoundSource.BLOCKS, 1, 1, false);
|
||||
}
|
||||
entity.getCapability(TargetModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||
capability.playerDoubleJump = false;
|
||||
|
|
|
@ -58,7 +58,7 @@ public class FireModeMessage {
|
|||
};
|
||||
|
||||
if (player instanceof ServerPlayer serverPlayer) {
|
||||
serverPlayer.connection.send(new ClientboundSoundPacket(new Holder.Direct<>(TargetModSounds.FIRERATE.get()),
|
||||
serverPlayer.connection.send(new ClientboundSoundPacket(new Holder.Direct<>(TargetModSounds.FIRE_RATE.get()),
|
||||
SoundSource.PLAYERS, serverPlayer.getX(), serverPlayer.getY(), serverPlayer.getZ(), 1f, 1f, serverPlayer.level().random.nextLong()));
|
||||
}
|
||||
|
||||
|
|
|
@ -190,8 +190,8 @@
|
|||
|
||||
"key.categories.target": "TARGET",
|
||||
"key.target.reload": "Reload",
|
||||
"key.target.doublejumpinput": "Double Jump",
|
||||
"key.target.firemode": "Fire Mode",
|
||||
"key.target.double_jump": "Double Jump",
|
||||
"key.target.fire_mode": "Fire Mode",
|
||||
"key.target.zoom": "Zoom",
|
||||
|
||||
"effect.target.shock": "Shock",
|
||||
|
|
|
@ -190,8 +190,8 @@
|
|||
|
||||
"key.categories.target": "TARGET",
|
||||
"key.target.reload": "装填子弹",
|
||||
"key.target.doublejumpinput": "二段跳",
|
||||
"key.target.firemode": "开火模式",
|
||||
"key.target.double_jump": "二段跳",
|
||||
"key.target.fire_mode": "开火模式",
|
||||
"key.target.zoom": "缩放",
|
||||
|
||||
"effect.target.shock": "麻痹",
|
||||
|
|
Loading…
Add table
Reference in a new issue