添加莫辛纳甘
This commit is contained in:
parent
c4b71c2117
commit
498f7fd871
41 changed files with 8434 additions and 20 deletions
|
@ -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.MosinNagantItem;
|
||||||
|
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 MosinNagantLayer extends GeoRenderLayer<MosinNagantItem> {
|
||||||
|
private static final ResourceLocation LAYER = new ResourceLocation(ModUtils.MODID, "textures/item/mosin_nagant_e.png");
|
||||||
|
|
||||||
|
public MosinNagantLayer(GeoRenderer<MosinNagantItem> entityRenderer) {
|
||||||
|
super(entityRenderer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(PoseStack poseStack, MosinNagantItem 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,159 @@
|
||||||
|
package net.mcreator.superbwarfare.client.model.item;
|
||||||
|
|
||||||
|
import net.mcreator.superbwarfare.ModUtils;
|
||||||
|
import net.mcreator.superbwarfare.init.ModTags;
|
||||||
|
import net.mcreator.superbwarfare.item.gun.MosinNagantItem;
|
||||||
|
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 MosinNagantItemModel extends GeoModel<MosinNagantItem> {
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getAnimationResource(MosinNagantItem animatable) {
|
||||||
|
return new ResourceLocation(ModUtils.MODID, "animations/mosin_nagant.animation.json");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getModelResource(MosinNagantItem animatable) {
|
||||||
|
return new ResourceLocation(ModUtils.MODID, "geo/mosin_nagant.geo.json");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getTextureResource(MosinNagantItem animatable) {
|
||||||
|
return new ResourceLocation(ModUtils.MODID, "textures/item/mosin_nagant.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setCustomAnimations(MosinNagantItem animatable, long instanceId, AnimationState animationState) {
|
||||||
|
CoreGeoBone gun = getAnimationProcessor().getBone("bone");
|
||||||
|
CoreGeoBone shen = getAnimationProcessor().getBone("shen");
|
||||||
|
CoreGeoBone pu = getAnimationProcessor().getBone("pu");
|
||||||
|
CoreGeoBone bone15 = getAnimationProcessor().getBone("bone15");
|
||||||
|
CoreGeoBone bone16 = getAnimationProcessor().getBone("bone16");
|
||||||
|
CoreGeoBone qiangshen = getAnimationProcessor().getBone("qiangshen");
|
||||||
|
|
||||||
|
Player player = Minecraft.getInstance().player;
|
||||||
|
if (player == null) return;
|
||||||
|
ItemStack stack = player.getMainHandItem();
|
||||||
|
if (!stack.is(ModTags.Items.GUN)) return;
|
||||||
|
|
||||||
|
|
||||||
|
double p = player.getPersistentData().getDouble("zoom_pos");
|
||||||
|
double zp = player.getPersistentData().getDouble("zoom_pos_z");
|
||||||
|
|
||||||
|
gun.setPosX(2.105f * (float) p);
|
||||||
|
gun.setPosY(0.766f * (float) p - (float) (0.2f * zp));
|
||||||
|
gun.setPosZ(12.95f * (float) p + (float) (0.3f * zp));
|
||||||
|
gun.setScaleZ(1f - (0.9f * (float) p));
|
||||||
|
|
||||||
|
pu.setScaleZ(1f - (0.5f * (float) p));
|
||||||
|
bone16.setScaleZ(1f - (0.93f * (float) p));
|
||||||
|
bone15.setScaleX(1f - (0.2f * (float) p));
|
||||||
|
|
||||||
|
if (gun.getPosX() > 1.4) {
|
||||||
|
qiangshen.setScaleX(0);
|
||||||
|
qiangshen.setScaleY(0);
|
||||||
|
qiangshen.setScaleZ(0);
|
||||||
|
} else {
|
||||||
|
qiangshen.setScaleX(1);
|
||||||
|
qiangshen.setScaleY(1);
|
||||||
|
qiangshen.setScaleZ(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.getOrCreateTag().putBoolean("HoloHidden", !(gun.getPosX() > 1.4));
|
||||||
|
|
||||||
|
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.07f * (float) (fp + 2 * fr));
|
||||||
|
shen.setPosZ(10.6f * (float) (fp + 0.54f * fr));
|
||||||
|
shen.setRotX(0.02f * (float) (fp + fr));
|
||||||
|
shen.setRotZ(0f);
|
||||||
|
} else {
|
||||||
|
shen.setPosY(0.28f * (float) (fp + 2 * fr));
|
||||||
|
shen.setPosZ(3.8f * (float) (fp + 0.54f * fr));
|
||||||
|
shen.setRotX(0.17f * (float) (0.18f * fp + fr));
|
||||||
|
shen.setRotZ(-0.04f * (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));
|
||||||
|
|
||||||
|
|
||||||
|
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");
|
||||||
|
|
||||||
|
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.75f * Mth.DEG_TO_RAD * (float) xRot - 0.15f * (float) vy);
|
||||||
|
|
||||||
|
move.setRotY(0.75f * Mth.DEG_TO_RAD * (float) yRot);
|
||||||
|
|
||||||
|
move.setRotZ(2.7f * (float) m + Mth.DEG_TO_RAD * (float) zRot);
|
||||||
|
|
||||||
|
CoreGeoBone camera = getAnimationProcessor().getBone("camera");
|
||||||
|
CoreGeoBone main = getAnimationProcessor().getBone("0");
|
||||||
|
CoreGeoBone body = getAnimationProcessor().getBone("roll");
|
||||||
|
var data = player.getPersistentData();
|
||||||
|
float numR = (float) (1 - 0.95 * data.getDouble("zoom_time"));
|
||||||
|
float numP = (float) (1 - 0.81 * data.getDouble("zoom_time"));
|
||||||
|
|
||||||
|
if (stack.getOrCreateTag().getBoolean("reloading") || stack.getOrCreateTag().getInt("bolt_action_anim") > 0) {
|
||||||
|
main.setRotX(numR * main.getRotX());
|
||||||
|
main.setRotY(numR * main.getRotY());
|
||||||
|
main.setRotZ(numR * main.getRotZ());
|
||||||
|
main.setPosX(numP * main.getPosX());
|
||||||
|
main.setPosY(numP * main.getPosY());
|
||||||
|
main.setPosZ(numP * main.getPosZ());
|
||||||
|
body.setRotX(numR * body.getRotX());
|
||||||
|
body.setRotY(numR * body.getRotY());
|
||||||
|
body.setRotZ(numR * body.getRotZ());
|
||||||
|
body.setPosX(numP * body.getPosX());
|
||||||
|
body.setPosY(numP * body.getPosY());
|
||||||
|
body.setPosZ(numP * body.getPosZ());
|
||||||
|
camera.setRotX(numR * camera.getRotX());
|
||||||
|
camera.setRotY(numR * camera.getRotY());
|
||||||
|
camera.setRotZ(numR * camera.getRotZ());
|
||||||
|
}
|
||||||
|
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,141 @@
|
||||||
|
package net.mcreator.superbwarfare.client.renderer.item;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.PoseStack;
|
||||||
|
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||||
|
import net.mcreator.superbwarfare.client.layer.MosinNagantLayer;
|
||||||
|
import net.mcreator.superbwarfare.client.model.item.MosinNagantItemModel;
|
||||||
|
import net.mcreator.superbwarfare.item.gun.MosinNagantItem;
|
||||||
|
import net.mcreator.superbwarfare.tools.AnimUtils;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.model.PlayerModel;
|
||||||
|
import net.minecraft.client.player.AbstractClientPlayer;
|
||||||
|
import net.minecraft.client.renderer.MultiBufferSource;
|
||||||
|
import net.minecraft.client.renderer.RenderType;
|
||||||
|
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
|
||||||
|
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.world.entity.player.Player;
|
||||||
|
import net.minecraft.world.item.ItemDisplayContext;
|
||||||
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import software.bernie.geckolib.cache.object.BakedGeoModel;
|
||||||
|
import software.bernie.geckolib.cache.object.GeoBone;
|
||||||
|
import software.bernie.geckolib.renderer.GeoItemRenderer;
|
||||||
|
import software.bernie.geckolib.util.RenderUtils;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class MosinNagantItemRenderer extends GeoItemRenderer<MosinNagantItem> {
|
||||||
|
public MosinNagantItemRenderer() {
|
||||||
|
super(new MosinNagantItemModel());
|
||||||
|
this.addRenderLayer(new MosinNagantLayer(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RenderType getRenderType(MosinNagantItem animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
|
||||||
|
return RenderType.entityTranslucent(getTextureLocation(animatable));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final float SCALE_RECIPROCAL = 1.0f / 16.0f;
|
||||||
|
protected boolean renderArms = false;
|
||||||
|
protected MultiBufferSource currentBuffer;
|
||||||
|
protected RenderType renderType;
|
||||||
|
public ItemDisplayContext transformType;
|
||||||
|
protected MosinNagantItem animatable;
|
||||||
|
private final Set<String> hiddenBones = new HashSet<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderByItem(ItemStack stack, ItemDisplayContext transformType, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int p_239207_6_) {
|
||||||
|
this.transformType = transformType;
|
||||||
|
if (this.animatable != null)
|
||||||
|
this.animatable.getTransformType(transformType);
|
||||||
|
super.renderByItem(stack, transformType, matrixStack, bufferIn, combinedLightIn, p_239207_6_);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actuallyRender(PoseStack matrixStackIn, MosinNagantItem animatable, BakedGeoModel model, RenderType type, MultiBufferSource renderTypeBuffer, VertexConsumer vertexBuilder, boolean isRenderer, float partialTicks, int packedLightIn,
|
||||||
|
int packedOverlayIn, float red, float green, float blue, float alpha) {
|
||||||
|
this.currentBuffer = renderTypeBuffer;
|
||||||
|
this.renderType = type;
|
||||||
|
this.animatable = animatable;
|
||||||
|
super.actuallyRender(matrixStackIn, animatable, model, type, renderTypeBuffer, vertexBuilder, isRenderer, partialTicks, packedLightIn, packedOverlayIn, red, green, blue, alpha);
|
||||||
|
if (this.renderArms) {
|
||||||
|
this.renderArms = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderRecursively(PoseStack stack, MosinNagantItem animatable, GeoBone bone, RenderType type, MultiBufferSource buffer, VertexConsumer bufferIn, boolean isReRender, float partialTick, int packedLightIn, int packedOverlayIn, float red,
|
||||||
|
float green, float blue, float alpha) {
|
||||||
|
Minecraft mc = Minecraft.getInstance();
|
||||||
|
String name = bone.getName();
|
||||||
|
boolean renderingArms = false;
|
||||||
|
if (name.equals("Lefthand") || name.equals("Righthand")) {
|
||||||
|
bone.setHidden(true);
|
||||||
|
renderingArms = true;
|
||||||
|
} else {
|
||||||
|
bone.setHidden(this.hiddenBones.contains(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
Player player_ = Minecraft.getInstance().player;
|
||||||
|
ItemStack itemStack = null;
|
||||||
|
if (player_ != null) {
|
||||||
|
itemStack = player_.getMainHandItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.equals("flare")) {
|
||||||
|
if (itemStack != null && itemStack.getOrCreateTag().getDouble("flash_time") > 0) {
|
||||||
|
bone.setHidden(false);
|
||||||
|
bone.setScaleX((float) (0.95 + 0.5 * (Math.random() - 0.5)));
|
||||||
|
bone.setScaleY((float) (0.95 + 0.5 * (Math.random() - 0.5)));
|
||||||
|
bone.setRotZ((float) (0.5 * (Math.random() - 0.5)));
|
||||||
|
} else {
|
||||||
|
bone.setHidden(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.equals("jia")) {
|
||||||
|
if (player_ != null) {
|
||||||
|
bone.setHidden(!itemStack.getOrCreateTag().getBoolean("HoloHidden"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.transformType.firstPerson() && renderingArms) {
|
||||||
|
AbstractClientPlayer player = mc.player;
|
||||||
|
|
||||||
|
if (player == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerRenderer playerRenderer = (PlayerRenderer) mc.getEntityRenderDispatcher().getRenderer(player);
|
||||||
|
PlayerModel<AbstractClientPlayer> model = playerRenderer.getModel();
|
||||||
|
stack.pushPose();
|
||||||
|
RenderUtils.translateMatrixToBone(stack, bone);
|
||||||
|
RenderUtils.translateToPivotPoint(stack, bone);
|
||||||
|
RenderUtils.rotateMatrixAroundBone(stack, bone);
|
||||||
|
RenderUtils.scaleMatrixForBone(stack, bone);
|
||||||
|
RenderUtils.translateAwayFromPivotPoint(stack, bone);
|
||||||
|
ResourceLocation loc = player.getSkinTextureLocation();
|
||||||
|
VertexConsumer armBuilder = this.currentBuffer.getBuffer(RenderType.entitySolid(loc));
|
||||||
|
VertexConsumer sleeveBuilder = this.currentBuffer.getBuffer(RenderType.entityTranslucent(loc));
|
||||||
|
if (name.equals("Lefthand")) {
|
||||||
|
stack.translate(-1.0f * SCALE_RECIPROCAL, 2.0f * SCALE_RECIPROCAL, 0.0f);
|
||||||
|
AnimUtils.renderPartOverBone(model.leftArm, bone, stack, armBuilder, packedLightIn, OverlayTexture.NO_OVERLAY, 1);
|
||||||
|
AnimUtils.renderPartOverBone(model.leftSleeve, bone, stack, sleeveBuilder, packedLightIn, OverlayTexture.NO_OVERLAY, 1);
|
||||||
|
} else {
|
||||||
|
stack.translate(SCALE_RECIPROCAL, 2.0f * SCALE_RECIPROCAL, 0.0f);
|
||||||
|
AnimUtils.renderPartOverBone(model.rightArm, bone, stack, armBuilder, packedLightIn, OverlayTexture.NO_OVERLAY, 1);
|
||||||
|
AnimUtils.renderPartOverBone(model.rightSleeve, bone, stack, sleeveBuilder, packedLightIn, OverlayTexture.NO_OVERLAY, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currentBuffer.getBuffer(this.renderType);
|
||||||
|
stack.popPose();
|
||||||
|
}
|
||||||
|
super.renderRecursively(stack, animatable, bone, type, buffer, bufferIn, isReRender, partialTick, packedLightIn, packedOverlayIn, red, green, blue, alpha);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResourceLocation getTextureLocation(MosinNagantItem instance) {
|
||||||
|
return super.getTextureLocation(instance);
|
||||||
|
}
|
||||||
|
}
|
|
@ -415,16 +415,16 @@ public class GunEventHandler {
|
||||||
|
|
||||||
if (stack.is(ModTags.Items.OPEN_BOLT)) {
|
if (stack.is(ModTags.Items.OPEN_BOLT)) {
|
||||||
if (tag.getInt("ammo") == 0) {
|
if (tag.getInt("ammo") == 0) {
|
||||||
tag.putInt("gun_reloading_time", (int) tag.getDouble("empty_reload_time"));
|
tag.putInt("gun_reloading_time", (int) tag.getDouble("empty_reload_time") + 2);
|
||||||
stack.getOrCreateTag().putBoolean("is_empty_reloading", true);
|
stack.getOrCreateTag().putBoolean("is_empty_reloading", true);
|
||||||
playGunEmptyReloadSounds(player);
|
playGunEmptyReloadSounds(player);
|
||||||
} else {
|
} else {
|
||||||
tag.putInt("gun_reloading_time", (int) tag.getDouble("normal_reload_time"));
|
tag.putInt("gun_reloading_time", (int) tag.getDouble("normal_reload_time") + 2);
|
||||||
stack.getOrCreateTag().putBoolean("is_normal_reloading", true);
|
stack.getOrCreateTag().putBoolean("is_normal_reloading", true);
|
||||||
playGunNormalReloadSounds(player);
|
playGunNormalReloadSounds(player);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tag.putInt("gun_reloading_time", (int) tag.getDouble("empty_reload_time"));
|
tag.putInt("gun_reloading_time", (int) tag.getDouble("empty_reload_time") + 2);
|
||||||
stack.getOrCreateTag().putBoolean("is_empty_reloading", true);
|
stack.getOrCreateTag().putBoolean("is_empty_reloading", true);
|
||||||
playGunEmptyReloadSounds(player);
|
playGunEmptyReloadSounds(player);
|
||||||
}
|
}
|
||||||
|
@ -605,7 +605,11 @@ public class GunEventHandler {
|
||||||
playGunPrepareLoadReloadSounds(player);
|
playGunPrepareLoadReloadSounds(player);
|
||||||
tag.putInt("prepare_load", (int) tag.getDouble("prepare_load_time"));
|
tag.putInt("prepare_load", (int) tag.getDouble("prepare_load_time"));
|
||||||
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("prepare_load_time"));
|
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("prepare_load_time"));
|
||||||
|
} else if (tag.getDouble("prepare_empty") != 0 && tag.getInt("ammo") == 0) {
|
||||||
|
// 此处判断空仓换弹,如莫辛纳甘
|
||||||
|
playGunEmptyPrepareSounds(player);
|
||||||
|
tag.putInt("prepare", (int) tag.getDouble("prepare_empty"));
|
||||||
|
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("prepare_empty"));
|
||||||
} else {
|
} else {
|
||||||
playGunPrepareReloadSounds(player);
|
playGunPrepareReloadSounds(player);
|
||||||
tag.putInt("prepare", (int) tag.getDouble("prepare_time"));
|
tag.putInt("prepare", (int) tag.getDouble("prepare_time"));
|
||||||
|
@ -673,7 +677,7 @@ public class GunEventHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack.getItem() == ModItems.K_98.get()) {
|
if (stack.getItem() == ModItems.K_98.get() || stack.getItem() == ModItems.MOSIN_NAGANT.get()) {
|
||||||
if (tag.getInt("iterative") == 1) {
|
if (tag.getInt("iterative") == 1) {
|
||||||
singleLoad(player);
|
singleLoad(player);
|
||||||
}
|
}
|
||||||
|
@ -710,8 +714,8 @@ public class GunEventHandler {
|
||||||
// 三阶段
|
// 三阶段
|
||||||
if ((tag.getInt("iterative") == 1 && tag.getInt("reload_stage") == 3) || tag.getBoolean("force_stage3_start")) {
|
if ((tag.getInt("iterative") == 1 && tag.getInt("reload_stage") == 3) || tag.getBoolean("force_stage3_start")) {
|
||||||
tag.putBoolean("force_stage3_start", false);
|
tag.putBoolean("force_stage3_start", false);
|
||||||
tag.putDouble("finish", (int) tag.getDouble("finish_time"));
|
tag.putDouble("finish", (int) tag.getDouble("finish_time") + 2);
|
||||||
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("finish_time"));
|
player.getCooldowns().addCooldown(stack.getItem(), (int) tag.getDouble("finish_time") + 2);
|
||||||
playGunEndReloadSounds(player);
|
playGunEndReloadSounds(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -773,6 +777,23 @@ public class GunEventHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void playGunEmptyPrepareSounds(Player player) {
|
||||||
|
ItemStack stack = player.getMainHandItem();
|
||||||
|
if (!stack.is(ModTags.Items.GUN)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player.level().isClientSide) {
|
||||||
|
String origin = stack.getItem().getDescriptionId();
|
||||||
|
String name = origin.substring(origin.lastIndexOf(".") + 1);
|
||||||
|
|
||||||
|
SoundEvent sound1p = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation(ModUtils.MODID, name + "_prepare_empty"));
|
||||||
|
if (sound1p != null && player instanceof ServerPlayer serverPlayer) {
|
||||||
|
SoundTool.playLocalSound(serverPlayer, sound1p, 10f, 1f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void playGunPrepareLoadReloadSounds(Player player) {
|
public static void playGunPrepareLoadReloadSounds(Player player) {
|
||||||
ItemStack stack = player.getMainHandItem();
|
ItemStack stack = player.getMainHandItem();
|
||||||
if (!stack.is(ModTags.Items.GUN)) {
|
if (!stack.is(ModTags.Items.GUN)) {
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class ModItems {
|
||||||
public static final RegistryObject<Item> MK_14 = GUNS.register("mk_14", Mk14Item::new);
|
public static final RegistryObject<Item> MK_14 = GUNS.register("mk_14", Mk14Item::new);
|
||||||
public static final RegistryObject<Item> MARLIN = GUNS.register("marlin", MarlinItem::new);
|
public static final RegistryObject<Item> MARLIN = GUNS.register("marlin", MarlinItem::new);
|
||||||
public static final RegistryObject<Item> K_98 = GUNS.register("k_98", K98Item::new);
|
public static final RegistryObject<Item> K_98 = GUNS.register("k_98", K98Item::new);
|
||||||
|
public static final RegistryObject<Item> MOSIN_NAGANT = GUNS.register("mosin_nagant", MosinNagantItem::new);
|
||||||
public static final RegistryObject<Item> SVD = GUNS.register("svd", SvdItem::new);
|
public static final RegistryObject<Item> SVD = GUNS.register("svd", SvdItem::new);
|
||||||
public static final RegistryObject<Item> M_98B = GUNS.register("m_98b", M98bItem::new);
|
public static final RegistryObject<Item> M_98B = GUNS.register("m_98b", M98bItem::new);
|
||||||
public static final RegistryObject<Item> SENTINEL = GUNS.register("sentinel", SentinelItem::new);
|
public static final RegistryObject<Item> SENTINEL = GUNS.register("sentinel", SentinelItem::new);
|
||||||
|
@ -174,6 +175,7 @@ public class ModItems {
|
||||||
public static final RegistryObject<Item> M_1911_BLUEPRINT = ITEMS.register("m_1911_blueprint", () -> new BlueprintItem(Rarity.COMMON));
|
public static final RegistryObject<Item> M_1911_BLUEPRINT = ITEMS.register("m_1911_blueprint", () -> new BlueprintItem(Rarity.COMMON));
|
||||||
public static final RegistryObject<Item> QBZ_95_BLUEPRINT = ITEMS.register("qbz_95_blueprint", () -> new BlueprintItem(Rarity.EPIC));
|
public static final RegistryObject<Item> QBZ_95_BLUEPRINT = ITEMS.register("qbz_95_blueprint", () -> new BlueprintItem(Rarity.EPIC));
|
||||||
public static final RegistryObject<Item> K_98_BLUEPRINT = ITEMS.register("k_98_blueprint", () -> new BlueprintItem(Rarity.RARE));
|
public static final RegistryObject<Item> K_98_BLUEPRINT = ITEMS.register("k_98_blueprint", () -> new BlueprintItem(Rarity.RARE));
|
||||||
|
public static final RegistryObject<Item> MOSIN_NAGANT_BLUEPRINT = ITEMS.register("mosin_nagant_blueprint", () -> new BlueprintItem(Rarity.RARE));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Block
|
* Block
|
||||||
|
|
|
@ -251,6 +251,16 @@ public class ModSounds {
|
||||||
public static final RegistryObject<SoundEvent> K_98_LOOP = REGISTRY.register("k_98_loop", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "k_98_loop")));
|
public static final RegistryObject<SoundEvent> K_98_LOOP = REGISTRY.register("k_98_loop", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "k_98_loop")));
|
||||||
public static final RegistryObject<SoundEvent> K_98_END = REGISTRY.register("k_98_end", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "k_98_end")));
|
public static final RegistryObject<SoundEvent> K_98_END = REGISTRY.register("k_98_end", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "k_98_end")));
|
||||||
|
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_FIRE_1P = REGISTRY.register("mosin_nagant_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_fire_1p")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_FIRE_3P = REGISTRY.register("mosin_nagant_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_fire_3p")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_FAR = REGISTRY.register("mosin_nagant_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_far")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_VERYFAR = REGISTRY.register("mosin_nagant_veryfar", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_veryfar")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_BOLT = REGISTRY.register("mosin_nagant_bolt", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_bolt")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_PREPARE = REGISTRY.register("mosin_nagant_prepare", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_prepare")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_PREPARE_EMPTY = REGISTRY.register("mosin_nagant_prepare_empty", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_prepare_empty")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_LOOP = REGISTRY.register("mosin_nagant_loop", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_loop")));
|
||||||
|
public static final RegistryObject<SoundEvent> MOSIN_NAGANT_END = REGISTRY.register("mosin_nagant_end", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mosin_nagant_end")));
|
||||||
|
|
||||||
public static final RegistryObject<SoundEvent> MK_42_FIRE_1P = REGISTRY.register("mk_42_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mk_42_fire_1p")));
|
public static final RegistryObject<SoundEvent> MK_42_FIRE_1P = REGISTRY.register("mk_42_fire_1p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mk_42_fire_1p")));
|
||||||
public static final RegistryObject<SoundEvent> MK_42_FIRE_3P = REGISTRY.register("mk_42_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mk_42_fire_3p")));
|
public static final RegistryObject<SoundEvent> MK_42_FIRE_3P = REGISTRY.register("mk_42_fire_3p", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mk_42_fire_3p")));
|
||||||
public static final RegistryObject<SoundEvent> MK_42_FAR = REGISTRY.register("mk_42_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mk_42_far")));
|
public static final RegistryObject<SoundEvent> MK_42_FAR = REGISTRY.register("mk_42_far", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(ModUtils.MODID, "mk_42_far")));
|
||||||
|
|
|
@ -38,6 +38,7 @@ public class ModTabs {
|
||||||
output.accept(Mk14Item.getGunInstance());
|
output.accept(Mk14Item.getGunInstance());
|
||||||
output.accept(MarlinItem.getGunInstance());
|
output.accept(MarlinItem.getGunInstance());
|
||||||
output.accept(K98Item.getGunInstance());
|
output.accept(K98Item.getGunInstance());
|
||||||
|
output.accept(MosinNagantItem.getGunInstance());
|
||||||
output.accept(SvdItem.getGunInstance());
|
output.accept(SvdItem.getGunInstance());
|
||||||
output.accept(HuntingRifle.getGunInstance());
|
output.accept(HuntingRifle.getGunInstance());
|
||||||
output.accept(M98bItem.getGunInstance());
|
output.accept(M98bItem.getGunInstance());
|
||||||
|
|
|
@ -0,0 +1,226 @@
|
||||||
|
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.MosinNagantItemRenderer;
|
||||||
|
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.PoseTool;
|
||||||
|
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 MosinNagantItem extends GunItem implements GeoItem, AnimatedItem {
|
||||||
|
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
|
||||||
|
public String animationProcedure = "empty";
|
||||||
|
public static ItemDisplayContext transformType;
|
||||||
|
|
||||||
|
public MosinNagantItem() {
|
||||||
|
super(new Properties().stacksTo(1).rarity(Rarity.RARE));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initializeClient(Consumer<IClientItemExtensions> consumer) {
|
||||||
|
super.initializeClient(consumer);
|
||||||
|
consumer.accept(new IClientItemExtensions() {
|
||||||
|
private final BlockEntityWithoutLevelRenderer renderer = new MosinNagantItemRenderer();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockEntityWithoutLevelRenderer getCustomRenderer() {
|
||||||
|
return renderer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HumanoidModel.ArmPose getArmPose(LivingEntity entityLiving, InteractionHand hand, ItemStack stack) {
|
||||||
|
return PoseTool.pose(entityLiving, hand, stack);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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("bolt_action_anim") > 0) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mosin.shift"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.getOrCreateTag().getInt("fire_animation") > 0) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mosin.fire"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.getOrCreateTag().getInt("reload_stage") == 1 && stack.getOrCreateTag().getInt("ammo") == 0) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mosin.prepare_empty"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.getOrCreateTag().getInt("reload_stage") == 1 && stack.getOrCreateTag().getInt("ammo") > 0) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mosin.prepare"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.getOrCreateTag().getDouble("load_index") == 0 && stack.getOrCreateTag().getInt("reload_stage") == 2) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mosin.iterativeload"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.getOrCreateTag().getDouble("load_index") == 1 && stack.getOrCreateTag().getInt("reload_stage") == 2) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mosin.iterativeload2"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (stack.getOrCreateTag().getInt("reload_stage") == 3) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.mosin.finish"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.mosin.idle"));
|
||||||
|
}
|
||||||
|
return PlayState.STOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
private PlayState idlePredicate(AnimationState<MosinNagantItem> 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") < 16) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.mosin.draw"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (player.isSprinting() && player.onGround()
|
||||||
|
&& player.getPersistentData().getDouble("noRun") == 0
|
||||||
|
&& !(stack.getOrCreateTag().getBoolean("is_empty_reloading"))
|
||||||
|
&& stack.getOrCreateTag().getInt("reload_stage") != 1
|
||||||
|
&& stack.getOrCreateTag().getInt("reload_stage") != 2
|
||||||
|
&& stack.getOrCreateTag().getInt("reload_stage") != 3) {
|
||||||
|
if (player.hasEffect(MobEffects.MOVEMENT_SPEED) && stack.getOrCreateTag().getInt("bolt_action_anim") == 0) {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.mosin.run_fast"));
|
||||||
|
} else {
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.mosin.run"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.mosin.idle"));
|
||||||
|
}
|
||||||
|
return PlayState.STOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
private PlayState procedurePredicate(AnimationState<MosinNagantItem> event) {
|
||||||
|
if (transformType != null && transformType.firstPerson()) {
|
||||||
|
if (!this.animationProcedure.equals("empty") && event.getController().getAnimationState() == AnimationController.State.STOPPED) {
|
||||||
|
event.getController().setAnimation(RawAnimation.begin().thenPlay(this.animationProcedure));
|
||||||
|
if (event.getController().getAnimationState() == AnimationController.State.STOPPED) {
|
||||||
|
this.animationProcedure = "empty";
|
||||||
|
event.getController().forceAnimationReset();
|
||||||
|
}
|
||||||
|
} else if (this.animationProcedure.equals("empty")) {
|
||||||
|
return PlayState.STOP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PlayState.CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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.05f, AttributeModifier.Operation.MULTIPLY_BASE));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<SoundEvent> getReloadSound() {
|
||||||
|
return Set.of(
|
||||||
|
ModSounds.MOSIN_NAGANT_BOLT.get(),
|
||||||
|
ModSounds.MOSIN_NAGANT_PREPARE.get(),
|
||||||
|
ModSounds.MOSIN_NAGANT_PREPARE_EMPTY.get(),
|
||||||
|
ModSounds.MOSIN_NAGANT_LOOP.get(),
|
||||||
|
ModSounds.MOSIN_NAGANT_END.get()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ItemStack getGunInstance() {
|
||||||
|
ItemStack stack = new ItemStack(ModItems.MOSIN_NAGANT.get());
|
||||||
|
GunsTool.initCreativeGun(stack, ModItems.MOSIN_NAGANT.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/mosin_nagant_icon.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getGunDisplayName() {
|
||||||
|
return "MOSIN NAGANT";
|
||||||
|
}
|
||||||
|
}
|
|
@ -52,10 +52,8 @@ public class ZoomMessage {
|
||||||
if (message.type == 1) {
|
if (message.type == 1) {
|
||||||
player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||||
capability.zoom = false;
|
capability.zoom = false;
|
||||||
capability.syncPlayerVariables(player);
|
|
||||||
});
|
|
||||||
player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
|
||||||
capability.zooming = false;
|
capability.zooming = false;
|
||||||
|
capability.breath = false;
|
||||||
capability.syncPlayerVariables(player);
|
capability.syncPlayerVariables(player);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
5387
src/main/resources/assets/superbwarfare/geo/mosin_nagant.geo.json
Normal file
5387
src/main/resources/assets/superbwarfare/geo/mosin_nagant.geo.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -43,6 +43,7 @@
|
||||||
"item.superbwarfare.m_1911": "M1911A1",
|
"item.superbwarfare.m_1911": "M1911A1",
|
||||||
"item.superbwarfare.qbz_95": "QBZ-95-1",
|
"item.superbwarfare.qbz_95": "QBZ-95-1",
|
||||||
"item.superbwarfare.k_98": "KAR-98K",
|
"item.superbwarfare.k_98": "KAR-98K",
|
||||||
|
"item.superbwarfare.mosin_nagant": "Mosin Nagant",
|
||||||
|
|
||||||
"des.superbwarfare.tips.damage": "Damage: ",
|
"des.superbwarfare.tips.damage": "Damage: ",
|
||||||
"des.superbwarfare.tips.level": "Level: ",
|
"des.superbwarfare.tips.level": "Level: ",
|
||||||
|
@ -78,6 +79,7 @@
|
||||||
"item.superbwarfare.m_1911_blueprint": "M1911 Blueprint",
|
"item.superbwarfare.m_1911_blueprint": "M1911 Blueprint",
|
||||||
"item.superbwarfare.qbz_95_blueprint": "QBZ-95-1 Blueprint",
|
"item.superbwarfare.qbz_95_blueprint": "QBZ-95-1 Blueprint",
|
||||||
"item.superbwarfare.k_98_blueprint": "KAR-98K Blueprint",
|
"item.superbwarfare.k_98_blueprint": "KAR-98K Blueprint",
|
||||||
|
"item.superbwarfare.mosin_nagant_blueprint": "Mosin Nagant Blueprint",
|
||||||
|
|
||||||
"item.superbwarfare.common_material_pack": "Common Material Pack",
|
"item.superbwarfare.common_material_pack": "Common Material Pack",
|
||||||
"item.superbwarfare.rare_material_pack": "Rare Material Pack",
|
"item.superbwarfare.rare_material_pack": "Rare Material Pack",
|
||||||
|
|
|
@ -43,6 +43,7 @@
|
||||||
"item.superbwarfare.m_1911": "M1911手枪",
|
"item.superbwarfare.m_1911": "M1911手枪",
|
||||||
"item.superbwarfare.qbz_95": "95-1式自动步枪",
|
"item.superbwarfare.qbz_95": "95-1式自动步枪",
|
||||||
"item.superbwarfare.k_98": "KAR-98K",
|
"item.superbwarfare.k_98": "KAR-98K",
|
||||||
|
"item.superbwarfare.mosin_nagant": "莫辛纳甘",
|
||||||
|
|
||||||
"des.superbwarfare.tips.upgradepoint": "升级点数: ",
|
"des.superbwarfare.tips.upgradepoint": "升级点数: ",
|
||||||
"des.superbwarfare.tips.damage": "伤害: ",
|
"des.superbwarfare.tips.damage": "伤害: ",
|
||||||
|
@ -78,6 +79,7 @@
|
||||||
"item.superbwarfare.m_1911_blueprint": "M1911手枪蓝图",
|
"item.superbwarfare.m_1911_blueprint": "M1911手枪蓝图",
|
||||||
"item.superbwarfare.qbz_95_blueprint": "95-1式自动步枪蓝图",
|
"item.superbwarfare.qbz_95_blueprint": "95-1式自动步枪蓝图",
|
||||||
"item.superbwarfare.k_98_blueprint": "KAR-98K蓝图",
|
"item.superbwarfare.k_98_blueprint": "KAR-98K蓝图",
|
||||||
|
"item.superbwarfare.mosin_nagant_blueprint": "莫辛纳甘蓝图",
|
||||||
|
|
||||||
"item.superbwarfare.common_material_pack": "普通材料包",
|
"item.superbwarfare.common_material_pack": "普通材料包",
|
||||||
"item.superbwarfare.rare_material_pack": "稀有材料包",
|
"item.superbwarfare.rare_material_pack": "稀有材料包",
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
"parent": "superbwarfare:item/k98_3d"
|
"parent": "superbwarfare:item/k98_3d"
|
||||||
},
|
},
|
||||||
"thirdperson_lefthand": {
|
"thirdperson_lefthand": {
|
||||||
"parent": "superbwarfare:item/98_3d"
|
"parent": "superbwarfare:item/k98_3d"
|
||||||
},
|
},
|
||||||
"ground": {
|
"ground": {
|
||||||
"parent": "superbwarfare:item/98_3d"
|
"parent": "superbwarfare:item/k98_3d"
|
||||||
},
|
},
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"parent": "superbwarfare:item/98_3d"
|
"parent": "superbwarfare:item/k98_3d"
|
||||||
},
|
},
|
||||||
"head": {
|
"head": {
|
||||||
"parent": "superbwarfare:item/98_3d"
|
"parent": "superbwarfare:item/k98_3d"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"loader": "forge:separate_transforms",
|
||||||
|
"gui_light": "front",
|
||||||
|
"base": {
|
||||||
|
"parent": "superbwarfare:item/mosin_nagant_base"
|
||||||
|
},
|
||||||
|
"perspectives": {
|
||||||
|
"gui": {
|
||||||
|
"parent": "superbwarfare:item/mosin_nagant_icon"
|
||||||
|
},
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"parent": "superbwarfare:item/mosin_nagant_3d"
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"parent": "superbwarfare:item/mosin_nagant_3d"
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"parent": "superbwarfare:item/mosin_nagant_3d"
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"parent": "superbwarfare:item/mosin_nagant_3d"
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"parent": "superbwarfare:item/mosin_nagant_3d"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,324 @@
|
||||||
|
{
|
||||||
|
"credit": "Made with Blockbench",
|
||||||
|
"texture_size": [32, 32],
|
||||||
|
"textures": {
|
||||||
|
"0": "superbwarfare:item/mosin3d"
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [7.4, 6.6, 15.7],
|
||||||
|
"to": [8.6, 7.4, 18.75],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [10, 11.5, 10.5, 12], "texture": "#0"},
|
||||||
|
"east": {"uv": [9, 8, 10.5, 8.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [11.5, 10, 12, 10.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [10.5, 3, 12, 3.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [1.5, 12, 1, 10.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [2, 10.5, 1.5, 12], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.5, 8, 13.7],
|
||||||
|
"to": [8.5, 9, 19.25],
|
||||||
|
"rotation": {"angle": 45, "axis": "z", "origin": [8, 8.5, 16.725]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [10.5, 11.5, 11, 12], "texture": "#0"},
|
||||||
|
"east": {"uv": [9, 7.5, 12, 8], "texture": "#0"},
|
||||||
|
"south": {"uv": [11.5, 10.5, 12, 11], "texture": "#0"},
|
||||||
|
"west": {"uv": [8, 9, 11, 9.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [10, 3, 9.5, 0], "texture": "#0"},
|
||||||
|
"down": {"uv": [8.5, 9.5, 8, 12.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.6, 6.2, -15.1],
|
||||||
|
"to": [8.4, 7, -8.35],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.7, 0.275]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [11.5, 11, 12, 11.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [8, 8.5, 11.5, 9], "texture": "#0"},
|
||||||
|
"south": {"uv": [11.5, 11.5, 12, 12], "texture": "#0"},
|
||||||
|
"west": {"uv": [9, 6, 12.5, 6.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [2.5, 12.5, 2, 9], "texture": "#0"},
|
||||||
|
"down": {"uv": [3, 9, 2.5, 12.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.7, 7, -14],
|
||||||
|
"to": [8.3, 7.5, -13.45],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, -1.6]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12, 0, 12.5, 0.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [12, 0.5, 12.5, 1], "texture": "#0"},
|
||||||
|
"south": {"uv": [1, 12, 1.5, 12.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [1.5, 12, 2, 12.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [12.5, 2.5, 12, 2], "texture": "#0"},
|
||||||
|
"down": {"uv": [12.5, 2.5, 12, 3], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.35, 5.3, 8.55],
|
||||||
|
"to": [8.65, 7.1, 9],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 6.8]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8.5, 10.5, 9, 11.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [9, 10.5, 9.5, 11.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [9.5, 10.5, 10, 11.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [10.5, 9.5, 11, 10.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [12.5, 3.5, 12, 3], "texture": "#0"},
|
||||||
|
"down": {"uv": [12.5, 3.5, 12, 4], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.35, 5.3, -3.55],
|
||||||
|
"to": [8.65, 7.1, -3.1],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, -5.3]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [10, 10.5, 10.5, 11.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [10.5, 10.5, 11, 11.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [11, 0, 11.5, 1], "texture": "#0"},
|
||||||
|
"west": {"uv": [11, 1, 11.5, 2], "texture": "#0"},
|
||||||
|
"up": {"uv": [6.5, 12.5, 6, 12], "texture": "#0"},
|
||||||
|
"down": {"uv": [7, 12, 6.5, 12.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.5, 6.7, 9],
|
||||||
|
"to": [8.5, 7.3, 11.75],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [7, 12, 7.5, 12.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [10.5, 3.5, 12, 4], "texture": "#0"},
|
||||||
|
"south": {"uv": [7.5, 12, 8, 12.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [10.5, 8, 12, 8.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [6.5, 12, 6, 10.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [7, 10.5, 6.5, 12], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8.3, 6.8, 15.25],
|
||||||
|
"to": [9.1, 7.2, 15.65],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, -5.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12, 7.5, 12.5, 8], "texture": "#0"},
|
||||||
|
"east": {"uv": [12, 8, 12.5, 8.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [12, 8.5, 12.5, 9], "texture": "#0"},
|
||||||
|
"west": {"uv": [9, 12, 9.5, 12.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [12.5, 9.5, 12, 9], "texture": "#0"},
|
||||||
|
"down": {"uv": [10, 12, 9.5, 12.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [8.8683, 5.75391, 15.25],
|
||||||
|
"to": [9.2683, 7.15391, 15.65],
|
||||||
|
"rotation": {"angle": 22.5, "axis": "z", "origin": [9.0683, 6.75391, 15.45]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [10, 12, 10.5, 12.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [12, 10, 12.5, 10.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [10.5, 12, 11, 12.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [12, 10.5, 12.5, 11], "texture": "#0"},
|
||||||
|
"up": {"uv": [11.5, 12.5, 11, 12], "texture": "#0"},
|
||||||
|
"down": {"uv": [12.5, 11, 12, 11.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.7, 6.5, 11.75],
|
||||||
|
"to": [8.3, 7.2, 18.35],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 4]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [11.5, 12, 12, 12.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [9, 6.5, 12.5, 7], "texture": "#0"},
|
||||||
|
"south": {"uv": [12, 11.5, 12.5, 12], "texture": "#0"},
|
||||||
|
"west": {"uv": [9, 7, 12.5, 7.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [3.5, 12.5, 3, 9], "texture": "#0"},
|
||||||
|
"down": {"uv": [4, 9, 3.5, 12.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.25, 5.05, 9],
|
||||||
|
"to": [8.75, 6.75, 19],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [9.5, 3, 10.5, 4], "texture": "#0"},
|
||||||
|
"east": {"uv": [2, 2, 7, 3], "texture": "#0"},
|
||||||
|
"south": {"uv": [8.5, 9.5, 9.5, 10.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [2, 3, 7, 4], "texture": "#0"},
|
||||||
|
"up": {"uv": [3, 9, 2, 4], "texture": "#0"},
|
||||||
|
"down": {"uv": [4, 4, 3, 9], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.05, 6.85, 14.8],
|
||||||
|
"to": [7.35, 8.45, 15.3],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [11, 2, 11.5, 3], "texture": "#0"},
|
||||||
|
"east": {"uv": [7, 11, 7.5, 12], "texture": "#0"},
|
||||||
|
"south": {"uv": [7.5, 11, 8, 12], "texture": "#0"},
|
||||||
|
"west": {"uv": [11, 9, 11.5, 10], "texture": "#0"},
|
||||||
|
"up": {"uv": [12.5, 12.5, 12, 12], "texture": "#0"},
|
||||||
|
"down": {"uv": [0.5, 12.5, 0, 13], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.05, 6.85, 16.4],
|
||||||
|
"to": [7.35, 8.45, 16.9],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 2.1]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [11, 10, 11.5, 11], "texture": "#0"},
|
||||||
|
"east": {"uv": [11, 11, 11.5, 12], "texture": "#0"},
|
||||||
|
"south": {"uv": [0, 11.5, 0.5, 12.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [11.5, 0, 12, 1], "texture": "#0"},
|
||||||
|
"up": {"uv": [13, 0.5, 12.5, 0], "texture": "#0"},
|
||||||
|
"down": {"uv": [1, 12.5, 0.5, 13], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.35, 7.85, 16.4],
|
||||||
|
"to": [8.15, 8.45, 16.9],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 2.1]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12.5, 0.5, 13, 1], "texture": "#0"},
|
||||||
|
"east": {"uv": [1, 12.5, 1.5, 13], "texture": "#0"},
|
||||||
|
"south": {"uv": [12.5, 1, 13, 1.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [1.5, 12.5, 2, 13], "texture": "#0"},
|
||||||
|
"up": {"uv": [13, 2, 12.5, 1.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [2.5, 12.5, 2, 13], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.35, 7.85, 14.8],
|
||||||
|
"to": [8.15, 8.45, 15.3],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12.5, 2, 13, 2.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [2.5, 12.5, 3, 13], "texture": "#0"},
|
||||||
|
"south": {"uv": [12.5, 2.5, 13, 3], "texture": "#0"},
|
||||||
|
"west": {"uv": [3, 12.5, 3.5, 13], "texture": "#0"},
|
||||||
|
"up": {"uv": [13, 3.5, 12.5, 3], "texture": "#0"},
|
||||||
|
"down": {"uv": [4, 12.5, 3.5, 13], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.01406, 6.35, 14.7],
|
||||||
|
"to": [7.35, 6.85, 17],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 2.1]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12.5, 3.5, 13, 4], "texture": "#0"},
|
||||||
|
"east": {"uv": [11.5, 1, 12.5, 1.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [6, 12.5, 6.5, 13], "texture": "#0"},
|
||||||
|
"west": {"uv": [11.5, 1.5, 12.5, 2], "texture": "#0"},
|
||||||
|
"up": {"uv": [1, 12.5, 0.5, 11.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [12, 2, 11.5, 3], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.45, 5.35, -8.9],
|
||||||
|
"to": [8.55, 6.75, 9],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12.5, 6, 13, 6.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [4, 4, 13, 4.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [6.5, 12.5, 7, 13], "texture": "#0"},
|
||||||
|
"west": {"uv": [4, 4.5, 13, 5], "texture": "#0"},
|
||||||
|
"up": {"uv": [4.5, 14, 4, 5], "texture": "#0"},
|
||||||
|
"down": {"uv": [5, 5, 4.5, 14], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.45, 6.75, -8.9],
|
||||||
|
"to": [8.55, 7.05, 9],
|
||||||
|
"rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 0.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12.5, 6.5, 13, 7], "texture": "#0"},
|
||||||
|
"east": {"uv": [5, 5, 14, 5.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [7, 12.5, 7.5, 13], "texture": "#0"},
|
||||||
|
"west": {"uv": [5, 5.5, 14, 6], "texture": "#0"},
|
||||||
|
"up": {"uv": [5.5, 15, 5, 6], "texture": "#0"},
|
||||||
|
"down": {"uv": [6, 6, 5.5, 15], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.25, 0.48603, 17.41424],
|
||||||
|
"to": [8.75, 2.28603, 29.91424],
|
||||||
|
"rotation": {"angle": 22.5, "axis": "x", "origin": [8, 1.28603, 29.57807]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [9.5, 9.5, 10.5, 10.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [0, 0, 6.5, 1], "texture": "#0"},
|
||||||
|
"south": {"uv": [10, 0, 11, 1], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 1, 6.5, 2], "texture": "#0"},
|
||||||
|
"up": {"uv": [1, 8.5, 0, 2], "texture": "#0"},
|
||||||
|
"down": {"uv": [2, 2, 1, 8.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.25, 3.68658, 21.6194],
|
||||||
|
"to": [8.75, 5.58658, 26.1694],
|
||||||
|
"rotation": {"angle": 0, "axis": "x", "origin": [8, 3.83658, 35.48323]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [10, 1, 11, 2], "texture": "#0"},
|
||||||
|
"east": {"uv": [7, 2, 9.5, 3], "texture": "#0"},
|
||||||
|
"south": {"uv": [10, 2, 11, 3], "texture": "#0"},
|
||||||
|
"west": {"uv": [7, 3, 9.5, 4], "texture": "#0"},
|
||||||
|
"up": {"uv": [7, 10.5, 6, 8], "texture": "#0"},
|
||||||
|
"down": {"uv": [9, 6, 8, 8.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.25, 1.88658, 26.1194],
|
||||||
|
"to": [8.75, 5.58658, 30.3694],
|
||||||
|
"rotation": {"angle": 0, "axis": "x", "origin": [8, 3.83658, 35.48323]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [7, 8, 8, 10], "texture": "#0"},
|
||||||
|
"east": {"uv": [6, 6, 8, 8], "texture": "#0"},
|
||||||
|
"south": {"uv": [0, 8.5, 1, 10.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [6.5, 0, 8.5, 2], "texture": "#0"},
|
||||||
|
"up": {"uv": [9.5, 2, 8.5, 0], "texture": "#0"},
|
||||||
|
"down": {"uv": [2, 8.5, 1, 10.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [7.25, 0.36705, 29.34206],
|
||||||
|
"to": [8.75, 1.88658, 30.3694],
|
||||||
|
"rotation": {"angle": 0, "axis": "x", "origin": [8, 3.93658, 35.48323]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [7, 10, 8, 11], "texture": "#0"},
|
||||||
|
"east": {"uv": [8.5, 11.5, 9, 12.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [0, 10.5, 1, 11.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [11.5, 8.5, 12, 9.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [10, 12, 9, 11.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [12.5, 9.5, 11.5, 10], "texture": "#0"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"display": {
|
||||||
|
"thirdperson_righthand": {
|
||||||
|
"translation": [-1.5, 2, -4.75],
|
||||||
|
"scale": [0.7, 0.7, 0.7]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"translation": [-1.5, 2, -4.75],
|
||||||
|
"scale": [0.7, 0.7, 0.7]
|
||||||
|
},
|
||||||
|
"ground": {
|
||||||
|
"translation": [0, 1.5, 0],
|
||||||
|
"scale": [0.5, 0.5, 0.5]
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"translation": [0, 9.75, -4.25]
|
||||||
|
},
|
||||||
|
"fixed": {
|
||||||
|
"rotation": [0, -90, 0],
|
||||||
|
"translation": [3.5, 2.25, 0]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"groups": [
|
||||||
|
{
|
||||||
|
"name": "group",
|
||||||
|
"origin": [8, 3.83658, 35.48323],
|
||||||
|
"color": 0,
|
||||||
|
"children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "superbwarfare:displaysettings/k98.item",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "superbwarfare:item/mosin_nagant"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "superbwarfare:item/gun_blueprint"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "item/generated",
|
||||||
|
"textures": {
|
||||||
|
"layer0": "superbwarfare:item/mosin_nagant_icon"
|
||||||
|
}
|
||||||
|
}
|
|
@ -1435,6 +1435,79 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"mosin_nagant_fire_1p": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:mosin_nagant/mosin_nagant_fire_1p",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_fire_3p": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:mosin_nagant/mosin_nagant_fire_3p",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_far": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:mosin_nagant/mosin_nagant_far",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_veryfar": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:mosin_nagant/mosin_nagant_veryfar",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_bolt": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:k_98/k_98_bolt",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_loop": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:k_98/k_98_loop",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_prepare": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:k_98/k_98_prepare",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_prepare_empty": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:k_98/k_98_prepare_empty",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mosin_nagant_end": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "superbwarfare:k_98/k_98_finish",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"lightsaber": {
|
"lightsaber": {
|
||||||
"sounds": [
|
"sounds": [
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 365 B |
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 147 KiB |
26
src/main/resources/data/superbwarfare/guns/mosin_nagant.json
Normal file
26
src/main/resources/data/superbwarfare/guns/mosin_nagant.json
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"zoom_speed": 0.9,
|
||||||
|
"zoom": 3.5,
|
||||||
|
"spread": 4.8,
|
||||||
|
"zoomSpread": 0.001,
|
||||||
|
"recoil_x": 0.002,
|
||||||
|
"recoil_y": 0.063,
|
||||||
|
"damage": 33,
|
||||||
|
"headshot": 3,
|
||||||
|
"velocity": 42,
|
||||||
|
"projectile_amount": 1,
|
||||||
|
"mag": 5,
|
||||||
|
"fire_interval": 2,
|
||||||
|
"bolt_action_time": 22,
|
||||||
|
"weight": 1,
|
||||||
|
"fire_mode": 0,
|
||||||
|
"semi": 1,
|
||||||
|
"burst": 0,
|
||||||
|
"auto": 0,
|
||||||
|
"burst_size": 1,
|
||||||
|
"prepare_time": 29,
|
||||||
|
"prepare_empty": 16,
|
||||||
|
"iterative_time": 11,
|
||||||
|
"finish_time": 18,
|
||||||
|
"BypassesArmor": 0.54
|
||||||
|
}
|
|
@ -116,6 +116,20 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "superbwarfare:mosin_nagant_blueprint",
|
||||||
|
"weight": 10,
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"function": "set_count",
|
||||||
|
"count": {
|
||||||
|
"min": 1,
|
||||||
|
"max": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "minecraft:item",
|
"type": "minecraft:item",
|
||||||
"name": "superbwarfare:ak_47_blueprint",
|
"name": "superbwarfare:ak_47_blueprint",
|
||||||
|
|
|
@ -60,6 +60,20 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "superbwarfare:mosin_nagant_blueprint",
|
||||||
|
"weight": 16,
|
||||||
|
"functions": [
|
||||||
|
{
|
||||||
|
"function": "set_count",
|
||||||
|
"count": {
|
||||||
|
"min": 1,
|
||||||
|
"max": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "minecraft:item",
|
"type": "minecraft:item",
|
||||||
"name": "superbwarfare:m_4_blueprint",
|
"name": "superbwarfare:m_4_blueprint",
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "misc",
|
||||||
|
"pattern": [
|
||||||
|
"aba",
|
||||||
|
"aca",
|
||||||
|
"aaa"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"a": {
|
||||||
|
"item": "minecraft:diamond"
|
||||||
|
},
|
||||||
|
"b": {
|
||||||
|
"item": "superbwarfare:mosin_nagant_blueprint"
|
||||||
|
},
|
||||||
|
"c": {
|
||||||
|
"item": "minecraft:lapis_lazuli"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "superbwarfare:mosin_nagant_blueprint",
|
||||||
|
"count": 2
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"type": "minecraft:smithing_transform",
|
||||||
|
"template": {
|
||||||
|
"item": "superbwarfare:mosin_nagant_blueprint"
|
||||||
|
},
|
||||||
|
"base": {
|
||||||
|
"item": "superbwarfare:rare_material_pack"
|
||||||
|
},
|
||||||
|
"addition": {
|
||||||
|
"tag": "minecraft:logs"
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "superbwarfare:mosin_nagant"
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,6 +26,7 @@
|
||||||
"superbwarfare:glock_18",
|
"superbwarfare:glock_18",
|
||||||
"superbwarfare:m_1911",
|
"superbwarfare:m_1911",
|
||||||
"superbwarfare:qbz_95",
|
"superbwarfare:qbz_95",
|
||||||
"superbwarfare:k_98"
|
"superbwarfare:k_98",
|
||||||
|
"superbwarfare:mosin_nagant"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -25,6 +25,7 @@
|
||||||
"superbwarfare:glock_18",
|
"superbwarfare:glock_18",
|
||||||
"superbwarfare:m_1911",
|
"superbwarfare:m_1911",
|
||||||
"superbwarfare:qbz_95",
|
"superbwarfare:qbz_95",
|
||||||
"superbwarfare:k_98"
|
"superbwarfare:k_98",
|
||||||
|
"superbwarfare:mosin_nagant"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -29,6 +29,7 @@
|
||||||
"superbwarfare:glock_18",
|
"superbwarfare:glock_18",
|
||||||
"superbwarfare:m_1911",
|
"superbwarfare:m_1911",
|
||||||
"superbwarfare:qbz_95",
|
"superbwarfare:qbz_95",
|
||||||
"superbwarfare:k_98"
|
"superbwarfare:k_98",
|
||||||
|
"superbwarfare:mosin_nagant"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -24,6 +24,7 @@
|
||||||
"superbwarfare:glock_18",
|
"superbwarfare:glock_18",
|
||||||
"superbwarfare:m_1911",
|
"superbwarfare:m_1911",
|
||||||
"superbwarfare:qbz_95",
|
"superbwarfare:qbz_95",
|
||||||
"superbwarfare:k_98"
|
"superbwarfare:k_98",
|
||||||
|
"superbwarfare:mosin_nagant"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -6,6 +6,7 @@
|
||||||
"superbwarfare:sentinel",
|
"superbwarfare:sentinel",
|
||||||
"superbwarfare:svd",
|
"superbwarfare:svd",
|
||||||
"superbwarfare:m_98b",
|
"superbwarfare:m_98b",
|
||||||
"superbwarfare:k_98"
|
"superbwarfare:k_98",
|
||||||
|
"superbwarfare:mosin_nagant"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -6,6 +6,7 @@
|
||||||
"superbwarfare:sentinel",
|
"superbwarfare:sentinel",
|
||||||
"superbwarfare:svd",
|
"superbwarfare:svd",
|
||||||
"superbwarfare:m_98b",
|
"superbwarfare:m_98b",
|
||||||
"superbwarfare:k_98"
|
"superbwarfare:k_98",
|
||||||
|
"superbwarfare:mosin_nagant"
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue