添加GLOCK18

This commit is contained in:
Atsuihsio 2024-08-03 10:47:12 +08:00
parent 1e1ff3300e
commit 0837dbdb48
31 changed files with 3284 additions and 15 deletions

View file

@ -0,0 +1,27 @@
package net.mcreator.superbwarfare.client.layer;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.mcreator.superbwarfare.ModUtils;
import net.mcreator.superbwarfare.item.gun.Glock18Item;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
public class Glock18Layer extends GeoRenderLayer<Glock18Item> {
private static final ResourceLocation LAYER = new ResourceLocation(ModUtils.MODID, "textures/item/glock17_e.png");
public Glock18Layer(GeoRenderer<Glock18Item> entityRenderer) {
super(entityRenderer);
}
@Override
public void render(PoseStack poseStack, Glock18Item animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
RenderType glowRenderType = RenderType.eyes(LAYER);
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1);
}
}

View file

@ -60,14 +60,16 @@ public class Glock17ItemModel extends GeoModel<Glock17Item> {
if ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).zooming) {
shen.setPosY(0.05f * (float) (fp + 2 * fr));
shen.setPosZ(-0.05f * (float) (fp + 0.54f * fr));
shen.setRotX(0.01f * (float) (fp + fr));
shen.setRotY(0.05f * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
shen.setRotX(-0.05f * (float) (fp + fr));
} else {
shen.setPosY(0.08f * (float) (fp + 2 * fr));
shen.setPosZ(0.9f * (float) (fp + 0.54f * fr));
shen.setRotX(0.27f * (float) (0.18f * fp + fr));
shen.setRotY(0.1f * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
}
shen.setPosX(0.5f * (float) fr * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
shen.setPosX(0.7f * (float) fr * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
slide.setPosZ(1.5f * (float) fp);

View file

@ -0,0 +1,152 @@
package net.mcreator.superbwarfare.client.model.item;
import net.mcreator.superbwarfare.ModUtils;
import net.mcreator.superbwarfare.init.ModTags;
import net.mcreator.superbwarfare.item.gun.Glock18Item;
import net.mcreator.superbwarfare.network.ModVariables;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.model.GeoModel;
public class Glock18ItemModel extends GeoModel<Glock18Item> {
@Override
public ResourceLocation getAnimationResource(Glock18Item animatable) {
return new ResourceLocation(ModUtils.MODID, "animations/glock17.animation.json");
}
@Override
public ResourceLocation getModelResource(Glock18Item animatable) {
return new ResourceLocation(ModUtils.MODID, "geo/glock18.geo.json");
}
@Override
public ResourceLocation getTextureResource(Glock18Item animatable) {
return new ResourceLocation(ModUtils.MODID, "textures/item/glock17.png");
}
@Override
public void setCustomAnimations(Glock18Item animatable, long instanceId, AnimationState animationState) {
CoreGeoBone gun = getAnimationProcessor().getBone("bone");
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
CoreGeoBone slide = getAnimationProcessor().getBone("huatao");
CoreGeoBone bullet = getAnimationProcessor().getBone("bullet");
CoreGeoBone switch_ = getAnimationProcessor().getBone("kuaimanji");
Player player = Minecraft.getInstance().player;
if (player == null) return;
ItemStack stack = player.getMainHandItem();
if (!stack.is(ModTags.Items.GUN)) return;
if (stack.getOrCreateTag().getInt("fire_mode") == 0) {
switch_.setRotX(35 * Mth.DEG_TO_RAD);
}
if (stack.getOrCreateTag().getInt("fire_mode") == 2) {
switch_.setRotX(0);
}
double p = player.getPersistentData().getDouble("zoom_pos");
double zp = player.getPersistentData().getDouble("zoom_pos_z");
gun.setPosX(-1.34f * (float) p);
gun.setPosY(5.05f * (float) p - (float) (0.2f * zp));
gun.setPosZ(5f * (float) p + (float) (0.3f * zp));
gun.setScaleZ(1f - (0.5f * (float) p));
gun.setRotZ(-11 * Mth.DEG_TO_RAD * (float) p + (float) (0.05f * zp));
double fp = player.getPersistentData().getDouble("fire_pos");
double fr = player.getPersistentData().getDouble("fire_rot");
if ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).zooming) {
shen.setPosY(0.05f * (float) (fp + 2 * fr));
shen.setPosZ(-0.05f * (float) (fp + 0.54f * fr));
shen.setRotY(0.05f * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
shen.setRotX(-0.05f * (float) (fp + fr));
} else {
shen.setPosY(0.08f * (float) (fp + 2 * fr));
shen.setPosZ(0.9f * (float) (fp + 0.54f * fr));
shen.setRotX(0.27f * (float) (0.18f * fp + fr));
shen.setRotY(0.1f * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
shen.setRotZ(-0.01f * (float) (fp + 1.3 * fr));
}
shen.setPosX(0.7f * (float) fr * (float) ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).recoilHorizon * fp));
slide.setPosZ(1.5f * (float) fp);
if (stack.getOrCreateTag().getBoolean("HoldOpen")) {
slide.setPosZ(1.5f);
bullet.setHidden(true);
} else {
bullet.setHidden(false);
}
CoreGeoBone root = getAnimationProcessor().getBone("root");
float PosX = (float) player.getPersistentData().getDouble("gun_move_posX");
float PosY = (float) player.getPersistentData().getDouble("gun_move_posY");
double y = player.getPersistentData().getDouble("y");
double x = player.getPersistentData().getDouble("x");
CoreGeoBone flare = getAnimationProcessor().getBone("flare");
if (stack.getOrCreateTag().getDouble("flash_time") > 0) {
flare.setHidden(false);
flare.setScaleX((float) (0.55 + 0.5 * (Math.random() - 0.5)));
flare.setScaleY((float) (0.55 + 0.5 * (Math.random() - 0.5)));
flare.setRotZ((float) (0.5 * (Math.random() - 0.5)));
} else {
flare.setHidden(true);
}
root.setPosX(PosX);
root.setPosY((float) y + PosY);
root.setRotX((float) x);
float RotZ = (float) player.getPersistentData().getDouble("gun_move_rotZ");
root.setRotY(0.2f * PosX);
root.setRotZ(0.2f * PosX + RotZ);
CoreGeoBone move = getAnimationProcessor().getBone("move");
double m = player.getPersistentData().getDouble("move");
double vy = player.getPersistentData().getDouble("vy");
move.setPosX(9.3f * (float) m);
move.setPosY(-2f * (float) vy);
double xRot = player.getPersistentData().getDouble("xRot");
double yRot = player.getPersistentData().getDouble("yRot");
double zRot = player.getPersistentData().getDouble("zRot");
move.setRotX(0.7f * Mth.DEG_TO_RAD * (float) xRot - 0.15f * (float) vy);
move.setRotY(0.7f * Mth.DEG_TO_RAD * (float) yRot);
move.setRotZ(2.7f * (float) m + Mth.DEG_TO_RAD * (float) zRot);
CoreGeoBone camera = getAnimationProcessor().getBone("camera");
player.getPersistentData().putDouble("camera_rot_x", Mth.RAD_TO_DEG * camera.getRotX());
player.getPersistentData().putDouble("camera_rot_y", Mth.RAD_TO_DEG * camera.getRotY());
player.getPersistentData().putDouble("camera_rot_z", Mth.RAD_TO_DEG * camera.getRotZ());
}
}

View file

@ -0,0 +1,19 @@
package net.mcreator.superbwarfare.client.renderer.item;
import net.mcreator.superbwarfare.client.layer.Glock18Layer;
import net.mcreator.superbwarfare.client.model.item.Glock18ItemModel;
import net.mcreator.superbwarfare.item.gun.Glock18Item;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.renderer.GeoItemRenderer;
public class Glock18ItemRenderer extends GeoItemRenderer<Glock18Item> {
public Glock18ItemRenderer() {
super(new Glock18ItemModel());
this.addRenderLayer(new Glock18Layer(this));
}
@Override
public ResourceLocation getTextureLocation(Glock18Item instance) {
return super.getTextureLocation(instance);
}
}

View file

@ -20,7 +20,9 @@ public class ProjectileEntityModel extends GeoModel<ProjectileEntity> {
@Override
public ResourceLocation getModelResource(ProjectileEntity entity) {
Player player = Minecraft.getInstance().player;
if ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).zooming || player.getMainHandItem().is(ModItems.GLOCK_17.get())) {
if ((player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables())).zooming
|| player.getMainHandItem().is(ModItems.GLOCK_17.get())
|| player.getMainHandItem().is(ModItems.GLOCK_18.get())) {
return new ResourceLocation(ModUtils.MODID, "geo/projectile_entity.geo.json");
} else {
return new ResourceLocation(ModUtils.MODID, "geo/projectile_entity2.geo.json");

View file

@ -426,7 +426,7 @@ public class GunEventHandler {
}
}
if (stack.getItem() == ModItems.GLOCK_17.get()) {
if (stack.getItem() == ModItems.GLOCK_17.get() || stack.getItem() == ModItems.GLOCK_18.get()) {
if (tag.getInt("gun_reloading_time") == 5) {
tag.putBoolean("HoldOpen", false);
}

View file

@ -455,6 +455,12 @@ public class PlayerEventHandler {
double sinRes = 0;
if (0 < recoil && recoil < 0.5) {
float newPitch = player.getXRot() - 0.05f * ry;
player.setXRot(newPitch);
player.xRotO = player.getXRot();
}
if (0 < recoil && recoil < 2) {
recoil = recoil + 0.025;
sinRes = Math.sin(Math.PI * recoil);
@ -466,11 +472,11 @@ public class PlayerEventHandler {
}
if (0 < recoil && recoil < 2.5) {
float newPitch = ((float) (player.getXRot() - 6f * recoilY * ry * (sinRes + Mth.clamp(0.8 - recoil, 0, 0.8))));
float newPitch = (float) (player.getXRot() - 6f * recoilY * ry * (sinRes + Mth.clamp(0.8 - recoil, 0, 0.8)));
player.setXRot(newPitch);
player.xRotO = player.getXRot();
float newYaw = ((float) (player.getYRot() - 4f * recoilYaw * recoilX * rx * sinRes));
float newYaw = (float) (player.getYRot() - 4f * recoilYaw * recoilX * rx * sinRes);
player.setYRot(newYaw);
player.yRotO = player.getYRot();
}

View file

@ -27,6 +27,7 @@ public class ModItems {
public static final RegistryObject<Item> TASER = GUNS.register("taser", Taser::new);
public static final RegistryObject<Item> GLOCK_17 = GUNS.register("glock_17", Glock17Item::new);
public static final RegistryObject<Item> GLOCK_18 = GUNS.register("glock_18", Glock18Item::new);
public static final RegistryObject<Item> ABEKIRI = GUNS.register("abekiri", Abekiri::new);
public static final RegistryObject<Item> TRACHELIUM = GUNS.register("trachelium", Trachelium::new);
public static final RegistryObject<Item> VECTOR = GUNS.register("vector", VectorItem::new);
@ -149,6 +150,7 @@ public class ModItems {
public static final RegistryObject<Item> TRACHELIUM_BLUEPRINT = ITEMS.register("trachelium_blueprint", () -> new BlueprintItem(RarityTool.LEGENDARY));
public static final RegistryObject<Item> GLOCK_17_BLUEPRINT = ITEMS.register("glock_17_blueprint", () -> new BlueprintItem(Rarity.COMMON));
public static final RegistryObject<Item> GLOCK_18_BLUEPRINT = ITEMS.register("glock_18_blueprint", () -> new BlueprintItem(Rarity.COMMON));
public static final RegistryObject<Item> HUNTING_RIFLE_BLUEPRINT = ITEMS.register("hunting_rifle_blueprint", () -> new BlueprintItem(Rarity.EPIC));
public static final RegistryObject<Item> M_79_BLUEPRINT = ITEMS.register("m_79_blueprint", () -> new BlueprintItem(Rarity.RARE));
public static final RegistryObject<Item> RPG_BLUEPRINT = ITEMS.register("rpg_blueprint", () -> new BlueprintItem(Rarity.EPIC));

View file

@ -188,6 +188,13 @@ public class ModSounds {
public static final RegistryObject<SoundEvent> GLOCK_17_RELOAD_NORMAL = REGISTRY.register("glock_17_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_17_reload_normal")));
public static final RegistryObject<SoundEvent> GLOCK_17_RELOAD_EMPTY = REGISTRY.register("glock_17_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_17_reload_empty")));
public static final RegistryObject<SoundEvent> GLOCK_18_FIRE_1P = REGISTRY.register("glock_18_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_18_fire_1p")));
public static final RegistryObject<SoundEvent> GLOCK_18_FIRE_3P = REGISTRY.register("glock_18_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_18_fire_3p")));
public static final RegistryObject<SoundEvent> GLOCK_18_FAR = REGISTRY.register("glock_18_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_18_far")));
public static final RegistryObject<SoundEvent> GLOCK_18_VERYFAR = REGISTRY.register("glock_18_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_18_veryfar")));
public static final RegistryObject<SoundEvent> GLOCK_18_RELOAD_NORMAL = REGISTRY.register("glock_18_reload_normal", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_18_reload_normal")));
public static final RegistryObject<SoundEvent> GLOCK_18_RELOAD_EMPTY = REGISTRY.register("glock_18_reload_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "glock_18_reload_empty")));
public static final RegistryObject<SoundEvent> MK_42_FIRE_1P = REGISTRY.register("mk_42_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "mk_42_fire_1p")));
public static final RegistryObject<SoundEvent> MK_42_FIRE_3P = REGISTRY.register("mk_42_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "mk_42_fire_3p")));
public static final RegistryObject<SoundEvent> MK_42_FAR = REGISTRY.register("mk_42_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation("superbwarfare", "mk_42_far")));

View file

@ -25,6 +25,7 @@ public class ModTabs {
(param, output) -> {
output.accept(Taser.getGunInstance());
output.accept(Glock17Item.getGunInstance());
output.accept(Glock18Item.getGunInstance());
output.accept(Abekiri.getGunInstance());
output.accept(Trachelium.getGunInstance());
output.accept(VectorItem.getGunInstance());

View file

@ -0,0 +1,196 @@
package net.mcreator.superbwarfare.item.gun;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.mcreator.superbwarfare.ModUtils;
import net.mcreator.superbwarfare.client.renderer.item.Glock18ItemRenderer;
import net.mcreator.superbwarfare.init.ModItems;
import net.mcreator.superbwarfare.init.ModSounds;
import net.mcreator.superbwarfare.init.ModTags;
import net.mcreator.superbwarfare.item.AnimatedItem;
import net.mcreator.superbwarfare.tools.GunsTool;
import net.mcreator.superbwarfare.tools.TooltipTool;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.HumanoidModel;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.renderer.BlockEntityWithoutLevelRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import net.minecraftforge.client.extensions.common.IClientItemExtensions;
import software.bernie.geckolib.animatable.GeoItem;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
import software.bernie.geckolib.core.animation.AnimatableManager;
import software.bernie.geckolib.core.animation.AnimationController;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.core.animation.RawAnimation;
import software.bernie.geckolib.core.object.PlayState;
import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.function.Consumer;
public class Glock18Item extends GunItem implements GeoItem, AnimatedItem {
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public String animationProcedure = "empty";
public static ItemDisplayContext transformType;
public Glock18Item() {
super(new Properties().stacksTo(1).rarity(Rarity.COMMON));
}
@Override
public void initializeClient(Consumer<IClientItemExtensions> consumer) {
super.initializeClient(consumer);
consumer.accept(new IClientItemExtensions() {
private final BlockEntityWithoutLevelRenderer renderer = new Glock18ItemRenderer();
@Override
public BlockEntityWithoutLevelRenderer getCustomRenderer() {
return renderer;
}
@Override
public HumanoidModel.ArmPose getArmPose(LivingEntity entityLiving, InteractionHand hand, ItemStack itemStack) {
return HumanoidModel.ArmPose.BOW_AND_ARROW;
}
});
}
public void getTransformType(ItemDisplayContext type) {
transformType = type;
}
private PlayState fireAnimPredicate(AnimationState event) {
LocalPlayer player = Minecraft.getInstance().player;
if (player == null) return PlayState.STOP;
ItemStack stack = player.getMainHandItem();
if (!stack.is(ModTags.Items.GUN)) return PlayState.STOP;
if (this.animationProcedure.equals("empty")) {
if (stack.getOrCreateTag().getInt("fire_animation") > 0) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.glock.fire"));
}
if (stack.getOrCreateTag().getBoolean("is_empty_reloading")) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.glock.reload_empty"));
}
if (stack.getOrCreateTag().getBoolean("is_normal_reloading")) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.glock.reload_normal"));
}
if (stack.getOrCreateTag().getInt("fire_mode") == 0 && stack.getOrCreateTag().getDouble("cg") > 0) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.glock.change_fire_rate"));
}
if (stack.getOrCreateTag().getInt("fire_mode") == 2 && stack.getOrCreateTag().getDouble("cg") > 0) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.glock.change_fire_rate2"));
}
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.glock.idle"));
}
return PlayState.STOP;
}
private PlayState idlePredicate(AnimationState<Glock18Item> event) {
LocalPlayer player = Minecraft.getInstance().player;
if (player == null) return PlayState.STOP;
ItemStack stack = player.getMainHandItem();
if (!stack.is(ModTags.Items.GUN)) return PlayState.STOP;
if (this.animationProcedure.equals("empty")) {
if (stack.getOrCreateTag().getInt("draw_time") < 10) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.glock.draw"));
}
if (player.isSprinting() && player.onGround()
&& player.getPersistentData().getDouble("noRun") == 0
&& !(stack.getOrCreateTag().getBoolean("is_normal_reloading") || stack.getOrCreateTag().getBoolean("is_empty_reloading"))) {
if (player.hasEffect(MobEffects.MOVEMENT_SPEED)) {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.glock.run_fast"));
} else {
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.glock.run"));
}
}
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.glock.idle"));
}
return PlayState.STOP;
}
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
var fireAnimController = new AnimationController<>(this, "fireAnimController", 1, this::fireAnimPredicate);
data.add(fireAnimController);
var idleController = new AnimationController<>(this, "idleController", 4, this::idlePredicate);
data.add(idleController);
}
@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
return this.cache;
}
@Override
public void appendHoverText(ItemStack stack, Level world, List<Component> list, TooltipFlag flag) {
TooltipTool.addGunTips(list, stack);
}
@Override
public Multimap<Attribute, AttributeModifier> getAttributeModifiers(EquipmentSlot slot, ItemStack stack) {
Multimap<Attribute, AttributeModifier> map = super.getAttributeModifiers(slot, stack);
UUID uuid = new UUID(slot.toString().hashCode(), 0);
if (slot == EquipmentSlot.MAINHAND) {
map = HashMultimap.create(map);
map.put(Attributes.MOVEMENT_SPEED,
new AttributeModifier(uuid, ModUtils.ATTRIBUTE_MODIFIER, -0.01f, AttributeModifier.Operation.MULTIPLY_BASE));
}
return map;
}
@Override
public Set<SoundEvent> getReloadSound() {
return Set.of(
ModSounds.GLOCK_18_RELOAD_EMPTY.get(),
ModSounds.GLOCK_18_RELOAD_NORMAL.get()
);
}
public static ItemStack getGunInstance() {
ItemStack stack = new ItemStack(ModItems.GLOCK_18.get());
GunsTool.initCreativeGun(stack, ModItems.GLOCK_18.getId().getPath());
return stack;
}
@Override
public void setAnimationProcedure(String procedure) {
this.animationProcedure = procedure;
}
@Override
public ResourceLocation getGunIcon() {
return new ResourceLocation(ModUtils.MODID, "textures/gun_icon/glock_icon.png");
}
@Override
public String getGunDisplayName() {
return " GLOCK-18";
}
}

