revolver and ak47 updated, added decal system and shooting impact, and added 3rd and 1st person custom view-s for the revolver and other small changes
This commit is contained in:
@@ -6,7 +6,7 @@ minecraft_version=1.20.1
|
|||||||
yarn_mappings=1.20.1+build.10
|
yarn_mappings=1.20.1+build.10
|
||||||
loader_version=0.18.3
|
loader_version=0.18.3
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=26.3.12.1
|
mod_version=26.3.14
|
||||||
maven_group=dev.tggamesyt
|
maven_group=dev.tggamesyt
|
||||||
archives_base_name=szar
|
archives_base_name=szar
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package dev.tggamesyt.szar.client;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext;
|
||||||
|
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
|
||||||
|
import net.minecraft.client.render.*;
|
||||||
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.math.RotationAxis;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
|
||||||
|
import static dev.tggamesyt.szar.Szar.MOD_ID;
|
||||||
|
|
||||||
|
public class BulletDecalRenderer {
|
||||||
|
|
||||||
|
private static final Identifier DECAL_TEXTURE =
|
||||||
|
new Identifier(MOD_ID, "textures/entity/bullet_impact.png");
|
||||||
|
private static final float SIZE = 0.15F;
|
||||||
|
private static final long FADE_START_MS = BulletDecalStore.FADE_START_MS;
|
||||||
|
private static final long LIFETIME_MS = BulletDecalStore.LIFETIME_MS;
|
||||||
|
|
||||||
|
public static void register() {
|
||||||
|
WorldRenderEvents.AFTER_TRANSLUCENT.register(BulletDecalRenderer::render);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void render(WorldRenderContext ctx) {
|
||||||
|
MatrixStack matrices = ctx.matrixStack();
|
||||||
|
VertexConsumerProvider consumers = ctx.consumers();
|
||||||
|
if (matrices == null || consumers == null) return;
|
||||||
|
|
||||||
|
Vec3d cam = ctx.camera().getPos();
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
|
||||||
|
VertexConsumer consumer = consumers.getBuffer(
|
||||||
|
RenderLayer.getEntityTranslucentCull(DECAL_TEXTURE)
|
||||||
|
);
|
||||||
|
|
||||||
|
for (BulletDecalStore.Decal decal : BulletDecalStore.getDecals()) {
|
||||||
|
long age = now - decal.spawnTime();
|
||||||
|
float alpha = 1.0F;
|
||||||
|
if (age > FADE_START_MS) {
|
||||||
|
alpha = 1.0F - (float)(age - FADE_START_MS) / (LIFETIME_MS - FADE_START_MS);
|
||||||
|
}
|
||||||
|
int a = (int)(alpha * 255);
|
||||||
|
if (a <= 0) continue;
|
||||||
|
|
||||||
|
matrices.push();
|
||||||
|
Direction face = decal.face();
|
||||||
|
matrices.translate(
|
||||||
|
decal.pos().x - cam.x + face.getOffsetX() * 0.002,
|
||||||
|
decal.pos().y - cam.y + face.getOffsetY() * 0.002,
|
||||||
|
decal.pos().z - cam.z + face.getOffsetZ() * 0.002
|
||||||
|
);
|
||||||
|
|
||||||
|
applyFaceRotation(matrices, face);
|
||||||
|
|
||||||
|
Matrix4f mat = matrices.peek().getPositionMatrix();
|
||||||
|
|
||||||
|
consumer.vertex(mat, -SIZE, SIZE, 0).color(255,255,255,a).texture(0,1).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(0,0,1).next();
|
||||||
|
consumer.vertex(mat, SIZE, SIZE, 0).color(255,255,255,a).texture(1,1).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(0,0,1).next();
|
||||||
|
consumer.vertex(mat, SIZE, -SIZE, 0).color(255,255,255,a).texture(1,0).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(0,0,1).next();
|
||||||
|
consumer.vertex(mat, -SIZE, -SIZE, 0).color(255,255,255,a).texture(0,0).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(0,0,1).next();
|
||||||
|
matrices.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void applyFaceRotation(MatrixStack matrices, Direction face) {
|
||||||
|
switch (face) {
|
||||||
|
case NORTH -> {}
|
||||||
|
case SOUTH -> matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
|
||||||
|
case EAST -> matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-90));
|
||||||
|
case WEST -> matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(90));
|
||||||
|
case UP -> matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90));
|
||||||
|
case DOWN -> matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-90));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package dev.tggamesyt.szar.client;
|
||||||
|
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class BulletDecalStore {
|
||||||
|
|
||||||
|
public record Decal(Vec3d pos, Direction face, long spawnTime) {}
|
||||||
|
|
||||||
|
private static final List<Decal> decals = new ArrayList<>();
|
||||||
|
static final long LIFETIME_MS = 30 * 1000;
|
||||||
|
static final long FADE_START_MS = 27 * 1000;
|
||||||
|
|
||||||
|
public static void add(Vec3d pos, Direction face) {
|
||||||
|
decals.add(new Decal(pos, face, System.currentTimeMillis()));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Decal> getDecals() {
|
||||||
|
// Clean up expired decals
|
||||||
|
long now = System.currentTimeMillis();
|
||||||
|
decals.removeIf(d -> now - d.spawnTime() > LIFETIME_MS);
|
||||||
|
return decals;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,23 @@
|
|||||||
package dev.tggamesyt.szar.client;
|
package dev.tggamesyt.szar.client;
|
||||||
|
|
||||||
import dev.tggamesyt.szar.BulletEntity;
|
import dev.tggamesyt.szar.BulletEntity;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.*;
|
||||||
import net.minecraft.client.render.entity.EntityRenderer;
|
import net.minecraft.client.render.entity.EntityRenderer;
|
||||||
import net.minecraft.client.render.entity.EntityRendererFactory;
|
import net.minecraft.client.render.entity.EntityRendererFactory;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.math.RotationAxis;
|
||||||
|
import org.joml.Matrix4f;
|
||||||
|
|
||||||
public class BulletRenderer extends EntityRenderer<BulletEntity> {
|
public class BulletRenderer extends EntityRenderer<BulletEntity> {
|
||||||
|
|
||||||
private static final Identifier TEXTURE =
|
private static final Identifier TEXTURE =
|
||||||
new Identifier("szar", "textures/entity/bullet.png");
|
new Identifier("szar", "textures/entity/bullet.png");
|
||||||
|
|
||||||
|
private static final float LENGTH = 8.0F;
|
||||||
|
private static final float WIDTH = 2.0F;
|
||||||
|
private static final float SCALE = 0.0125F;
|
||||||
|
|
||||||
public BulletRenderer(EntityRendererFactory.Context ctx) {
|
public BulletRenderer(EntityRendererFactory.Context ctx) {
|
||||||
super(ctx);
|
super(ctx);
|
||||||
}
|
}
|
||||||
@@ -25,10 +31,42 @@ public class BulletRenderer extends EntityRenderer<BulletEntity> {
|
|||||||
VertexConsumerProvider vertices,
|
VertexConsumerProvider vertices,
|
||||||
int light
|
int light
|
||||||
) {
|
) {
|
||||||
|
// Only render after 2 ticks or if partial tick is past 0.25
|
||||||
|
if (entity.age < 2 && tickDelta <= 0.25F) return;
|
||||||
|
|
||||||
|
net.minecraft.client.MinecraftClient client = net.minecraft.client.MinecraftClient.getInstance();
|
||||||
|
if (client.player != null) {
|
||||||
|
double dist = client.player.squaredDistanceTo(entity.getX(), entity.getY(), entity.getZ());
|
||||||
|
if (dist < 0.25) return;
|
||||||
|
}
|
||||||
|
|
||||||
matrices.push();
|
matrices.push();
|
||||||
matrices.scale(0.25F, 0.25F, 0.25F);
|
|
||||||
matrices.multiply(this.dispatcher.getRotation());
|
// Orient bullet to face its travel direction
|
||||||
|
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(entity.getYaw() - 90.0F));
|
||||||
|
matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(entity.getPitch()));
|
||||||
|
|
||||||
|
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(45.0F));
|
||||||
|
matrices.scale(SCALE, SCALE, SCALE);
|
||||||
|
|
||||||
|
VertexConsumer consumer = vertices.getBuffer(
|
||||||
|
RenderLayer.getEntityCutoutNoCull(TEXTURE)
|
||||||
|
);
|
||||||
|
|
||||||
|
// Draw 4 crossed quads like the original
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(90.0F));
|
||||||
|
|
||||||
|
Matrix4f mat = matrices.peek().getPositionMatrix();
|
||||||
|
|
||||||
|
consumer.vertex(mat, -LENGTH, -WIDTH, 0).color(255,255,255,255).texture(0.0F, 0.0F).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(0,1,0).next();
|
||||||
|
consumer.vertex(mat, LENGTH, -WIDTH, 0).color(255,255,255,255).texture(1.0F, 0.0F).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(0,1,0).next();
|
||||||
|
consumer.vertex(mat, LENGTH, WIDTH, 0).color(255,255,255,255).texture(1.0F, 1.0F).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(0,1,0).next();
|
||||||
|
consumer.vertex(mat, -LENGTH, WIDTH, 0).color(255,255,255,255).texture(0.0F, 1.0F).overlay(OverlayTexture.DEFAULT_UV).light(light).normal(0,1,0).next();
|
||||||
|
}
|
||||||
|
|
||||||
matrices.pop();
|
matrices.pop();
|
||||||
|
|
||||||
super.render(entity, yaw, tickDelta, matrices, vertices, light);
|
super.render(entity, yaw, tickDelta, matrices, vertices, light);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,4 +74,4 @@ public class BulletRenderer extends EntityRenderer<BulletEntity> {
|
|||||||
public Identifier getTexture(BulletEntity entity) {
|
public Identifier getTexture(BulletEntity entity) {
|
||||||
return TEXTURE;
|
return TEXTURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,11 +11,9 @@ import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
|||||||
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
||||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
|
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
|
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
|
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||||
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
|
|
||||||
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
|
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
|
||||||
import net.fabricmc.fabric.api.object.builder.v1.client.model.FabricModelPredicateProviderRegistry;
|
import net.fabricmc.fabric.api.object.builder.v1.client.model.FabricModelPredicateProviderRegistry;
|
||||||
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
|
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
|
||||||
@@ -23,27 +21,16 @@ import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
|
|||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.screen.ingame.HandledScreens;
|
import net.minecraft.client.gui.screen.ingame.HandledScreens;
|
||||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
|
||||||
import net.minecraft.client.network.OtherClientPlayerEntity;
|
|
||||||
import net.minecraft.client.option.KeyBinding;
|
import net.minecraft.client.option.KeyBinding;
|
||||||
import net.minecraft.client.render.entity.EmptyEntityRenderer;
|
import net.minecraft.client.render.entity.EmptyEntityRenderer;
|
||||||
import net.minecraft.client.render.entity.EntityRenderer;
|
import net.minecraft.client.render.entity.EntityRenderer;
|
||||||
import net.minecraft.client.render.entity.FlyingItemEntityRenderer;
|
import net.minecraft.client.render.entity.FlyingItemEntityRenderer;
|
||||||
import net.minecraft.client.render.entity.PlayerEntityRenderer;
|
|
||||||
import net.minecraft.client.render.entity.animation.Animation;
|
|
||||||
import net.minecraft.client.render.entity.model.EntityModelLayer;
|
import net.minecraft.client.render.entity.model.EntityModelLayer;
|
||||||
import net.minecraft.client.render.item.BuiltinModelItemRenderer;
|
|
||||||
import net.minecraft.client.render.item.ItemRenderer;
|
|
||||||
import net.minecraft.client.sound.EntityTrackingSoundInstance;
|
import net.minecraft.client.sound.EntityTrackingSoundInstance;
|
||||||
import net.minecraft.client.sound.PositionedSoundInstance;
|
|
||||||
import net.minecraft.client.sound.SoundInstance;
|
|
||||||
import net.minecraft.client.sound.SoundManager;
|
|
||||||
import net.minecraft.client.util.InputUtil;
|
import net.minecraft.client.util.InputUtil;
|
||||||
import net.minecraft.client.render.*;
|
import net.minecraft.client.render.*;
|
||||||
import net.minecraft.client.util.ModelIdentifier;
|
import net.minecraft.client.util.ModelIdentifier;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
import net.minecraft.sound.SoundCategory;
|
import net.minecraft.sound.SoundCategory;
|
||||||
@@ -52,11 +39,11 @@ import net.minecraft.text.Text;
|
|||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import net.minecraft.util.math.Box;
|
import net.minecraft.util.math.Box;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.util.math.random.Random;
|
import net.minecraft.util.math.random.Random;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -67,7 +54,6 @@ import java.util.*;
|
|||||||
import static dev.tggamesyt.szar.ServerCosmetics.SYNC_PACKET;
|
import static dev.tggamesyt.szar.ServerCosmetics.SYNC_PACKET;
|
||||||
import static dev.tggamesyt.szar.Szar.*;
|
import static dev.tggamesyt.szar.Szar.*;
|
||||||
import static dev.tggamesyt.szar.client.ClientCosmetics.loadTextureFromURL;
|
import static dev.tggamesyt.szar.client.ClientCosmetics.loadTextureFromURL;
|
||||||
import static dev.tggamesyt.szar.client.UraniumUtils.updateUranium;
|
|
||||||
|
|
||||||
public class SzarClient implements ClientModInitializer {
|
public class SzarClient implements ClientModInitializer {
|
||||||
// add this field to your client init class
|
// add this field to your client init class
|
||||||
@@ -99,14 +85,24 @@ public class SzarClient implements ClientModInitializer {
|
|||||||
int startLength = 596;
|
int startLength = 596;
|
||||||
int loopLength = 541;
|
int loopLength = 541;
|
||||||
int loopStart = startOffset + startLength;
|
int loopStart = startOffset + startLength;
|
||||||
|
|
||||||
public static final KeyBinding SPIN_KEY = KeyBindingHelper.registerKeyBinding(
|
public static final KeyBinding SPIN_KEY = KeyBindingHelper.registerKeyBinding(
|
||||||
new KeyBinding("key.szar.spin", InputUtil.Type.KEYSYM,
|
new KeyBinding("key.szar.spin", InputUtil.Type.KEYSYM,
|
||||||
GLFW.GLFW_KEY_R, "key.categories.szar")
|
GLFW.GLFW_KEY_R, "key.categories.szar")
|
||||||
);
|
);
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
|
BulletDecalRenderer.register();
|
||||||
|
// In ClientModInitializer:
|
||||||
|
ClientPlayNetworking.registerGlobalReceiver(Szar.BULLET_IMPACT, (client, handler, buf, sender) -> {
|
||||||
|
double x = buf.readDouble();
|
||||||
|
double y = buf.readDouble();
|
||||||
|
double z = buf.readDouble();
|
||||||
|
Direction face = buf.readEnumConstant(Direction.class);
|
||||||
|
|
||||||
|
client.execute(() -> {
|
||||||
|
BulletDecalStore.add(new Vec3d(x, y, z), face);
|
||||||
|
});
|
||||||
|
});
|
||||||
// Then in a ClientTickEvents.END_CLIENT_TICK:
|
// Then in a ClientTickEvents.END_CLIENT_TICK:
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||||
if (SPIN_KEY.wasPressed() && client.player != null) {
|
if (SPIN_KEY.wasPressed() && client.player != null) {
|
||||||
@@ -312,7 +308,7 @@ public class SzarClient implements ClientModInitializer {
|
|||||||
);*/
|
);*/
|
||||||
HandledScreens.register(Szar.SLOT_MACHINE_SCREEN_HANDLER_TYPE, SlotMachineScreen::new);
|
HandledScreens.register(Szar.SLOT_MACHINE_SCREEN_HANDLER_TYPE, SlotMachineScreen::new);
|
||||||
HandledScreens.register(Szar.ROULETTE_SCREEN_HANDLER_TYPE, RouletteScreen::new);
|
HandledScreens.register(Szar.ROULETTE_SCREEN_HANDLER_TYPE, RouletteScreen::new);
|
||||||
|
EntityRendererRegistry.register(Szar.BULLET, BulletRenderer::new);
|
||||||
EntityRendererRegistry.register(
|
EntityRendererRegistry.register(
|
||||||
Szar.NiggerEntityType,
|
Szar.NiggerEntityType,
|
||||||
NiggerEntityRenderer::new
|
NiggerEntityRenderer::new
|
||||||
@@ -341,10 +337,10 @@ public class SzarClient implements ClientModInitializer {
|
|||||||
Szar.NaziEntityType,
|
Szar.NaziEntityType,
|
||||||
NaziEntityRenderer::new
|
NaziEntityRenderer::new
|
||||||
);
|
);
|
||||||
EntityRendererRegistry.register(
|
/*EntityRendererRegistry.register(
|
||||||
Szar.BULLET,
|
Szar.BULLET,
|
||||||
ctx -> new FlyingItemEntityRenderer<>(ctx)
|
ctx -> new FlyingItemEntityRenderer<>(ctx)
|
||||||
);
|
);*/
|
||||||
EntityRendererRegistry.register(
|
EntityRendererRegistry.register(
|
||||||
Szar.EpsteinEntityType,
|
Szar.EpsteinEntityType,
|
||||||
EpsteinEntityRenderer::new
|
EpsteinEntityRenderer::new
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
package dev.tggamesyt.szar.client.mixin;
|
package dev.tggamesyt.szar.client.mixin;
|
||||||
|
|
||||||
import dev.tggamesyt.szar.Joint;
|
import dev.tggamesyt.szar.Joint;
|
||||||
|
import dev.tggamesyt.szar.RevolverItem;
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
@@ -16,8 +19,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
@Mixin(BipedEntityModel.class)
|
@Mixin(BipedEntityModel.class)
|
||||||
public abstract class BipedEntityModelMixin<T extends LivingEntity> {
|
public abstract class BipedEntityModelMixin<T extends LivingEntity> {
|
||||||
|
|
||||||
|
@Final
|
||||||
@Shadow public ModelPart rightArm;
|
@Shadow public ModelPart rightArm;
|
||||||
|
@Final
|
||||||
@Shadow public ModelPart leftArm;
|
@Shadow public ModelPart leftArm;
|
||||||
|
@Final
|
||||||
@Shadow public ModelPart head;
|
@Shadow public ModelPart head;
|
||||||
|
|
||||||
@Inject(
|
@Inject(
|
||||||
@@ -31,24 +37,46 @@ public abstract class BipedEntityModelMixin<T extends LivingEntity> {
|
|||||||
)
|
)
|
||||||
private void injectJointPose(T entity, float f, float g, float h, float i, float j, CallbackInfo ci) {
|
private void injectJointPose(T entity, float f, float g, float h, float i, float j, CallbackInfo ci) {
|
||||||
if (!entity.isUsingItem()) return;
|
if (!entity.isUsingItem()) return;
|
||||||
if (!(entity.getActiveItem().getItem() instanceof Joint)) return;
|
|
||||||
|
|
||||||
boolean mainHand = entity.getActiveHand() == Hand.MAIN_HAND;
|
boolean mainHand = entity.getActiveHand() == Hand.MAIN_HAND;
|
||||||
boolean rightHanded = entity.getMainArm() == Arm.RIGHT;
|
boolean rightHanded = entity.getMainArm() == Arm.RIGHT;
|
||||||
boolean useRight = (mainHand && rightHanded) || (!mainHand && !rightHanded);
|
boolean useRight = (mainHand && rightHanded) || (!mainHand && !rightHanded);
|
||||||
|
if (entity.getActiveItem().getItem() instanceof Joint) {
|
||||||
if (useRight) {
|
if (useRight) {
|
||||||
this.rightArm.pitch = MathHelper.clamp(
|
this.rightArm.pitch = MathHelper.clamp(
|
||||||
this.head.pitch - 1.7F - (entity.isInSneakingPose() ? 0.2617994F : 0.0F),
|
this.head.pitch - 1.7F - (entity.isInSneakingPose() ? 0.2617994F : 0.0F),
|
||||||
-2.4F, 3.3F
|
-2.4F, 3.3F
|
||||||
);
|
);
|
||||||
this.rightArm.yaw = this.head.yaw - 0.4F;
|
this.rightArm.yaw = this.head.yaw - 0.4F;
|
||||||
} else {
|
} else {
|
||||||
this.leftArm.pitch = MathHelper.clamp(
|
this.leftArm.pitch = MathHelper.clamp(
|
||||||
this.head.pitch - 1.7F - (entity.isInSneakingPose() ? 0.2617994F : 0.0F),
|
this.head.pitch - 1.7F - (entity.isInSneakingPose() ? 0.2617994F : 0.0F),
|
||||||
-2.4F, 3.3F
|
-2.4F, 3.3F
|
||||||
);
|
);
|
||||||
this.leftArm.yaw = this.head.yaw + 0.4F;
|
this.leftArm.yaw = this.head.yaw + 0.4F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (entity.getActiveItem().getItem() instanceof RevolverItem && entity.isSneaking()) {
|
||||||
|
if (useRight) {
|
||||||
|
float extraOut = MathHelper.clamp(-this.head.yaw, 0F, 1F) * 0.4F;
|
||||||
|
float pitchDrop = MathHelper.clamp(-(this.head.pitch + 1.0F), 0F, 1F) * 0.4F;
|
||||||
|
this.rightArm.pitch = -(float)Math.PI / 2F + pitchDrop;
|
||||||
|
this.rightArm.yaw = this.head.yaw * (this.head.yaw > 0 ? 1.4F : 2.0F) + (float)Math.PI / 2F + extraOut;
|
||||||
|
this.rightArm.roll = 0F;
|
||||||
|
// Reset left arm to idle (undo vanilla two-hand pose)
|
||||||
|
this.leftArm.pitch = 0F;
|
||||||
|
this.leftArm.yaw = 0F;
|
||||||
|
this.leftArm.roll = 0F;
|
||||||
|
} else {
|
||||||
|
float extraOut = MathHelper.clamp(this.head.yaw, 0F, 1F) * 0.4F;
|
||||||
|
float pitchDrop = MathHelper.clamp(-(this.head.pitch + 1.0F), 0F, 1F) * 0.4F;
|
||||||
|
this.leftArm.pitch = -(float)Math.PI / 2F + pitchDrop;
|
||||||
|
this.leftArm.yaw = this.head.yaw * (this.head.yaw < 0 ? 1.4F : 2.0F) - (float)Math.PI / 2F - extraOut;
|
||||||
|
this.leftArm.roll = 0F;
|
||||||
|
// Reset right arm to idle (undo vanilla two-hand pose)
|
||||||
|
this.rightArm.pitch = 0F;
|
||||||
|
this.rightArm.yaw = 0F;
|
||||||
|
this.rightArm.roll = 0F;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package dev.tggamesyt.szar.client.mixin;
|
package dev.tggamesyt.szar.client.mixin;
|
||||||
|
|
||||||
import dev.tggamesyt.szar.Joint;
|
import dev.tggamesyt.szar.Joint;
|
||||||
|
import dev.tggamesyt.szar.RevolverItem;
|
||||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
import net.minecraft.client.render.item.HeldItemRenderer;
|
import net.minecraft.client.render.item.HeldItemRenderer;
|
||||||
@@ -32,37 +33,66 @@ public abstract class HeldItemRendererMixin {
|
|||||||
int light,
|
int light,
|
||||||
CallbackInfo ci
|
CallbackInfo ci
|
||||||
) {
|
) {
|
||||||
if (!(item.getItem() instanceof Joint)) return;
|
if (item.getItem() instanceof Joint) {
|
||||||
// only override position while actively using, otherwise let normal rendering handle equip/unequip
|
// only override position while actively using, otherwise let normal rendering handle equip/unequip
|
||||||
if (!player.isUsingItem() || player.getActiveHand() != hand || player.getItemUseTimeLeft() <= 0) return;
|
if (!player.isUsingItem() || player.getActiveHand() != hand || player.getItemUseTimeLeft() <= 0) return;
|
||||||
|
|
||||||
boolean isMainHand = hand == Hand.MAIN_HAND;
|
boolean isMainHand = hand == Hand.MAIN_HAND;
|
||||||
Arm arm = isMainHand ? player.getMainArm() : player.getMainArm().getOpposite();
|
Arm arm = isMainHand ? player.getMainArm() : player.getMainArm().getOpposite();
|
||||||
boolean isRight = arm == Arm.RIGHT;
|
boolean isRight = arm == Arm.RIGHT;
|
||||||
|
|
||||||
matrices.push();
|
matrices.push();
|
||||||
// rotate 80 degrees toward player (around Y axis, so it faces them)
|
// rotate 80 degrees toward player (around Y axis, so it faces them)
|
||||||
matrices.translate(
|
matrices.translate(
|
||||||
0.0F,
|
0.0F,
|
||||||
-0.15F, // was -0.35F, more negative = higher up
|
-0.15F, // was -0.35F, more negative = higher up
|
||||||
-0.5F
|
-0.5F
|
||||||
);
|
);
|
||||||
|
|
||||||
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(95.0F));
|
matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(95.0F));
|
||||||
matrices.translate(0.0F, equipProgress * -0.6F, 0.0F);
|
matrices.translate(0.0F, equipProgress * -0.6F, 0.0F);
|
||||||
|
|
||||||
HeldItemRenderer self = (HeldItemRenderer)(Object)this;
|
HeldItemRenderer self = (HeldItemRenderer) (Object) this;
|
||||||
self.renderItem(
|
self.renderItem(
|
||||||
player,
|
player,
|
||||||
item,
|
item,
|
||||||
isRight ? ModelTransformationMode.FIRST_PERSON_RIGHT_HAND : ModelTransformationMode.FIRST_PERSON_LEFT_HAND,
|
isRight ? ModelTransformationMode.FIRST_PERSON_RIGHT_HAND : ModelTransformationMode.FIRST_PERSON_LEFT_HAND,
|
||||||
!isRight,
|
!isRight,
|
||||||
matrices,
|
matrices,
|
||||||
vertexConsumers,
|
vertexConsumers,
|
||||||
light
|
light
|
||||||
);
|
);
|
||||||
|
|
||||||
matrices.pop();
|
matrices.pop();
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.getItem() instanceof RevolverItem
|
||||||
|
&& player.isUsingItem()
|
||||||
|
&& player.getActiveHand() == hand) {
|
||||||
|
|
||||||
|
boolean isMainHand = hand == Hand.MAIN_HAND;
|
||||||
|
Arm arm = isMainHand ? player.getMainArm() : player.getMainArm().getOpposite();
|
||||||
|
boolean isRight = arm == Arm.RIGHT;
|
||||||
|
|
||||||
|
matrices.push();
|
||||||
|
|
||||||
|
// Center in middle of screen regardless of hand
|
||||||
|
matrices.translate(
|
||||||
|
isMainHand ? -0.18F : 0.18F,
|
||||||
|
-0.5F,
|
||||||
|
-0.5F
|
||||||
|
);
|
||||||
|
|
||||||
|
matrices.translate(0.0F, equipProgress * -0.6F, 0.0F);
|
||||||
|
|
||||||
|
HeldItemRenderer self = (HeldItemRenderer) (Object) this;
|
||||||
|
self.renderItem(player, item,
|
||||||
|
isRight ? ModelTransformationMode.FIRST_PERSON_RIGHT_HAND : ModelTransformationMode.FIRST_PERSON_LEFT_HAND,
|
||||||
|
!isRight, matrices, vertexConsumers, light);
|
||||||
|
|
||||||
|
matrices.pop();
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,6 @@ public abstract class PlayerEntityRendererMixin {
|
|||||||
private void addVideoFeature(EntityRendererFactory.Context ctx, boolean slim, CallbackInfo ci) {
|
private void addVideoFeature(EntityRendererFactory.Context ctx, boolean slim, CallbackInfo ci) {
|
||||||
|
|
||||||
PlayerEntityRenderer renderer = (PlayerEntityRenderer)(Object)this;
|
PlayerEntityRenderer renderer = (PlayerEntityRenderer)(Object)this;
|
||||||
|
|
||||||
renderer.addFeature(new VideoHeadFeature(renderer));
|
renderer.addFeature(new VideoHeadFeature(renderer));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package dev.tggamesyt.szar.client.mixin;
|
package dev.tggamesyt.szar.client.mixin;
|
||||||
|
|
||||||
import dev.tggamesyt.szar.Joint;
|
import dev.tggamesyt.szar.Joint;
|
||||||
|
import dev.tggamesyt.szar.RevolverItem;
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.render.VertexConsumerProvider;
|
import net.minecraft.client.render.VertexConsumerProvider;
|
||||||
|
import net.minecraft.client.render.entity.feature.HeadFeatureRenderer;
|
||||||
import net.minecraft.client.render.entity.feature.PlayerHeldItemFeatureRenderer;
|
import net.minecraft.client.render.entity.feature.PlayerHeldItemFeatureRenderer;
|
||||||
import net.minecraft.client.render.entity.model.ModelWithHead;
|
import net.minecraft.client.render.entity.model.ModelWithHead;
|
||||||
import net.minecraft.client.render.item.HeldItemRenderer;
|
import net.minecraft.client.render.item.HeldItemRenderer;
|
||||||
@@ -12,6 +14,7 @@ import net.minecraft.entity.LivingEntity;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.Arm;
|
import net.minecraft.util.Arm;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.math.RotationAxis;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
@@ -53,7 +56,7 @@ public abstract class PlayerHeldItemFeatureRendererMixin<T extends net.minecraft
|
|||||||
head.rotate(matrices);
|
head.rotate(matrices);
|
||||||
head.pitch = savedPitch;
|
head.pitch = savedPitch;
|
||||||
|
|
||||||
net.minecraft.client.render.entity.feature.HeadFeatureRenderer.translate(matrices, false);
|
HeadFeatureRenderer.translate(matrices, false);
|
||||||
|
|
||||||
boolean isLeft = arm == Arm.LEFT;
|
boolean isLeft = arm == Arm.LEFT;
|
||||||
|
|
||||||
@@ -65,6 +68,31 @@ public abstract class PlayerHeldItemFeatureRendererMixin<T extends net.minecraft
|
|||||||
|
|
||||||
this.playerHeldItemRenderer.renderItem(entity, stack, ModelTransformationMode.HEAD, false, matrices, vertexConsumers, light);
|
this.playerHeldItemRenderer.renderItem(entity, stack, ModelTransformationMode.HEAD, false, matrices, vertexConsumers, light);
|
||||||
|
|
||||||
|
matrices.pop();
|
||||||
|
ci.cancel();
|
||||||
|
}
|
||||||
|
if (stack.getItem() instanceof RevolverItem
|
||||||
|
&& entity.getActiveItem() == stack
|
||||||
|
&& entity.handSwingTicks == 0 && entity.isSneaking()) {
|
||||||
|
|
||||||
|
matrices.push();
|
||||||
|
|
||||||
|
ModelPart head = (this.getContextModel()).getHead();
|
||||||
|
head.rotate(matrices);
|
||||||
|
|
||||||
|
HeadFeatureRenderer.translate(matrices, false);
|
||||||
|
|
||||||
|
boolean isLeft = arm == Arm.LEFT;
|
||||||
|
|
||||||
|
matrices.translate(
|
||||||
|
isLeft ? -1F : 1F,
|
||||||
|
-0.4F,
|
||||||
|
0F
|
||||||
|
);
|
||||||
|
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(isLeft ? -90 : 90));
|
||||||
|
matrices.scale(0.6F, 0.6F, 0.6F);
|
||||||
|
this.playerHeldItemRenderer.renderItem(entity, stack, ModelTransformationMode.HEAD, false, matrices, vertexConsumers, light);
|
||||||
|
|
||||||
matrices.pop();
|
matrices.pop();
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,10 @@ import net.minecraft.client.texture.NativeImage;
|
|||||||
import net.minecraft.client.texture.NativeImageBackedTexture;
|
import net.minecraft.client.texture.NativeImageBackedTexture;
|
||||||
import net.minecraft.resource.ResourceManager;
|
import net.minecraft.resource.ResourceManager;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.Util;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.Unique;
|
import org.spongepowered.asm.mixin.Unique;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
@@ -23,6 +26,7 @@ import java.util.List;
|
|||||||
|
|
||||||
@Mixin(TitleScreen.class)
|
@Mixin(TitleScreen.class)
|
||||||
public class TitleScreenBackgroundMixin {
|
public class TitleScreenBackgroundMixin {
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
private static final Identifier VANILLA_OVERLAY =
|
private static final Identifier VANILLA_OVERLAY =
|
||||||
new Identifier("textures/gui/title/background/panorama_overlay.png");
|
new Identifier("textures/gui/title/background/panorama_overlay.png");
|
||||||
@@ -37,11 +41,25 @@ public class TitleScreenBackgroundMixin {
|
|||||||
private static int currentFrame = 0;
|
private static int currentFrame = 0;
|
||||||
@Unique
|
@Unique
|
||||||
private static boolean framesLoaded = false;
|
private static boolean framesLoaded = false;
|
||||||
|
|
||||||
// frametime 1 = 1 game tick = 50ms
|
|
||||||
@Unique
|
@Unique
|
||||||
private static final long FRAME_DURATION_MS = 50;
|
private static final long FRAME_DURATION_MS = 50;
|
||||||
|
|
||||||
|
// Shadow the vanilla fade tracker
|
||||||
|
@Shadow
|
||||||
|
private long backgroundFadeStart;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private float getFadeAlpha() {
|
||||||
|
if (backgroundFadeStart == 0L) return 0f;
|
||||||
|
float elapsed = (float)(Util.getMeasuringTimeMs() - backgroundFadeStart) / 1000.0F;
|
||||||
|
return MathHelper.clamp(elapsed - 1.0F, 0.0F, 1.0F); // vanilla fades in over 1s after 1s delay
|
||||||
|
}
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private boolean isFadeComplete() {
|
||||||
|
return getFadeAlpha() >= 1.0F;
|
||||||
|
}
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
private static boolean isAprilFools() {
|
private static boolean isAprilFools() {
|
||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
@@ -88,6 +106,7 @@ public class TitleScreenBackgroundMixin {
|
|||||||
private void onRenderHead(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
private void onRenderHead(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
if (!isAprilFools()) return;
|
if (!isAprilFools()) return;
|
||||||
loadFrames();
|
loadFrames();
|
||||||
|
if (FRAMES.isEmpty()) return; // don't advance if nothing loaded
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
if (now - lastFrameTime >= FRAME_DURATION_MS) {
|
if (now - lastFrameTime >= FRAME_DURATION_MS) {
|
||||||
@@ -108,11 +127,20 @@ public class TitleScreenBackgroundMixin {
|
|||||||
float u, float v,
|
float u, float v,
|
||||||
int regionWidth, int regionHeight,
|
int regionWidth, int regionHeight,
|
||||||
int textureWidth, int textureHeight) {
|
int textureWidth, int textureHeight) {
|
||||||
if (isAprilFools() && VANILLA_OVERLAY.equals(texture) && !FRAMES.isEmpty()) {
|
if (!isAprilFools() || !VANILLA_OVERLAY.equals(texture) || FRAMES.isEmpty()) {
|
||||||
// Each frame is a square texture so region = full texture size
|
|
||||||
context.drawTexture(FRAMES.get(currentFrame), x, y, width, height, 0.0F, 0.0F, 720, 720, 720, 720);
|
|
||||||
} else {
|
|
||||||
context.drawTexture(texture, x, y, width, height, u, v, regionWidth, regionHeight, textureWidth, textureHeight);
|
context.drawTexture(texture, x, y, width, height, u, v, regionWidth, regionHeight, textureWidth, textureHeight);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float alpha = getFadeAlpha();
|
||||||
|
if (alpha <= 0f) return; // fully transparent, skip entirely
|
||||||
|
|
||||||
|
// Apply alpha via RenderSystem before drawing
|
||||||
|
RenderSystem.enableBlend();
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, alpha);
|
||||||
|
int safeFrame = FRAMES.isEmpty() ? 0 : currentFrame % FRAMES.size(); // guard divide-by-zero
|
||||||
|
context.drawTexture(FRAMES.get(safeFrame), x, y, width, height, 0.0F, 0.0F, 720, 720, 720, 720);
|
||||||
|
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); // reset alpha
|
||||||
|
RenderSystem.disableBlend();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,8 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.sound.SoundCategory;
|
||||||
|
import net.minecraft.sound.SoundEvents;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.TypedActionResult;
|
import net.minecraft.util.TypedActionResult;
|
||||||
import net.minecraft.util.UseAction;
|
import net.minecraft.util.UseAction;
|
||||||
@@ -24,7 +26,8 @@ public class AK47Item extends Item {
|
|||||||
|
|
||||||
if (player.getItemCooldownManager().isCoolingDown(this)) return;
|
if (player.getItemCooldownManager().isCoolingDown(this)) return;
|
||||||
if (!consumeAmmo(player)) return;
|
if (!consumeAmmo(player)) return;
|
||||||
|
player.getWorld().playSound(null, player.getBlockPos(),
|
||||||
|
SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.PLAYERS, 0.5f, 1.8f);
|
||||||
BulletEntity bullet = new BulletEntity(world, player);
|
BulletEntity bullet = new BulletEntity(world, player);
|
||||||
bullet.setVelocity(player, player.getPitch(), player.getYaw(), 0f, 4.5f, 1.0f);
|
bullet.setVelocity(player, player.getPitch(), player.getYaw(), 0f, 4.5f, 1.0f);
|
||||||
world.spawnEntity(bullet);
|
world.spawnEntity(bullet);
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
package dev.tggamesyt.szar;
|
package dev.tggamesyt.szar;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
|
||||||
|
import net.fabricmc.fabric.api.networking.v1.PlayerLookup;
|
||||||
|
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityType;
|
import net.minecraft.entity.EntityType;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
import net.minecraft.entity.damage.DamageSource;
|
import net.minecraft.entity.damage.DamageSource;
|
||||||
import net.minecraft.entity.projectile.thrown.ThrownItemEntity;
|
import net.minecraft.entity.projectile.thrown.ThrownItemEntity;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
import net.minecraft.particle.ParticleTypes;
|
||||||
import net.minecraft.registry.RegistryKeys;
|
import net.minecraft.registry.RegistryKeys;
|
||||||
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.util.hit.BlockHitResult;
|
||||||
import net.minecraft.util.hit.EntityHitResult;
|
import net.minecraft.util.hit.EntityHitResult;
|
||||||
|
import net.minecraft.util.math.Direction;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BulletEntity extends ThrownItemEntity {
|
public class BulletEntity extends ThrownItemEntity {
|
||||||
@@ -75,4 +84,31 @@ public class BulletEntity extends ThrownItemEntity {
|
|||||||
|
|
||||||
discard();
|
discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onBlockHit(net.minecraft.util.hit.BlockHitResult hit) {
|
||||||
|
super.onBlockHit(hit);
|
||||||
|
// Use exact hit position + nudge along face normal to sit on surface
|
||||||
|
Vec3d pos = hit.getPos();
|
||||||
|
Direction face = hit.getSide();
|
||||||
|
spawnImpact(pos, face);
|
||||||
|
discard();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void spawnImpact(Vec3d pos, Direction face) {
|
||||||
|
if (!(getWorld() instanceof ServerWorld serverWorld)) return;
|
||||||
|
|
||||||
|
serverWorld.spawnParticles(ParticleTypes.SMOKE,
|
||||||
|
pos.x, pos.y, pos.z, 5, 0.05, 0.05, 0.05, 0.02);
|
||||||
|
|
||||||
|
PacketByteBuf buf = PacketByteBufs.create();
|
||||||
|
buf.writeDouble(pos.x);
|
||||||
|
buf.writeDouble(pos.y);
|
||||||
|
buf.writeDouble(pos.z);
|
||||||
|
buf.writeEnumConstant(face);
|
||||||
|
|
||||||
|
PlayerLookup.tracking(this).forEach(player ->
|
||||||
|
ServerPlayNetworking.send(player, Szar.BULLET_IMPACT, buf)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ import net.minecraft.entity.mob.MobEntity;
|
|||||||
import net.minecraft.entity.mob.PathAwareEntity;
|
import net.minecraft.entity.mob.PathAwareEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
import net.minecraft.util.TypeFilter;
|
import net.minecraft.util.TypeFilter;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Box;
|
import net.minecraft.util.math.Box;
|
||||||
@@ -51,11 +52,11 @@ public class PoliceEntity extends PathAwareEntity {
|
|||||||
|
|
||||||
Box searchBox = new Box(pos).expand(60);
|
Box searchBox = new Box(pos).expand(60);
|
||||||
|
|
||||||
int playerCount = world.getEntitiesByType(
|
List<PlayerEntity> nearbyPlayers = world.getEntitiesByType(
|
||||||
TypeFilter.instanceOf(PlayerEntity.class),
|
TypeFilter.instanceOf(PlayerEntity.class),
|
||||||
searchBox,
|
searchBox,
|
||||||
e -> true
|
e -> true
|
||||||
).size();
|
);
|
||||||
|
|
||||||
int policeCount = world.getEntitiesByType(
|
int policeCount = world.getEntitiesByType(
|
||||||
TypeFilter.instanceOf(PoliceEntity.class),
|
TypeFilter.instanceOf(PoliceEntity.class),
|
||||||
@@ -63,8 +64,22 @@ public class PoliceEntity extends PathAwareEntity {
|
|||||||
e -> true
|
e -> true
|
||||||
).size();
|
).size();
|
||||||
|
|
||||||
int limit = Math.min(playerCount, 10);
|
int limit = Math.min(nearbyPlayers.size(), 10);
|
||||||
return policeCount < limit;
|
if (policeCount >= limit) return false;
|
||||||
|
|
||||||
|
// Check if at least one nearby player is off cooldown
|
||||||
|
ServerPlayerEntity eligiblePlayer = nearbyPlayers.stream()
|
||||||
|
.filter(p -> p instanceof ServerPlayerEntity)
|
||||||
|
.map(p -> (ServerPlayerEntity) p)
|
||||||
|
.filter(PoliceSpawnTimerStore::canSpawnForPlayer)
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
if (eligiblePlayer == null) return false;
|
||||||
|
|
||||||
|
// Record the spawn against that player
|
||||||
|
PoliceSpawnTimerStore.recordSpawn(eligiblePlayer);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
src/main/java/dev/tggamesyt/szar/PoliceSpawnTimerStore.java
Normal file
29
src/main/java/dev/tggamesyt/szar/PoliceSpawnTimerStore.java
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package dev.tggamesyt.szar;
|
||||||
|
|
||||||
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
|
public class PoliceSpawnTimerStore {
|
||||||
|
|
||||||
|
private static final long COOLDOWN_TICKS = 20 * 60 * 10L; // 10 minutes in ticks
|
||||||
|
|
||||||
|
// UUID → last spawn time in world ticks
|
||||||
|
private static final Map<UUID, Long> lastSpawnTime = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
|
public static boolean canSpawnForPlayer(ServerPlayerEntity player) {
|
||||||
|
long now = player.getWorld().getTime();
|
||||||
|
Long last = lastSpawnTime.get(player.getUuid());
|
||||||
|
if (last == null) return true;
|
||||||
|
return (now - last) >= COOLDOWN_TICKS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void recordSpawn(ServerPlayerEntity player) {
|
||||||
|
lastSpawnTime.put(player.getUuid(), player.getWorld().getTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void remove(ServerPlayerEntity player) {
|
||||||
|
lastSpawnTime.remove(player.getUuid());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -145,7 +145,8 @@ public class RouletteBlockEntity extends BlockEntity {
|
|||||||
int total = stack.getCount() * multiplier;
|
int total = stack.getCount() * multiplier;
|
||||||
while (total > 0) {
|
while (total > 0) {
|
||||||
int batchSize = Math.min(total, stack.getMaxCount());
|
int batchSize = Math.min(total, stack.getMaxCount());
|
||||||
ItemStack give = new ItemStack(stack.getItem(), batchSize);
|
ItemStack give = stack.copy();
|
||||||
|
give.setCount(batchSize);
|
||||||
player.getInventory().offerOrDrop(give);
|
player.getInventory().offerOrDrop(give);
|
||||||
total -= batchSize;
|
total -= batchSize;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,22 +133,28 @@ public class SlotMachineBlockEntity extends BlockEntity {
|
|||||||
void finishSpin() {
|
void finishSpin() {
|
||||||
if (getForceWin()) {
|
if (getForceWin()) {
|
||||||
int payout = switch (getwinTier()) {
|
int payout = switch (getwinTier()) {
|
||||||
case 0 -> getcurrentBetAmount() * 2; // fruit 2x
|
case 0 -> getcurrentBetAmount() * 2;
|
||||||
case 1 -> getcurrentBetAmount() * 10; // golden apple small
|
case 1 -> getcurrentBetAmount() * 10;
|
||||||
case 2 -> getcurrentBetAmount() * 30; // jackpot
|
case 2 -> getcurrentBetAmount() * 30;
|
||||||
default -> 0;
|
default -> 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Direction facing = getCachedState().get(SlotMachineBlock.FACING);
|
Direction facing = getCachedState().get(SlotMachineBlock.FACING);
|
||||||
BlockPos drop = getPos().offset(facing);
|
BlockPos drop = getPos().offset(facing);
|
||||||
assert getWorld() != null;
|
assert getWorld() != null;
|
||||||
ItemScatterer.spawn(
|
|
||||||
getWorld(),
|
// Spawn payout stacks, respecting max stack size
|
||||||
drop.getX(),
|
ItemStack template = getcurrentBetStack().copy();
|
||||||
drop.getY(),
|
int remaining = payout;
|
||||||
drop.getZ(),
|
int maxStack = template.getMaxCount();
|
||||||
new ItemStack(getcurrentBetStack().getItem(), payout)
|
|
||||||
);
|
while (remaining > 0) {
|
||||||
|
int count = Math.min(remaining, maxStack);
|
||||||
|
ItemStack stack = template.copy();
|
||||||
|
stack.setCount(count);
|
||||||
|
ItemScatterer.spawn(getWorld(), drop.getX(), drop.getY(), drop.getZ(), stack);
|
||||||
|
remaining -= count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setcurrentBetAmount(0);
|
setcurrentBetAmount(0);
|
||||||
setcurrentBetStack(ItemStack.EMPTY);
|
setcurrentBetStack(ItemStack.EMPTY);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import net.minecraft.block.*;
|
|||||||
import net.minecraft.block.entity.BlockEntity;
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
import net.minecraft.block.entity.BlockEntityType;
|
import net.minecraft.block.entity.BlockEntityType;
|
||||||
import net.minecraft.entity.*;
|
import net.minecraft.entity.*;
|
||||||
|
import net.minecraft.entity.damage.DamageSource;
|
||||||
import net.minecraft.entity.damage.DamageType;
|
import net.minecraft.entity.damage.DamageType;
|
||||||
import net.minecraft.entity.data.DataTracker;
|
import net.minecraft.entity.data.DataTracker;
|
||||||
import net.minecraft.entity.data.TrackedData;
|
import net.minecraft.entity.data.TrackedData;
|
||||||
@@ -93,6 +94,7 @@ public class Szar implements ModInitializer {
|
|||||||
public static final Identifier REVOLVER_SHOOT = new Identifier(MOD_ID, "revolver_shoot");
|
public static final Identifier REVOLVER_SHOOT = new Identifier(MOD_ID, "revolver_shoot");
|
||||||
public static final Identifier REVOLVER_SPIN = new Identifier(MOD_ID, "revolver_spin");
|
public static final Identifier REVOLVER_SPIN = new Identifier(MOD_ID, "revolver_spin");
|
||||||
public static final Identifier REVOLVER_SYNC = new Identifier(MOD_ID, "revolver_sync");
|
public static final Identifier REVOLVER_SYNC = new Identifier(MOD_ID, "revolver_sync");
|
||||||
|
public static final Identifier BULLET_IMPACT = new Identifier(MOD_ID, "bullet_impact");
|
||||||
public static final Identifier REVOLVER_CHAMBER_CHANGE = new Identifier(MOD_ID, "revolver_chamber_change");
|
public static final Identifier REVOLVER_CHAMBER_CHANGE = new Identifier(MOD_ID, "revolver_chamber_change");
|
||||||
public static final SoundEvent BESZIV = Registry.register(
|
public static final SoundEvent BESZIV = Registry.register(
|
||||||
Registries.SOUND_EVENT,
|
Registries.SOUND_EVENT,
|
||||||
@@ -371,6 +373,9 @@ public class Szar implements ModInitializer {
|
|||||||
private final Map<UUID, BlockPos> sleepingPlayers = new HashMap<>();
|
private final Map<UUID, BlockPos> sleepingPlayers = new HashMap<>();
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
|
ServerPlayConnectionEvents.DISCONNECT.register((handler, server) -> {
|
||||||
|
PoliceSpawnTimerStore.remove(handler.player);
|
||||||
|
});
|
||||||
ServerPlayNetworking.registerGlobalReceiver(REVOLVER_CHAMBER_CHANGE, (server, player, handler, buf, responseSender) -> {
|
ServerPlayNetworking.registerGlobalReceiver(REVOLVER_CHAMBER_CHANGE, (server, player, handler, buf, responseSender) -> {
|
||||||
int index = buf.readInt();
|
int index = buf.readInt();
|
||||||
boolean wasLoaded = buf.readBoolean(); // true = unloading, false = loading
|
boolean wasLoaded = buf.readBoolean(); // true = unloading, false = loading
|
||||||
@@ -448,7 +453,11 @@ public class Szar implements ModInitializer {
|
|||||||
SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.PLAYERS, 0.5f, 1.8f);
|
SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.PLAYERS, 0.5f, 1.8f);
|
||||||
|
|
||||||
if (isHeadshot) {
|
if (isHeadshot) {
|
||||||
player.damage(player.getWorld().getDamageSources().genericKill(), Float.MAX_VALUE);
|
RegistryEntry<DamageType> bullet_damage = SERVER.getRegistryManager()
|
||||||
|
.get(RegistryKeys.DAMAGE_TYPE)
|
||||||
|
.getEntry(BULLET_DAMAGE)
|
||||||
|
.orElseThrow(() -> new IllegalStateException("Bullet DamageType not registered!"));
|
||||||
|
player.damage(new DamageSource(bullet_damage, player), Float.MAX_VALUE);
|
||||||
} else {
|
} else {
|
||||||
BulletEntity bullet = new BulletEntity(player.getWorld(), player);
|
BulletEntity bullet = new BulletEntity(player.getWorld(), player);
|
||||||
bullet.setVelocity(player, player.getPitch(), player.getYaw(), 0f, 4.5f, 0.0f);
|
bullet.setVelocity(player, player.getPitch(), player.getYaw(), 0f, 4.5f, 0.0f);
|
||||||
|
|||||||
@@ -125,5 +125,8 @@
|
|||||||
|
|
||||||
"item.szar.revolver": "Revolver",
|
"item.szar.revolver": "Revolver",
|
||||||
"item.szar.revolver_bullet": "Revolver Bullet",
|
"item.szar.revolver_bullet": "Revolver Bullet",
|
||||||
"item.szar.bullet_shell": "Revolver Bullet Shell"
|
"item.szar.bullet_shell": "Revolver Bullet Shell",
|
||||||
|
|
||||||
|
"key.categories.szar": "Szar",
|
||||||
|
"key.szar.spin": "Interact with Revolver"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,89 +1,517 @@
|
|||||||
{
|
{
|
||||||
"format_version": "1.9.0",
|
"format_version": "1.21.11",
|
||||||
"credit": "Made with Blockbench",
|
"credit": "Converted from TechGuns ModelAK",
|
||||||
|
"texture_size": [128, 64],
|
||||||
"textures": {
|
"textures": {
|
||||||
"0": "szar:item/ak47",
|
"0": "szar:item/ak47texture",
|
||||||
"particle": "szar:item/ak47"
|
"particle": "szar:item/ak47texture"
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"from": [7, 0, 7],
|
"name": "Magazine05",
|
||||||
"to": [9, 7, 9],
|
"from": [3.25, 8, 8],
|
||||||
"rotation": {"angle": 22.5, "axis": "x", "origin": [8, 0, 9]},
|
"to": [4.25, 12, 9],
|
||||||
|
"rotation": {"angle": 0, "axis": "x", "origin": [3.25, 12, 8]},
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [4, 4, 6, 11], "texture": "#0"},
|
"north": {"uv": [0.25, 0.5, 0.5, 2.5], "texture": "#0"},
|
||||||
"east": {"uv": [6, 4, 8, 11], "texture": "#0"},
|
"east": {"uv": [0.5, 0.5, 0.75, 2.5], "texture": "#0"},
|
||||||
"south": {"uv": [8, 4, 10, 11], "texture": "#0"},
|
"south": {"uv": [0.75, 0.5, 1, 2.5], "texture": "#0"},
|
||||||
"west": {"uv": [10, 0, 12, 7], "texture": "#0"},
|
"west": {"uv": [0, 0.5, 0.25, 2.5], "texture": "#0"},
|
||||||
"up": {"uv": [12, 15, 10, 13], "texture": "#0"},
|
"up": {"uv": [0.25, 0, 0.5, 0.5], "texture": "#0"},
|
||||||
"down": {"uv": [14, 13, 12, 15], "texture": "#0"}
|
"down": {"uv": [0.5, 0, 0.75, 0.5], "texture": "#0"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [7, 6, 3],
|
"name": "Grip2",
|
||||||
"to": [9, 8, 13],
|
"from": [3, 10.5, 17.5],
|
||||||
"rotation": {"angle": 0, "axis": "y", "origin": [7, 7, 10]},
|
"to": [4.5, 11.5, 18],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [0, 14, 2, 16], "texture": "#0"},
|
"north": {"uv": [0.125, 3, 0.5, 3.5], "texture": "#0"},
|
||||||
"east": {"uv": [0, 0, 10, 2], "texture": "#0"},
|
"east": {"uv": [0.5, 3, 0.625, 3.5], "texture": "#0"},
|
||||||
"south": {"uv": [2, 14, 4, 16], "texture": "#0"},
|
"south": {"uv": [0.625, 3, 1, 3.5], "texture": "#0"},
|
||||||
"west": {"uv": [0, 2, 10, 4], "texture": "#0"},
|
"west": {"uv": [0, 3, 0.125, 3.5], "texture": "#0"},
|
||||||
"up": {"uv": [2, 14, 0, 4], "texture": "#0"},
|
"up": {"uv": [0.125, 2.75, 0.5, 3], "texture": "#0"},
|
||||||
"down": {"uv": [4, 4, 2, 14], "texture": "#0"}
|
"down": {"uv": [0.5, 2.75, 0.875, 3], "texture": "#0"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [7, 4, 13],
|
"name": "MagHolder",
|
||||||
"to": [9, 8, 15],
|
"from": [3, 10, 11.5],
|
||||||
"rotation": {"angle": 0, "axis": "y", "origin": [7, 7, 10]},
|
"to": [4.5, 11.5, 12.5],
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [10, 7, 12, 11], "texture": "#0"},
|
"north": {"uv": [2.5, 4, 2.875, 4.75], "texture": "#0"},
|
||||||
"east": {"uv": [4, 11, 6, 15], "texture": "#0"},
|
"east": {"uv": [2.875, 4, 3.125, 4.75], "texture": "#0"},
|
||||||
"south": {"uv": [6, 11, 8, 15], "texture": "#0"},
|
"south": {"uv": [3.125, 4, 3.5, 4.75], "texture": "#0"},
|
||||||
"west": {"uv": [8, 11, 10, 15], "texture": "#0"},
|
"west": {"uv": [2.25, 4, 2.5, 4.75], "texture": "#0"},
|
||||||
"up": {"uv": [16, 4, 14, 2], "texture": "#0"},
|
"up": {"uv": [2.5, 3.5, 2.875, 4], "texture": "#0"},
|
||||||
"down": {"uv": [16, 4, 14, 6], "texture": "#0"}
|
"down": {"uv": [2.875, 3.5, 3.25, 4], "texture": "#0"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [7, 5, 15],
|
"name": "Trigger02",
|
||||||
"to": [9, 7, 19],
|
"from": [3.5, 10.25, 14.5],
|
||||||
"rotation": {"angle": 22.5, "axis": "x", "origin": [8, 7, 15]},
|
"to": [4, 11.75, 15],
|
||||||
|
"rotation": {"angle": -22.5, "axis": "x", "origin": [3.5, 11.75, 14.5]},
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": {"uv": [14, 6, 16, 8], "texture": "#0"},
|
"north": {"uv": [1.75, 4, 1.875, 4.75], "texture": "#0"},
|
||||||
"east": {"uv": [10, 11, 14, 13], "texture": "#0"},
|
"east": {"uv": [1.875, 4, 2, 4.75], "texture": "#0"},
|
||||||
"south": {"uv": [14, 8, 16, 10], "texture": "#0"},
|
"south": {"uv": [2, 4, 2.125, 4.75], "texture": "#0"},
|
||||||
"west": {"uv": [12, 0, 16, 2], "texture": "#0"},
|
"west": {"uv": [1.625, 4, 1.75, 4.75], "texture": "#0"},
|
||||||
"up": {"uv": [14, 6, 12, 2], "texture": "#0"},
|
"up": {"uv": [1.75, 3.75, 1.875, 4], "texture": "#0"},
|
||||||
"down": {"uv": [14, 6, 12, 10], "texture": "#0"}
|
"down": {"uv": [1.875, 3.75, 2, 4], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Barrel",
|
||||||
|
"from": [3.75, 12.75, -3.5],
|
||||||
|
"to": [5.25, 14.25, -2],
|
||||||
|
"rotation": {"angle": 45, "axis": "z", "origin": [3.75, 14.25, -3.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [5, 7.5, 5.375, 8.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [5.375, 7.5, 5.75, 8.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [5.75, 7.5, 6.125, 8.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [4.625, 7.5, 5, 8.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [5, 6.75, 5.375, 7.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [5.375, 6.75, 5.75, 7.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Receiver06",
|
||||||
|
"from": [3.5, 14.5, 18.25],
|
||||||
|
"to": [4, 15, 18.75],
|
||||||
|
"rotation": {"angle": -45, "axis": "x", "origin": [3.5, 15, 18.25]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [6.125, 0.25, 6.25, 0.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [6.25, 0.25, 6.375, 0.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [6.375, 0.25, 6.5, 0.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [6, 0.25, 6.125, 0.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [6.125, 0, 6.25, 0.25], "texture": "#0"},
|
||||||
|
"down": {"uv": [6.25, 0, 6.375, 0.25], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Trigger01",
|
||||||
|
"from": [3.25, 9.5, 13],
|
||||||
|
"to": [4.25, 10, 16.5],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [3.625, 5, 3.875, 5.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [3.875, 5, 4.75, 5.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [4.75, 5, 5, 5.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [2.75, 5, 3.625, 5.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [3.625, 3.25, 3.875, 5], "texture": "#0"},
|
||||||
|
"down": {"uv": [3.875, 3.25, 4.125, 5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Magazine01",
|
||||||
|
"from": [3.25, 9.5, 12.5],
|
||||||
|
"to": [4.25, 11.5, 13],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [4.375, 3.5, 4.625, 4.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [4.625, 3.5, 4.75, 4.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [4.75, 3.5, 5, 4.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [4.25, 3.5, 4.375, 4.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [4.375, 3.25, 4.625, 3.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [4.625, 3.25, 4.875, 3.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Magazine02",
|
||||||
|
"from": [3, 10, 15],
|
||||||
|
"to": [4.5, 11.5, 17.5],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.625, 5, 1, 5.75], "texture": "#0"},
|
||||||
|
"east": {"uv": [1, 5, 1.625, 5.75], "texture": "#0"},
|
||||||
|
"south": {"uv": [1.625, 5, 2, 5.75], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 5, 0.625, 5.75], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.625, 3.75, 1, 5], "texture": "#0"},
|
||||||
|
"down": {"uv": [1, 3.75, 1.375, 5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Grip1",
|
||||||
|
"from": [3, 6, 15.5],
|
||||||
|
"to": [4.5, 10, 17.5],
|
||||||
|
"rotation": {"angle": 22.5, "axis": "x", "origin": [3, 10, 15.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [3.75, 1, 4.125, 3], "texture": "#0"},
|
||||||
|
"east": {"uv": [4.125, 1, 4.625, 3], "texture": "#0"},
|
||||||
|
"south": {"uv": [4.625, 1, 5, 3], "texture": "#0"},
|
||||||
|
"west": {"uv": [3.25, 1, 3.75, 3], "texture": "#0"},
|
||||||
|
"up": {"uv": [3.75, 0, 4.125, 1], "texture": "#0"},
|
||||||
|
"down": {"uv": [4.125, 0, 4.5, 1], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Magazine06",
|
||||||
|
"from": [3.25, 4.3, 7.5],
|
||||||
|
"to": [4.25, 8.3, 8.5],
|
||||||
|
"rotation": {"angle": -22.5, "axis": "x", "origin": [3.25, 8.3, 7.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.25, 0.5, 0.5, 2.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [0.5, 0.5, 0.75, 2.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [0.75, 0.5, 1, 2.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 0.5, 0.25, 2.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.25, 0, 0.5, 0.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [0.5, 0, 0.75, 0.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Magazine03",
|
||||||
|
"from": [3, 8, 9],
|
||||||
|
"to": [4.5, 12, 11.5],
|
||||||
|
"rotation": {"angle": 0, "axis": "x", "origin": [3, 12, 9]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [1.75, 1.25, 2.125, 3.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [2.125, 1.25, 2.75, 3.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [2.75, 1.25, 3.125, 3.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [1.125, 1.25, 1.75, 3.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [1.75, 0, 2.125, 1.25], "texture": "#0"},
|
||||||
|
"down": {"uv": [2.125, 0, 2.5, 1.25], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Magazine04",
|
||||||
|
"from": [3, 4, 8.5],
|
||||||
|
"to": [4.5, 8.5, 11],
|
||||||
|
"rotation": {"angle": -22.5, "axis": "x", "origin": [3, 8.5, 8.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [1.75, 1.25, 2.125, 3.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [2.125, 1.25, 2.75, 3.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [2.75, 1.25, 3.125, 3.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [1.125, 1.25, 1.75, 3.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [1.75, 0, 2.125, 1.25], "texture": "#0"},
|
||||||
|
"down": {"uv": [2.125, 0, 2.5, 1.25], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Receiver03",
|
||||||
|
"from": [2.75, 14, 2.5],
|
||||||
|
"to": [4.75, 15.5, 6],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [6.875, 1.75, 7.375, 2.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [7.375, 1.75, 8.25, 2.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [8.25, 1.75, 8.75, 2.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [6, 1.75, 6.875, 2.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [6.875, 0, 7.375, 1.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [7.375, 0, 7.875, 1.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Handguard01",
|
||||||
|
"from": [3, 14, -2],
|
||||||
|
"to": [4.5, 15.5, 2.5],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [7.125, 4.75, 7.5, 5.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [7.5, 4.75, 8.625, 5.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [8.625, 4.75, 9, 5.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [6, 4.75, 7.125, 5.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [7.125, 2.5, 7.5, 4.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [7.5, 2.5, 7.875, 4.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Handguard02",
|
||||||
|
"from": [2.75, 11.5, -2],
|
||||||
|
"to": [4.75, 14, 5],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [13.25, 3.5, 13.75, 4.75], "texture": "#0"},
|
||||||
|
"east": {"uv": [13.75, 3.5, 15.5, 4.75], "texture": "#0"},
|
||||||
|
"south": {"uv": [15.5, 3.5, 16, 4.75], "texture": "#0"},
|
||||||
|
"west": {"uv": [11.5, 3.5, 13.25, 4.75], "texture": "#0"},
|
||||||
|
"up": {"uv": [13.25, 0, 13.75, 3.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [13.75, 0, 14.25, 3.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Barrel03",
|
||||||
|
"from": [3.5, 13.0167, -13],
|
||||||
|
"to": [4, 16.0167, -12.5],
|
||||||
|
"rotation": {"angle": 22.5, "axis": "x", "origin": [3.5, 16.0167, -13]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.125, 11.75, 0.25, 13.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [0.25, 11.75, 0.375, 13.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [0.375, 11.75, 0.5, 13.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 11.75, 0.125, 13.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.125, 11.5, 0.25, 11.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [0.25, 11.5, 0.375, 11.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Barrel02",
|
||||||
|
"from": [3.75, 14.5167, -6.5],
|
||||||
|
"to": [4.75, 15.5167, -2],
|
||||||
|
"rotation": {"angle": 45, "axis": "z", "origin": [3.75, 15.5167, -6.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [5.75, 10.75, 6, 11.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [6, 10.75, 7.125, 11.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [7.125, 10.75, 7.375, 11.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [4.625, 10.75, 5.75, 11.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [5.75, 8.5, 6, 10.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [6, 8.5, 6.25, 10.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Receiver02",
|
||||||
|
"from": [2.75, 11.5, 5],
|
||||||
|
"to": [4.75, 14, 19],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [3.5, 14.75, 4, 16], "texture": "#0"},
|
||||||
|
"east": {"uv": [4, 14.75, 7.5, 16], "texture": "#0"},
|
||||||
|
"south": {"uv": [7.5, 14.75, 8, 16], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 14.75, 3.5, 16], "texture": "#0"},
|
||||||
|
"up": {"uv": [3.5, 7.75, 4, 14.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [4, 7.75, 4.5, 14.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stock09",
|
||||||
|
"from": [2.75, 13.5, 19],
|
||||||
|
"to": [4.75, 14, 20],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [9.75, 9.25, 10.25, 9.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [10.25, 9.25, 10.5, 9.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [10.5, 9.25, 11, 9.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [9.5, 9.25, 9.75, 9.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [9.75, 8.75, 10.25, 9.25], "texture": "#0"},
|
||||||
|
"down": {"uv": [10.25, 8.75, 10.75, 9.25], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Barrel04",
|
||||||
|
"from": [3.25, 12.5167, -8],
|
||||||
|
"to": [4.25, 13.5167, -5.5],
|
||||||
|
"rotation": {"angle": 45, "axis": "x", "origin": [3.25, 13.5167, -8]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [2.25, 11.25, 2.5, 11.75], "texture": "#0"},
|
||||||
|
"east": {"uv": [2.5, 11.25, 3.125, 11.75], "texture": "#0"},
|
||||||
|
"south": {"uv": [3.125, 11.25, 3.375, 11.75], "texture": "#0"},
|
||||||
|
"west": {"uv": [1.625, 11.25, 2.25, 11.75], "texture": "#0"},
|
||||||
|
"up": {"uv": [2.25, 10, 2.5, 11.25], "texture": "#0"},
|
||||||
|
"down": {"uv": [2.5, 10, 2.75, 11.25], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BarrelIS",
|
||||||
|
"from": [3.5, 16.0167, -13.5],
|
||||||
|
"to": [4, 16.5167, -12.5],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.25, 8.75, 0.375, 9], "texture": "#0"},
|
||||||
|
"east": {"uv": [0.375, 8.75, 0.625, 9], "texture": "#0"},
|
||||||
|
"south": {"uv": [0.625, 8.75, 0.75, 9], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 8.75, 0.25, 9], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.25, 8.25, 0.375, 8.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [0.375, 8.25, 0.5, 8.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BarrelMain",
|
||||||
|
"from": [3.75, 12.75, -16],
|
||||||
|
"to": [4.75, 13.75, -3.5],
|
||||||
|
"rotation": {"angle": 45, "axis": "z", "origin": [3.75, 13.75, -17]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [12.125, 15.5, 12.375, 16], "texture": "#0"},
|
||||||
|
"east": {"uv": [12.375, 15.5, 15.75, 16], "texture": "#0"},
|
||||||
|
"south": {"uv": [15.75, 15.5, 16, 16], "texture": "#0"},
|
||||||
|
"west": {"uv": [8.75, 15.5, 12.125, 16], "texture": "#0"},
|
||||||
|
"up": {"uv": [12.125, 8.75, 12.375, 15.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [12.375, 8.75, 12.625, 15.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BarrelFront",
|
||||||
|
"from": [3.75, 12.75, -14],
|
||||||
|
"to": [5.25, 14.25, -11],
|
||||||
|
"rotation": {"angle": 45, "axis": "z", "origin": [3.75, 14.25, -14]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.75, 13.5, 1.125, 14.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [1.125, 13.5, 1.875, 14.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [1.875, 13.5, 2.25, 14.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 13.5, 0.75, 14.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.75, 12, 1.125, 13.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [1.125, 12, 1.5, 13.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "BarrelMid",
|
||||||
|
"from": [3.75, 12.75, -8],
|
||||||
|
"to": [5.25, 14.25, -6.5],
|
||||||
|
"rotation": {"angle": 45, "axis": "z", "origin": [3.75, 14.25, -8]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.375, 10.5, 0.75, 11.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [0.75, 10.5, 1.125, 11.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [1.125, 10.5, 1.5, 11.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 10.5, 0.375, 11.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.375, 9.75, 0.75, 10.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [0.75, 9.75, 1.125, 10.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ISTop",
|
||||||
|
"from": [3.5, 15.0167, 3],
|
||||||
|
"to": [4, 15.5167, 6.5],
|
||||||
|
"rotation": {"angle": 0, "axis": "x", "origin": [3.5, 15.5167, 3]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.875, 7.75, 1, 8], "texture": "#0"},
|
||||||
|
"east": {"uv": [1, 7.75, 1.875, 8], "texture": "#0"},
|
||||||
|
"south": {"uv": [1.875, 7.75, 2, 8], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 7.75, 0.875, 8], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.875, 6, 1, 7.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [1, 6, 1.125, 7.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ISFront",
|
||||||
|
"from": [3.5, 13.0167, -13.5],
|
||||||
|
"to": [4, 16.0167, -13],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [0.125, 11.75, 0.25, 13.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [0.25, 11.75, 0.375, 13.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [0.375, 11.75, 0.5, 13.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [0, 11.75, 0.125, 13.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [0.125, 11.5, 0.25, 11.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [0.25, 11.5, 0.375, 11.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Receiver05",
|
||||||
|
"from": [3, 14, 6],
|
||||||
|
"to": [4.5, 15.5, 17.5],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [5.125, 5.75, 5.5, 6.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [5.5, 5.75, 8.375, 6.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [8.375, 5.75, 8.75, 6.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [2.25, 5.75, 5.125, 6.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [5.125, 0, 5.5, 5.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [5.5, 0, 5.875, 5.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Receiver04",
|
||||||
|
"from": [3, 14, 17.5],
|
||||||
|
"to": [4.5, 15.5, 19.5],
|
||||||
|
"rotation": {"angle": -45, "axis": "x", "origin": [3, 15.5, 17.5]},
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [2.125, 9, 2.5, 9.75], "texture": "#0"},
|
||||||
|
"east": {"uv": [2.5, 9, 3, 9.75], "texture": "#0"},
|
||||||
|
"south": {"uv": [3, 9, 3.375, 9.75], "texture": "#0"},
|
||||||
|
"west": {"uv": [1.625, 9, 2.125, 9.75], "texture": "#0"},
|
||||||
|
"up": {"uv": [2.125, 8, 2.5, 9], "texture": "#0"},
|
||||||
|
"down": {"uv": [2.5, 8, 2.875, 9], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stock04",
|
||||||
|
"from": [2.75, 11, 21.5],
|
||||||
|
"to": [4.75, 11.5, 32],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8.375, 14.25, 8.875, 14.5], "texture": "#0"},
|
||||||
|
"east": {"uv": [8.875, 14.25, 11.5, 14.5], "texture": "#0"},
|
||||||
|
"south": {"uv": [11.5, 14.25, 12, 14.5], "texture": "#0"},
|
||||||
|
"west": {"uv": [5.75, 14.25, 8.375, 14.5], "texture": "#0"},
|
||||||
|
"up": {"uv": [8.375, 9, 8.875, 14.25], "texture": "#0"},
|
||||||
|
"down": {"uv": [8.875, 9, 9.375, 14.25], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stock03",
|
||||||
|
"from": [2.75, 11.5, 19],
|
||||||
|
"to": [4.75, 13.5, 32],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [10.5, 6.75, 11, 7.75], "texture": "#0"},
|
||||||
|
"east": {"uv": [11, 6.75, 14.25, 7.75], "texture": "#0"},
|
||||||
|
"south": {"uv": [14.25, 6.75, 14.75, 7.75], "texture": "#0"},
|
||||||
|
"west": {"uv": [7.25, 6.75, 10.5, 7.75], "texture": "#0"},
|
||||||
|
"up": {"uv": [10.5, 0.25, 11, 6.75], "texture": "#0"},
|
||||||
|
"down": {"uv": [11, 0.25, 11.5, 6.75], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stock05",
|
||||||
|
"from": [2.75, 9.5, 28.5],
|
||||||
|
"to": [4.75, 10, 32],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8.375, 12, 8.875, 12.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [8.875, 12, 9.75, 12.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [9.75, 12, 10.25, 12.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [7.5, 12, 8.375, 12.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [8.375, 10.25, 8.875, 12], "texture": "#0"},
|
||||||
|
"down": {"uv": [8.875, 10.25, 9.375, 12], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stock06",
|
||||||
|
"from": [2.75, 13.5, 26],
|
||||||
|
"to": [4.75, 14, 32],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8.375, 11.5, 8.875, 11.75], "texture": "#0"},
|
||||||
|
"east": {"uv": [8.875, 11.5, 10.375, 11.75], "texture": "#0"},
|
||||||
|
"south": {"uv": [10.375, 11.5, 10.875, 11.75], "texture": "#0"},
|
||||||
|
"west": {"uv": [6.875, 11.5, 8.375, 11.75], "texture": "#0"},
|
||||||
|
"up": {"uv": [8.375, 8.5, 8.875, 11.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [8.875, 8.5, 9.375, 11.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stock07",
|
||||||
|
"from": [2.75, 10, 27],
|
||||||
|
"to": [4.75, 10.5, 32],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8.375, 12.5, 8.875, 12.75], "texture": "#0"},
|
||||||
|
"east": {"uv": [8.875, 12.5, 10.125, 12.75], "texture": "#0"},
|
||||||
|
"south": {"uv": [10.125, 12.5, 10.625, 12.75], "texture": "#0"},
|
||||||
|
"west": {"uv": [7.125, 12.5, 8.375, 12.75], "texture": "#0"},
|
||||||
|
"up": {"uv": [8.375, 10, 8.875, 12.5], "texture": "#0"},
|
||||||
|
"down": {"uv": [8.875, 10, 9.375, 12.5], "texture": "#0"}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Stock08",
|
||||||
|
"from": [2.75, 10.5, 24.5],
|
||||||
|
"to": [4.75, 11, 32],
|
||||||
|
"faces": {
|
||||||
|
"north": {"uv": [8.375, 13, 8.875, 13.25], "texture": "#0"},
|
||||||
|
"east": {"uv": [8.875, 13, 10.75, 13.25], "texture": "#0"},
|
||||||
|
"south": {"uv": [10.75, 13, 11.25, 13.25], "texture": "#0"},
|
||||||
|
"west": {"uv": [6.5, 13, 8.375, 13.25], "texture": "#0"},
|
||||||
|
"up": {"uv": [8.375, 9.25, 8.875, 13], "texture": "#0"},
|
||||||
|
"down": {"uv": [8.875, 9.25, 9.375, 13], "texture": "#0"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"display": {
|
"display": {
|
||||||
"thirdperson_righthand": {
|
"thirdperson_righthand": {
|
||||||
"translation": [0, 4, -2.5]
|
"translation": [2, -0.75, -2.25],
|
||||||
|
"scale": [0.5, 0.5, 0.5]
|
||||||
|
},
|
||||||
|
"thirdperson_lefthand": {
|
||||||
|
"translation": [-2, -0.75, -2.25],
|
||||||
|
"scale": [0.5, 0.5, 0.5]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"translation": [0, 5.5, -1.75]
|
"translation": [2.63, 2.7, -0.87],
|
||||||
|
"scale": [0.6, 0.6, 0.6]
|
||||||
},
|
},
|
||||||
"firstperson_lefthand": {
|
"firstperson_lefthand": {
|
||||||
"translation": [0, 5.5, -1.75]
|
"translation": [-2.63, 2.7, -0.87],
|
||||||
|
"scale": [0.6, 0.6, 0.6]
|
||||||
},
|
},
|
||||||
"ground": {
|
"ground": {
|
||||||
"rotation": [66, 180, 0],
|
"translation": [0, 3, 0],
|
||||||
"translation": [0, -4, 4],
|
"scale": [0.5, 0.5, 0.5]
|
||||||
"scale": [0.67, 0.67, 0.67]
|
|
||||||
},
|
},
|
||||||
"gui": {
|
"gui": {
|
||||||
"rotation": [0, 90, 0],
|
"rotation": [30, -135, 0],
|
||||||
"translation": [-2.5, 3, 0]
|
"translation": [-1, -1.75, 0],
|
||||||
|
"scale": [0.4, 0.4, 0.4]
|
||||||
},
|
},
|
||||||
"head": {
|
"head": {
|
||||||
"translation": [0, 9.75, -9.25]
|
"translation": [4.5, 3.25, 0]
|
||||||
},
|
},
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"rotation": [0, -90, 0],
|
"rotation": [90, 45, -90],
|
||||||
"translation": [2.25, 2.75, -0.25]
|
"translation": [-2, -2, -2.25],
|
||||||
|
"scale": [0.6, 0.6, 0.6]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -154,5 +154,13 @@
|
|||||||
"stream": true
|
"stream": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"reload": {
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "szar:reload",
|
||||||
|
"stream": true
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 1.7 KiB |
BIN
src/main/resources/assets/szar/textures/entity/bullet_impact.png
Normal file
BIN
src/main/resources/assets/szar/textures/entity/bullet_impact.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 152 KiB |
BIN
src/main/resources/assets/szar/textures/entity/bullet_old.png
Normal file
BIN
src/main/resources/assets/szar/textures/entity/bullet_old.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 202 B |
Reference in New Issue
Block a user