View file

@ -1229,6 +1229,204 @@
}
}
}
},
"animation.glock.change_fire_rate": {
"animation_length": 0.5,
"override_previous_animation": true,
"bones": {
"0": {
"rotation": {
"0.0": {
"vector": [0, 0, 0]
},
"0.1667": {
"vector": [-0.98905, -0.20901, -1.99637],
"easing": "easeInSine"
},
"0.25": {
"vector": [0, -3, -8],
"easing": "easeOutQuad"
},
"0.375": {
"vector": [0.05236, 1.49909, -1.99931]
},
"0.5": {
"vector": [0, 0, 0],
"easing": "easeInOutSine"
}
},
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.1667": {
"vector": [0, 0.00828, 0],
"easing": "easeInSine"
},
"0.25": {
"vector": [0, 0.1, 0],
"easing": "easeOutQuad"
},
"0.3333": {
"vector": [0, -0.095, 0]
},
"0.5": {
"vector": [0, 0, 0],
"easing": "easeInOutSine"
}
}
},
"lun": {
"rotation": {
"0.0": {
"vector": [0, 0, 0]
},
"0.0417": {
"vector": [0, 0, -22.5]
}
},
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.0417": {
"vector": [0, 0, 0]
}
}
},
"Righthand": {
"rotation": {
"0.0": {
"vector": [0, 0, 0]
},
"0.1667": {
"vector": [0, 0, -2.5]
},
"0.25": {
"vector": [0.5682, -1.92615, -5.92244]
},
"0.4167": {
"vector": [0.97066, -0.69928, -1.25596]
},
"0.5": {
"vector": [0, 0, 0]
}
},
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.1667": {
"vector": [0.19922, 0, 0]
},
"0.25": {
"vector": [0.2, 0.27734, 0]
},
"0.5": {
"vector": [0, 0, 0]
}
}
}
}
},
"animation.glock.change_fire_rate2": {
"animation_length": 0.5,
"override_previous_animation": true,
"bones": {
"0": {
"rotation": {
"0.0": {
"vector": [0, 0, 0],
"easing": "easeInOutSine"
},
"0.125": {
"vector": [-0.39193, -2.97431, -0.48982],
"easing": "easeOutQuad"
},
"0.25": {
"vector": [0.24763, 1.47942, 5.5032]
},
"0.3333": {
"vector": [-1.00787, -0.07813, 5.50251],
"easing": "easeInSine"
},
"0.5": {
"vector": [0, 0, 0]
}
},
"position": {
"0.0": {
"vector": [0, 0, 0],
"easing": "easeInOutSine"
},
"0.125": {
"vector": [0, 0.1, 0],
"easing": "easeOutQuad"
},
"0.25": {
"vector": [0, -0.095, 0]
},
"0.375": {
"vector": [0, 0.00828, 0],
"easing": "easeInSine"
},
"0.5": {
"vector": [0, 0, 0]
}
}
},
"lun": {
"rotation": {
"0.0": {
"vector": [0, 0, 0]
},
"0.0417": {
"vector": [0, 0, -22.5]
}
},
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.0417": {
"vector": [0, 0, 0]
}
}
},
"Righthand": {
"rotation": {
"0.0": {
"vector": [0, 0, 0]
},
"0.125": {
"vector": [0.85744, -2.29899, -7.40388]
},
"0.2083": {
"vector": [0, 0, -2.5]
},
"0.3333": {
"vector": [0.97066, -0.69928, -1.25596]
},
"0.5": {
"vector": [0, 0, 0]
}
},
"position": {
"0.0": {
"vector": [0, 0, 0]
},
"0.125": {
"vector": [0.2, 0.27734, 0]
},
"0.2083": {
"vector": [0.19922, 0, 0]
},
"0.5": {
"vector": [0, 0, 0]
}
}
}
}
}
},
"geckolib_format_version": 2

File diff suppressed because it is too large Load diff

View file

@ -37,6 +37,7 @@
"item.superbwarfare.svd": "SVD",
"item.superbwarfare.ntw_20": "NTW-20",
"item.superbwarfare.glock_17": "GLOCK-17",
"item.superbwarfare.glock_18": "GLOCK-18",
"des.superbwarfare.tips.damage": "Damage: ",
"des.superbwarfare.tips.level": "Level: ",
@ -65,6 +66,7 @@
"item.superbwarfare.devotion_blueprint": "DEVOTION Blueprint",
"item.superbwarfare.taser_blueprint": "TASER Blueprint",
"item.superbwarfare.glock_17_blueprint": "GLOCK-17 Blueprint",
"item.superbwarfare.glock_18_blueprint": "GLOCK-18 Blueprint",
"item.superbwarfare.common_material_pack": "Common Material Pack",
"item.superbwarfare.rare_material_pack": "Rare Material Pack",

View file

@ -37,6 +37,7 @@
"item.superbwarfare.svd": "SVD狙击步枪",
"item.superbwarfare.ntw_20": "NTW-20反器材狙击步枪",
"item.superbwarfare.glock_17": "格洛克17手枪",
"item.superbwarfare.glock_18": "格洛克18手枪",
"des.superbwarfare.tips.damage": "伤害: ",
"des.superbwarfare.tips.level": "等级: ",
@ -65,6 +66,7 @@
"item.superbwarfare.devotion_blueprint": "专注轻机枪蓝图",
"item.superbwarfare.taser_blueprint": "泰瑟枪蓝图",
"item.superbwarfare.glock_17_blueprint": "格洛克17手枪蓝图",
"item.superbwarfare.glock_18_blueprint": "格洛克18手枪蓝图",
"item.superbwarfare.common_material_pack": "普通材料包",
"item.superbwarfare.rare_material_pack": "稀有材料包",

View file

@ -0,0 +1,27 @@
{
"loader": "forge:separate_transforms",
"gui_light": "front",
"base": {
"parent": "superbwarfare:item/glock_17_base"
},
"perspectives": {
"gui": {
"parent": "superbwarfare:item/glock17_icon"
},
"thirdperson_righthand": {
"parent": "superbwarfare:item/glock17_3d"
},
"thirdperson_lefthand": {
"parent": "superbwarfare:item/glock17_3d"
},
"ground": {
"parent": "superbwarfare:item/glock17_3d"
},
"fixed": {
"parent": "superbwarfare:item/glock17_3d"
},
"head": {
"parent": "superbwarfare:item/glock17_3d"
}
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "superbwarfare:item/gun_blueprint"
}
}

View file

@ -1215,6 +1215,54 @@
}
]
},
"glock_18_fire_1p": {
"sounds": [
{
"name": "superbwarfare:glock_17/glock_fire_1p",
"stream": false
}
]
},
"glock_18_fire_3p": {
"sounds": [
{
"name": "superbwarfare:glock_17/glock_fire_3p",
"stream": false
}
]
},
"glock_18_far": {
"sounds": [
{
"name": "superbwarfare:glock_17/glock_far",
"stream": false
}
]
},
"glock_18_veryfar": {
"sounds": [
{
"name": "superbwarfare:glock_17/glock_veryfar",
"stream": false
}
]
},
"glock_18_reload_normal": {
"sounds": [
{
"name": "superbwarfare:glock_17/glock_reload_normal",
"stream": false
}
]
},
"glock_18_reload_empty": {
"sounds": [
{
"name": "superbwarfare:glock_17/glock_reload_empty",
"stream": false
}
]
},
"lightsaber": {
"sounds": [
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -2,8 +2,8 @@
"zoom_speed": 1.9,
"zoom": 1.25,
"dev": 2.5,
"recoil_x": 0.003,
"recoil_y": 0.013,
"recoil_x": 0.007,
"recoil_y": 0.023,
"damage": 5.5,
"headshot": 1.5,
"velocity": 16,

View file

@ -0,0 +1,21 @@
{
"zoom_speed": 1.9,
"zoom": 1.25,
"dev": 2.5,
"recoil_x": 0.007,
"recoil_y": 0.023,
"damage": 5.5,
"headshot": 1.5,
"velocity": 16,
"mag": 17,
"projectile_amount": 1,
"fire_interval": 1,
"weight": 0,
"fire_mode": 2,
"semi": 1,
"burst": 0,
"auto": 1,
"burst_size": 1,
"normal_reload_time": 30,
"empty_reload_time": 35
}

View file

@ -7,7 +7,7 @@
{
"type": "minecraft:item",
"name": "superbwarfare:taser_blueprint",
"weight": 50,
"weight": 40,
"functions": [
{
"function": "set_count",
@ -32,6 +32,20 @@
}
]
},
{
"type": "minecraft:item",
"name": "superbwarfare:glock_18_blueprint",
"weight": 39,
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
},
{
"type": "minecraft:item",
"name": "superbwarfare:m_79_blueprint",

View file

@ -18,6 +18,20 @@
}
]
},
{
"type": "minecraft:item",
"name": "superbwarfare:glock_18_blueprint",
"weight": 10,
"functions": [
{
"function": "set_count",
"count": {
"min": 1,
"max": 1
}
}
]
},
{
"type": "minecraft:item",
"name": "superbwarfare:m_79_blueprint",

View file

@ -0,0 +1,24 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"pattern": [
"aba",
"aca",
"aaa"
],
"key": {
"a": {
"item": "minecraft:diamond"
},
"b": {
"item": "superbwarfare:glock_18_blueprint"
},
"c": {
"item": "minecraft:lapis_lazuli"
}
},
"result": {
"item": "superbwarfare:glock_18_blueprint",
"count": 2
}
}

View file

@ -0,0 +1,15 @@
{
"type": "minecraft:smithing_transform",
"template": {
"item": "superbwarfare:glock_18_blueprint"
},
"base": {
"item": "superbwarfare:common_material_pack"
},
"addition": {
"item": "minecraft:gold_ingot"
},
"result": {
"item": "superbwarfare:glock_18"
}
}

View file

@ -22,6 +22,7 @@
"superbwarfare:m_98b",
"superbwarfare:ak_47",
"superbwarfare:rpg",
"superbwarfare:glock_17"
"superbwarfare:glock_17",
"superbwarfare:glock_18"
]
}

View file

@ -21,6 +21,7 @@
"superbwarfare:m_870",
"superbwarfare:m_98b",
"superbwarfare:ak_47",
"superbwarfare:glock_17"
"superbwarfare:glock_17",
"superbwarfare:glock_18"
]
}

View file

@ -25,6 +25,7 @@
"superbwarfare:m_98b",
"superbwarfare:ak_47",
"superbwarfare:rpg",
"superbwarfare:glock_17"
"superbwarfare:glock_17",
"superbwarfare:glock_18"
]
}

View file

@ -2,6 +2,7 @@
"replace": false,
"values": [
"superbwarfare:trachelium",
"superbwarfare:glock_17"
"superbwarfare:glock_17",
"superbwarfare:glock_18"
]
}

View file

@ -20,6 +20,7 @@
"superbwarfare:sentinel",
"superbwarfare:m_870",
"superbwarfare:marlin",
"superbwarfare:glock_17"
"superbwarfare:glock_17",
"superbwarfare:glock_18"
]
}

View file

@ -16,6 +16,7 @@
"superbwarfare:ntw_20",
"superbwarfare:m_98b",
"superbwarfare:sentinel",
"superbwarfare:glock_17"
"superbwarfare:glock_17",
"superbwarfare:glock_18"
]
}