This commit is contained in:
LZX committed 2026-08-01 22:44:00 +08:00
1 parent 724455c26f
commit 573ce1be16
22 files changed
+609 -3

No files matched your search

@@ -51,6 +51,14 @@ public class ModSounds {
SOUND_EVENTS.register("summon_terraprisma",
() -> SoundEvent.createVariableRangeEvent(
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "summon_terraprisma")));
public static final Supplier<SoundEvent> WHIP_USE =
SOUND_EVENTS.register("whip_use",
() -> SoundEvent.createVariableRangeEvent(
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "whip_use")));
public static final Supplier<SoundEvent> WHIP =
SOUND_EVENTS.register("whip",
() -> SoundEvent.createVariableRangeEvent(
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "whip")));
public static final Supplier<SoundEvent> SHOT =
SOUND_EVENTS.register("shot",
() -> SoundEvent.createVariableRangeEvent(
@@ -1,8 +1,19 @@
package com.lzxnone.terraria.block;
import com.lzxnone.terraria.LzxnoneTerraria;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.neoforged.neoforge.registries.DeferredBlock;
import net.neoforged.neoforge.registries.DeferredRegister;
public class ModBlocks {
public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(LzxnoneTerraria.MODID);
public static final DeferredBlock<Block> VISION = BLOCKS.register("vision", () -> new Block(
BlockBehaviour.Properties.of()
.strength(1.0F)
.noOcclusion()
.sound(SoundType.GLASS)
));
}
@@ -7,6 +7,7 @@ import com.lzxnone.terraria.client.item.melee.ClientMuramasa;
import com.lzxnone.terraria.client.item.melee.ClientZenith;
import com.lzxnone.terraria.client.item.ranged.ClientFlamethrower;
import com.lzxnone.terraria.client.item.ranged.ClientSuperStarShooter;
import com.lzxnone.terraria.client.item.summon.ClientPossession;
import com.lzxnone.terraria.entity.projectile.StaticProjectileBehaviors;
import java.util.HashMap;
@@ -31,6 +32,7 @@ public class ClientStaticProjectileRenderBehaviors {
BEHAVIORS.put(StaticProjectileBehaviors.DEVILS_DEVASTATION_PROJECTILE3, ClientDevilsDevastation.PROJECTILE_BEHAVIOR3);
BEHAVIORS.put(StaticProjectileBehaviors.CRYSTAL_FRAGMENT, DEFAULT_BEHAVIOR);
BEHAVIORS.put(StaticProjectileBehaviors.SUPER_STAR_PRISMATIC_BOLT, ClientSuperStarShooter.PROJECTILE_BEHAVIOR);
BEHAVIORS.put(StaticProjectileBehaviors.POSSESSION_PROJECTILE, ClientPossession.PROJECTILE_BEHAVIOR);
}
public static IStaticProjectileRenderBehavior getBehavior(String id) {
@@ -48,6 +48,7 @@ public class ClientStaticSummonRenderBehaviors {
BEHAVIORS.put(StaticSummonBehaviors.LAST_PRISM_BEAM, ClientLastPrism.SUMMON_BEHAVIOR2);
BEHAVIORS.put(StaticSummonBehaviors.TERRAPRISMA, ClientTerraprisma.SUMMON_BEHAVIOR);
BEHAVIORS.put(StaticSummonBehaviors.POSSESSION, ClientWhip.SUMMON_BEHAVIOR);
BEHAVIORS.put(StaticSummonBehaviors.POSSESSION_VISION, DEFAULT_BEHAVIOR);
BEHAVIORS.put(StaticSummonBehaviors.MUSKET_BALL, ClientBulletAmmo.SUMMON_BEHAVIOR);
BEHAVIORS.put(StaticSummonBehaviors.METEOR_SHOT, ClientBulletAmmo.SUMMON_BEHAVIOR);
@@ -0,0 +1,63 @@
package com.lzxnone.terraria.client.item.summon;
import com.lzxnone.terraria.client.entity.projectile.IStaticProjectileRenderBehavior;
import com.lzxnone.terraria.entity.ModRenderTypes;
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec3;
import org.joml.Matrix4f;
public class ClientPossession {
public static final IStaticProjectileRenderBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileRenderBehavior() {
private static final ResourceLocation RES = ResourceLocation.parse("lzxnoneterraria:textures/vfx/possession_beam.png");
@Override
public void render(Entity entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
if(!(entity instanceof StaticProjectile projectile)) return;
if(projectile.trailPositions.size() < 4) return;
VertexConsumer consumer = bufferSource.getBuffer(ModRenderTypes.entityAdditiveEmissive(RES));
Matrix4f matrix = poseStack.last().pose();
Vec3 origin = projectile.getPosition(partialTick);
int pairCount = projectile.trailPositions.size() / 2;
int quadCount = pairCount - 1;
if(quadCount <= 0) return;
float lifetime = Math.max(1.0F, projectile.getEntityData().get(StaticProjectile.LIFETIME));
float age = projectile.getEntityData().get(StaticProjectile.AGE) + partialTick;
float baseAlpha = Math.max(0.0F, 1.0F - Math.max(0.0F, age - lifetime * 0.75F) / (lifetime * 0.25F));
for(int i = 0; i < quadCount; i++) {
Vec3 headRight = projectile.trailPositions.get(i * 2);
Vec3 headLeft = projectile.trailPositions.get(i * 2 + 1);
Vec3 tailRight = projectile.trailPositions.get((i + 1) * 2);
Vec3 tailLeft = projectile.trailPositions.get((i + 1) * 2 + 1);
float headU = 1.0F - i / (float)quadCount;
float tailU = 1.0F - (i + 1) / (float)quadCount;
for(int k = 0;k < 3;k++) {
addVertex(consumer, matrix, headRight.subtract(origin), headU, 0.0F, 1.0f);
addVertex(consumer, matrix, headLeft.subtract(origin), headU, 1.0F, 1.0f);
addVertex(consumer, matrix, tailLeft.subtract(origin), tailU, 1.0F, 1.0f);
addVertex(consumer, matrix, tailRight.subtract(origin), tailU, 0.0F, 1.0f);
}
}
}
private static void addVertex(VertexConsumer consumer, Matrix4f matrix, Vec3 pos, float u, float v, float alpha) {
consumer.addVertex(matrix, (float)pos.x, (float)pos.y, (float)pos.z)
.setColor(1.0F, 1.0F, 1.0F, alpha)
.setUv(u, v)
.setOverlay(OverlayTexture.NO_OVERLAY)
.setLight(LightTexture.FULL_BRIGHT)
.setNormal(0.0F, 1.0F, 0.0F);
}
};
}
@@ -118,5 +118,6 @@ public class ModCreativeModeTabs {
.displayItems((parameters, output) -> {
output.accept(ModItems.TERRAPRISMA.get());
output.accept(ModItems.POSSESSION.get());
output.accept(ModItems.VISION.get());
}).build());
}
@@ -4,6 +4,7 @@ import com.lzxnone.terraria.item.ammo.CrystalBullet;
import com.lzxnone.terraria.item.weapon.melee.*;
import com.lzxnone.terraria.item.weapon.ranged.Flamethrower;
import com.lzxnone.terraria.item.weapon.ranged.SuperStarShooter;
import com.lzxnone.terraria.item.weapon.summon.whip.Possession;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.EntityHitResult;
@@ -27,6 +28,7 @@ public class StaticProjectileBehaviors {
public static final String DEVILS_DEVASTATION_PROJECTILE3 = "devils_devastation_projectile3";
public static final String CRYSTAL_FRAGMENT = "crystal_fragment";
public static final String SUPER_STAR_PRISMATIC_BOLT = "super_star_prismatic_blot";
public static final String POSSESSION_PROJECTILE = "possession_projectile";
static {
BEHAVIORS.put(DEFAULT, new IStaticProjectileBehavior() {
@@ -56,6 +58,7 @@ public class StaticProjectileBehaviors {
BEHAVIORS.put(DEVILS_DEVASTATION_PROJECTILE3, DevilsDevastation.PROJECTILE_BEHAVIOR3);
BEHAVIORS.put(CRYSTAL_FRAGMENT, CrystalBullet.PROJECTILE_BEHAVIOR);
BEHAVIORS.put(SUPER_STAR_PRISMATIC_BOLT, SuperStarShooter.PROJECTILE_BEHAVIOR);
BEHAVIORS.put(POSSESSION_PROJECTILE, Possession.PROJECTILE_BEHAVIOR);
}
public static IStaticProjectileBehavior getBehavior(String id) {
@@ -9,6 +9,7 @@ import com.lzxnone.terraria.item.weapon.ranged.SnowballCannon;
import com.lzxnone.terraria.item.weapon.ranged.StarCannon;
import com.lzxnone.terraria.item.weapon.ranged.SuperStarShooter;
import com.lzxnone.terraria.item.weapon.summon.Terraprisma;
import com.lzxnone.terraria.item.weapon.summon.whip.Possession;
import com.lzxnone.terraria.item.weapon.summon.whip.Whip;
import java.util.HashMap;
@@ -40,6 +41,7 @@ public class StaticSummonBehaviors {
public static final String LAST_PRISM_BEAM = "last_prism_beam";
public static final String TERRAPRISMA = "terraprisma";
public static final String POSSESSION = "possession";
public static final String POSSESSION_VISION = "possession_vision";
//通用子弹实体
public static final String MUSKET_BALL = "musket_ball";
@@ -88,6 +90,7 @@ public class StaticSummonBehaviors {
BEHAVIORS.put(LAST_PRISM_BEAM, LastPrism.SUMMON_BEHAVIOR2);
BEHAVIORS.put(TERRAPRISMA, Terraprisma.SUMMON_BEHAVIOR);
BEHAVIORS.put(POSSESSION, Whip.SUMMON_BEHAVIOR);
BEHAVIORS.put(POSSESSION_VISION, Possession.SUMMON_BEHAVIOR);
BEHAVIORS.put(MUSKET_BALL, MusketBall.SUMMON_BEHAVIOR);
BEHAVIORS.put(METEOR_SHOT, MeteorShot.SUMMON_BEHAVIOR);
@@ -1,6 +1,7 @@
package com.lzxnone.terraria.item;
import com.lzxnone.terraria.LzxnoneTerraria;
import com.lzxnone.terraria.block.ModBlocks;
import com.lzxnone.terraria.item.ammo.*;
import com.lzxnone.terraria.item.accessory.ManaFlower;
import com.lzxnone.terraria.item.accessory.NaturesGift;
@@ -15,6 +16,7 @@ import com.lzxnone.terraria.item.weapon.ranged.SuperStarShooter;
import com.lzxnone.terraria.item.weapon.ranged.gun.*;
import com.lzxnone.terraria.item.weapon.summon.*;
import com.lzxnone.terraria.item.weapon.summon.whip.Possession;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.neoforged.neoforge.registries.DeferredItem;
import net.neoforged.neoforge.registries.DeferredRegister;
@@ -111,6 +113,9 @@ public class ModItems {
//食物
public static final DeferredItem<Item> MANA_CRYSTAL = ITEMS.register("mana_crystal", ManaCrystal::new);
//方块
public static final DeferredItem<Item> VISION = ITEMS.register("vision", () -> new BlockItem(ModBlocks.VISION.get(), new Item.Properties()));
//弹射物
public static final DeferredItem<Item> BULLET_PROJECTILE = ITEMS.register("bullet_projectile", () -> new Item(new Item.Properties()));
public static final DeferredItem<Item> METEOR_SHOT_PROJECTILE = ITEMS.register("meteor_shot_projectile", () -> new Item(new Item.Properties()));
@@ -1,14 +1,36 @@
package com.lzxnone.terraria.item.weapon.summon.whip;
import com.lzxnone.terraria.block.ModBlocks;
import com.lzxnone.terraria.entity.ModEntities;
import com.lzxnone.terraria.entity.projectile.IStaticProjectileBehavior;
import com.lzxnone.terraria.entity.projectile.StaticProjectile;
import com.lzxnone.terraria.entity.projectile.StaticProjectileBehaviors;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
import com.lzxnone.terraria.entity.summon.StaticSummonBehaviors;
import com.lzxnone.terraria.particle.DustParticleOptions;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.MathUtil;
import com.lzxnone.terraria.utils.ParticleUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.Tiers;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.Vec3;
import org.joml.Vector3f;
import java.util.Locale;
public class Possession extends Whip {
private static final double RANGE = 32.0D;
private static final float DAMAGE = 5.0F;
private static final int ROTATE = 60;
private static final double BEAM_SPEED = 1.5;
private static final double BEAM_HEIGHT = 4.0D;
private static final float BEAM_DAMAGE = 5.0f;
public Possession() {
super(Tiers.NETHERITE, new Item.Properties().stacksTo(1).fireResistant().rarity(Rarity.RARE));
@@ -48,4 +70,114 @@ public class Possession extends Whip {
protected int getInvulnerableTime() {
return 12;
}
public static final DustParticleOptions PARTICLE = new DustParticleOptions(
0.1f, 0.5f, 40, true, new Vector3f[]{
new Vector3f(0.0F, 1.0F, 1.0F),
new Vector3f(0.1F, 0.4F, 1.0F)
}
);
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
this.checkBeforeTick(summon);
int age = summon.getEntityData().get(StaticSummon.AGE);
int lifetime = summon.getEntityData().get(StaticSummon.LIFETIME);
float progress = (float) age / lifetime;
if(progress > 0.5f) {
summon.getEntityData().set(StaticSummon.COLOR_A, Math.max(0, 1.0f - (progress - 0.5f) / 0.5f));
}
if(progress > 0.25f) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
Vec3 move = new Vec3(
customData.contains("moveX") ? customData.getDouble("moveX") : 0,
customData.contains("moveY") ? customData.getDouble("moveY") : 0,
customData.contains("moveZ") ? customData.getDouble("moveZ") : 0
);
summon.setPos(summon.position().add(move.normalize().scale(0.25)));
}
}
};
public static final IStaticProjectileBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileBehavior() {
@Override
public void onMoving(StaticProjectile projectile) {
Vector3f[] dirs = MathUtil.computeCoordinateSystem(projectile.getDeltaMovement().toVector3f(), 0);
Vec3 right = MathUtil.toVec3(dirs[2]);
projectile.trailPositions.addFirst(projectile.position().add(right.scale(0.1)));
projectile.trailPositions.addFirst(projectile.position().add(right.scale(-0.1)));
while(projectile.trailPositions.size() > 10) projectile.trailPositions.removeLast();
}
@Override
public void onHitEntity(StaticProjectile projectile, EntityHitResult result) {
if(!projectile.level().isClientSide()) {
Entity target = result.getEntity();
if(DamageUtil.meleeAttack(projectile, target, projectile.getEntityData().get(StaticProjectile.STACK_SOURCE), BEAM_DAMAGE, 0)) {
target.invulnerableTime = 5;
}
}
}
};
@Override
protected void onHitTarget(StaticSummon summon, Entity target) {
if(summon.level() instanceof ServerLevel serverLevel) {
Vec3 summonPos = MathUtil.getRandomPosOnRadius(summon.position(), 8);
Vector3f[] dirs = MathUtil.computeCoordinateSystem(target.position().subtract(summonPos).toVector3f(), 0);
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
StaticSummon visionSummon = new StaticSummon(ModEntities.STATIC_SUMMON.get(), serverLevel);
visionSummon.setOwner(summon.getOwner());
visionSummon.setPos(summonPos);
visionSummon.getEntityData().set(StaticSummon.BEHAVIOR, StaticSummonBehaviors.POSSESSION_VISION);
visionSummon.getEntityData().set(StaticSummon.RENDER_MODE, "block");
visionSummon.getEntityData().set(StaticSummon.BLOCK, ModBlocks.VISION.get().defaultBlockState());
visionSummon.getEntityData().set(StaticSummon.LIFETIME, 40);
visionSummon.getEntityData().set(StaticSummon.GLOW, true);
visionSummon.setNoGravity(true);
visionSummon.noPhysics = true;
visionSummon.setXRot(xyRot[0]);
visionSummon.setYRot(xyRot[1]);
Vec3 randomPos = MathUtil.getRandomPosInRadius(visionSummon.position(), 1);
Vec3 randomDir = randomPos.subtract(visionSummon.position()).normalize();
CompoundTag customData = new CompoundTag();
customData.putDouble("moveX", randomDir.x);
customData.putDouble("moveY", randomDir.y);
customData.putDouble("moveZ", randomDir.z);
visionSummon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
summon.level().addFreshEntity(visionSummon);
double dist = summonPos.subtract(target.getBoundingBox().getCenter()).length();
int lifetime = Math.max(1, (int)Math.ceil(dist / BEAM_SPEED));
double speed = dist / lifetime;
double height = Math.min(BEAM_HEIGHT, dist * 0.15D);
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), serverLevel);
projectile.setOwner(summon.getOwner());
projectile.setPos(summonPos);
projectile.getEntityData().set(StaticProjectile.STACK_SOURCE, summon.getEntityData().get(StaticSummon.STACK_SOURCE).copy());
projectile.getEntityData().set(StaticProjectile.BEHAVIOR, StaticProjectileBehaviors.POSSESSION_PROJECTILE);
projectile.getEntityData().set(StaticProjectile.RENDER_MODE, "custom");
projectile.getEntityData().set(StaticProjectile.ORIGIN, summonPos.toVector3f());
projectile.getEntityData().set(StaticProjectile.DIRECTION, dirs[0]);
projectile.getEntityData().set(StaticProjectile.UP, dirs[1]);
projectile.getEntityData().set(StaticProjectile.RIGHT, dirs[2]);
projectile.getEntityData().set(StaticProjectile.LIFETIME, lifetime);
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Z, String.format(Locale.ROOT, "%.5f*t", speed));
projectile.getEntityData().set(
StaticProjectile.EXPRESSION_Y,
String.format(Locale.ROOT, "%.5f*4*(t/%.5f)*(1-t/%.5f)", height, (double)lifetime, (double)lifetime)
);
projectile.getEntityData().set(StaticProjectile.GLOW, true);
summon.level().addFreshEntity(projectile);
ParticleUtil.addParticles(
serverLevel, PARTICLE,
target.getBoundingBox().getCenter(), new Vec3(0, 0, 0),
0.1, 5
);
}
}
}
@@ -1,5 +1,6 @@
package com.lzxnone.terraria.item.weapon.summon.whip;
import com.lzxnone.terraria.ModSounds;
import com.lzxnone.terraria.entity.ModEntities;
import com.lzxnone.terraria.entity.summon.IStaticSummonBehavior;
import com.lzxnone.terraria.entity.summon.StaticSummon;
@@ -8,6 +9,7 @@ import com.lzxnone.terraria.item.weapon.SummonWeapon;
import com.lzxnone.terraria.utils.CollisionUtil;
import com.lzxnone.terraria.utils.DamageUtil;
import com.lzxnone.terraria.utils.MathUtil;
import com.lzxnone.terraria.utils.SoundUtil;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
@@ -68,6 +70,10 @@ public abstract class Whip extends SummonWeapon {
return 0;
}
protected void onTick(StaticSummon summon) {}
protected void onHitTarget(StaticSummon summon, Entity target) {}
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
@Override
public void tick(StaticSummon summon) {
@@ -83,9 +89,19 @@ public abstract class Whip extends SummonWeapon {
owner.getY() + dirs[0].y * SUMMON_OFFSET_Z + dirs[1].y * SUMMON_OFFSET_Y + dirs[2].y * SUMMON_OFFSET_X,
owner.getZ() + dirs[0].z * SUMMON_OFFSET_Z + dirs[1].z * SUMMON_OFFSET_Y + dirs[2].z * SUMMON_OFFSET_X
));
Whip whip = getWhip(summon);
if(whip != null) whip.onTick(summon);
hurtTargets(summon);
}
@Override
public void onDied(StaticSummon summon) {
if(!summon.level().isClientSide()) {
SoundUtil.playServerSound(summon.level(), ModSounds.WHIP.get(), summon.position());
summon.discard();
}
}
@Override
public AABB getBoundingBoxForCulling(StaticSummon summon) {
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
@@ -100,7 +116,7 @@ public abstract class Whip extends SummonWeapon {
@Override
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
ItemStack stack = player.getItemInHand(hand);
SoundUtil.playClientSound(player, ModSounds.WHIP_USE.get());
if(!level.isClientSide()) {
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
StaticSummon summon = new StaticSummon(ModEntities.STATIC_SUMMON.get(), level);
@@ -140,7 +156,6 @@ public abstract class Whip extends SummonWeapon {
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
summon.setXRot(xyRot[0]);
summon.setYRot(xyRot[1]);
summon.setDeltaMovement(Vec3.ZERO);
level.addFreshEntity(summon);
}
@@ -152,7 +167,8 @@ public abstract class Whip extends SummonWeapon {
if(summon.level().isClientSide()) return;
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
if(!(sourceStack.getItem() instanceof Whip whip)) return;
Whip whip = getWhip(summon);
if(whip == null) return;
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
int lifetime = Math.max(1, summon.getEntityData().get(StaticSummon.LIFETIME));
@@ -177,10 +193,16 @@ public abstract class Whip extends SummonWeapon {
if(!intersectsWhip(points, target)) continue;
if(DamageUtil.summonAttack(summon, target, sourceStack, whip.getDamage(), whip.getKnockbackScale())) {
target.invulnerableTime = whip.getInvulnerableTime();
whip.onHitTarget(summon, target);
}
}
}
private static Whip getWhip(StaticSummon summon) {
ItemStack sourceStack = summon.getEntityData().get(StaticSummon.STACK_SOURCE);
return sourceStack.getItem() instanceof Whip whip ? whip : null;
}
private static boolean intersectsWhip(List<Vec3> points, Entity target) {
AABB targetBox = target.getBoundingBox().inflate(HITBOX_INFLATE);
for(int i = 0; i < points.size() - 1; i++) {
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "lzxnoneterraria:block/vision"
}
}
}
@@ -35,6 +35,7 @@
"item.lzxnoneterraria.last_prism": "Last Prism",
"item.lzxnoneterraria.terraprisma": "Terraprisma",
"item.lzxnoneterraria.possession": "Possession",
"block.lzxnoneterraria.vision": "Vision",
"item.lzxnoneterraria.musket": "Musket",
"item.lzxnoneterraria.minishark": "Minishark",
"item.lzxnoneterraria.flintlock_pistol": "Flintlock Pistol",
@@ -35,6 +35,7 @@
"item.lzxnoneterraria.last_prism": "终极棱镜",
"item.lzxnoneterraria.terraprisma": "泰拉棱镜",
"item.lzxnoneterraria.possession": "支配之鞭",
"block.lzxnoneterraria.vision": "幻视",
"item.lzxnoneterraria.musket": "火枪",
"item.lzxnoneterraria.minishark": "迷你鲨",
"item.lzxnoneterraria.flintlock_pistol": "燧发枪",
@@ -0,0 +1,172 @@
{
"format_version": "1.21.11",
"credit": "Made with Codex",
"ambientocclusion": false,
"texture_size": [64, 64],
"textures": {
"0": "lzxnoneterraria:block/vision",
"particle": "lzxnoneterraria:block/vision"
},
"elements": [
{
"name": "eye_core",
"from": [3, 3, 3],
"to": [13, 13, 13],
"faces": {
"north": {"uv": [0, 0, 2.5, 2.5], "texture": "#0"},
"east": {"uv": [0, 2.5, 2.5, 5], "texture": "#0"},
"south": {"uv": [2.5, 0, 5, 2.5], "texture": "#0"},
"west": {"uv": [2.5, 2.5, 5, 5], "texture": "#0"},
"up": {"uv": [2.5, 7.5, 0, 5], "texture": "#0"},
"down": {"uv": [7.5, 0, 5, 2.5], "texture": "#0"}
}
},
{
"name": "bottom_rounding",
"from": [5, 13, 5],
"to": [11, 15, 11],
"faces": {
"north": {"uv": [1, 7.5, 2.5, 8], "texture": "#0"},
"east": {"uv": [7.5, 1, 9, 1.5], "texture": "#0"},
"south": {"uv": [7.5, 1.5, 9, 2], "texture": "#0"},
"west": {"uv": [7.5, 2, 9, 2.5], "texture": "#0"},
"up": {"uv": [4, 6.5, 2.5, 5], "texture": "#0"},
"down": {"uv": [6.5, 2.5, 5, 4], "texture": "#0"}
}
},
{
"name": "top_rounding",
"from": [5, 1, 5],
"to": [11, 3, 11],
"faces": {
"north": {"uv": [1, 8, 2.5, 8.5], "texture": "#0"},
"east": {"uv": [2.5, 8, 4, 8.5], "texture": "#0"},
"south": {"uv": [8, 2.5, 9.5, 3], "texture": "#0"},
"west": {"uv": [8, 3, 9.5, 3.5], "texture": "#0"},
"up": {"uv": [5.5, 6.5, 4, 5], "texture": "#0"},
"down": {"uv": [7, 4, 5.5, 5.5], "texture": "#0"}
}
},
{
"name": "left_rounding",
"from": [1, 5, 5],
"to": [3, 11, 11],
"faces": {
"north": {"uv": [4, 8, 4.5, 9.5], "texture": "#0"},
"east": {"uv": [5.5, 5.5, 7, 7], "texture": "#0"},
"south": {"uv": [4.5, 8, 5, 9.5], "texture": "#0"},
"west": {"uv": [2.5, 6.5, 4, 8], "texture": "#0"},
"up": {"uv": [5.5, 9.5, 5, 8], "texture": "#0"},
"down": {"uv": [0.5, 8.5, 0, 10], "texture": "#0"}
}
},
{
"name": "right_rounding",
"from": [13, 5, 5],
"to": [15, 11, 11],
"faces": {
"north": {"uv": [0.5, 8.5, 1, 10], "texture": "#0"},
"east": {"uv": [6.5, 2.5, 8, 4], "texture": "#0"},
"south": {"uv": [1, 8.5, 1.5, 10], "texture": "#0"},
"west": {"uv": [4, 6.5, 5.5, 8], "texture": "#0"},
"up": {"uv": [2, 10, 1.5, 8.5], "texture": "#0"},
"down": {"uv": [2.5, 8.5, 2, 10], "texture": "#0"}
}
},
{
"name": "front_rounding",
"from": [5, 5, 13],
"to": [11, 11, 15],
"faces": {
"north": {"uv": [7, 4, 8.5, 5.5], "texture": "#0"},
"east": {"uv": [2.5, 8.5, 3, 10], "texture": "#0"},
"south": {"uv": [5.5, 7, 7, 8.5], "texture": "#0"},
"west": {"uv": [3, 8.5, 3.5, 10], "texture": "#0"},
"up": {"uv": [9.5, 4, 8, 3.5], "texture": "#0"},
"down": {"uv": [10, 0, 8.5, 0.5], "texture": "#0"}
}
},
{
"name": "back_rounding",
"from": [5, 5, 1],
"to": [11, 11, 3],
"faces": {
"north": {"uv": [7, 5.5, 8.5, 7], "texture": "#0"},
"east": {"uv": [3.5, 8.5, 4, 10], "texture": "#0"},
"south": {"uv": [7, 7, 8.5, 8.5], "texture": "#0"},
"west": {"uv": [8.5, 4, 9, 5.5], "texture": "#0"},
"up": {"uv": [10, 1, 8.5, 0.5], "texture": "#0"},
"down": {"uv": [7, 8.5, 5.5, 9], "texture": "#0"}
}
},
{
"name": "front_pupil",
"from": [6, 6, 15],
"to": [10, 10, 16],
"faces": {
"north": {"uv": [0, 7.5, 1, 8.5], "texture": "#0"},
"east": {"uv": [5, 4, 5.25, 5], "texture": "#0"},
"south": {"uv": [7.5, 0, 8.5, 1], "texture": "#0"},
"west": {"uv": [5.25, 4, 5.5, 5], "texture": "#0"},
"up": {"uv": [9.5, 5.75, 8.5, 5.5], "texture": "#0"},
"down": {"uv": [9.5, 5.75, 8.5, 6], "texture": "#0"}
}
},
{
"name": "pupil_highlight",
"from": [7, 8, 16],
"to": [8, 9, 16.5],
"faces": {
"north": {"uv": [8.5, 6, 8.75, 6.25], "texture": "#0"},
"east": {"uv": [8.5, 6.25, 8.75, 6.5], "texture": "#0"},
"south": {"uv": [8.5, 6.5, 8.75, 6.75], "texture": "#0"},
"west": {"uv": [8.5, 6.75, 8.75, 7], "texture": "#0"},
"up": {"uv": [7.25, 8.75, 7, 8.5], "texture": "#0"},
"down": {"uv": [8.75, 7, 8.5, 7.25], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 0, 0],
"translation": [0, 2.5, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"rotation": [75, 0, 0],
"translation": [0, 2.5, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, 90, -25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.35, 0.35, 0.35]
},
"gui": {
"rotation": [30, -135, 0],
"scale": [0.78, 0.78, 0.78]
},
"fixed": {
"rotation": [0, -180, 0],
"scale": [0.75, 0.75, 0.75]
}
},
"groups": [
{
"name": "group",
"origin": [8, 8, 8],
"scope": 0,
"color": 0,
"children": [0, 1, 2, 3, 4, 5, 6, 7, 8]
}
]
}
@@ -0,0 +1,165 @@
{
"credit": "Made with Codex",
"texture_size": [32, 32],
"ambientocclusion": false,
"textures": {
"body": "minecraft:block/snow",
"pupil": "minecraft:block/cyan_concrete",
"particle": "minecraft:block/snow"
},
"elements": [
{
"name": "eye_core",
"from": [3, 3, 3],
"to": [13, 13, 13],
"faces": {
"north": {"uv": [0, 0, 10, 10], "texture": "#body"},
"east": {"uv": [0, 0, 10, 10], "texture": "#body"},
"south": {"uv": [0, 0, 10, 10], "texture": "#body"},
"west": {"uv": [0, 0, 10, 10], "texture": "#body"},
"up": {"uv": [0, 0, 10, 10], "texture": "#body"},
"down": {"uv": [0, 0, 10, 10], "texture": "#body"}
}
},
{
"name": "top_rounding",
"from": [5, 1, 5],
"to": [11, 3, 11],
"faces": {
"north": {"uv": [0, 0, 6, 2], "texture": "#body"},
"east": {"uv": [0, 0, 6, 2], "texture": "#body"},
"south": {"uv": [0, 0, 6, 2], "texture": "#body"},
"west": {"uv": [0, 0, 6, 2], "texture": "#body"},
"up": {"uv": [0, 0, 6, 6], "texture": "#body"},
"down": {"uv": [0, 0, 6, 6], "texture": "#body"}
}
},
{
"name": "bottom_rounding",
"from": [5, 13, 5],
"to": [11, 15, 11],
"faces": {
"north": {"uv": [0, 0, 6, 2], "texture": "#body"},
"east": {"uv": [0, 0, 6, 2], "texture": "#body"},
"south": {"uv": [0, 0, 6, 2], "texture": "#body"},
"west": {"uv": [0, 0, 6, 2], "texture": "#body"},
"up": {"uv": [0, 0, 6, 6], "texture": "#body"},
"down": {"uv": [0, 0, 6, 6], "texture": "#body"}
}
},
{
"name": "left_rounding",
"from": [1, 5, 5],
"to": [3, 11, 11],
"faces": {
"north": {"uv": [0, 0, 2, 6], "texture": "#body"},
"east": {"uv": [0, 0, 6, 6], "texture": "#body"},
"south": {"uv": [0, 0, 2, 6], "texture": "#body"},
"west": {"uv": [0, 0, 6, 6], "texture": "#body"},
"up": {"uv": [0, 0, 2, 6], "texture": "#body"},
"down": {"uv": [0, 0, 2, 6], "texture": "#body"}
}
},
{
"name": "right_rounding",
"from": [13, 5, 5],
"to": [15, 11, 11],
"faces": {
"north": {"uv": [0, 0, 2, 6], "texture": "#body"},
"east": {"uv": [0, 0, 6, 6], "texture": "#body"},
"south": {"uv": [0, 0, 2, 6], "texture": "#body"},
"west": {"uv": [0, 0, 6, 6], "texture": "#body"},
"up": {"uv": [0, 0, 2, 6], "texture": "#body"},
"down": {"uv": [0, 0, 2, 6], "texture": "#body"}
}
},
{
"name": "front_rounding",
"from": [5, 5, 13],
"to": [11, 11, 15],
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#body"},
"east": {"uv": [0, 0, 2, 6], "texture": "#body"},
"south": {"uv": [0, 0, 6, 6], "texture": "#body"},
"west": {"uv": [0, 0, 2, 6], "texture": "#body"},
"up": {"uv": [0, 0, 6, 2], "texture": "#body"},
"down": {"uv": [0, 0, 6, 2], "texture": "#body"}
}
},
{
"name": "back_rounding",
"from": [5, 5, 1],
"to": [11, 11, 3],
"faces": {
"north": {"uv": [0, 0, 6, 6], "texture": "#body"},
"east": {"uv": [0, 0, 2, 6], "texture": "#body"},
"south": {"uv": [0, 0, 6, 6], "texture": "#body"},
"west": {"uv": [0, 0, 2, 6], "texture": "#body"},
"up": {"uv": [0, 0, 6, 2], "texture": "#body"},
"down": {"uv": [0, 0, 6, 2], "texture": "#body"}
}
},
{
"name": "front_pupil",
"from": [6, 6, 15],
"to": [10, 10, 16],
"faces": {
"north": {"uv": [0, 0, 4, 4], "texture": "#pupil"},
"east": {"uv": [0, 0, 1, 4], "texture": "#pupil"},
"south": {"uv": [0, 0, 4, 4], "texture": "#pupil"},
"west": {"uv": [0, 0, 1, 4], "texture": "#pupil"},
"up": {"uv": [0, 0, 4, 1], "texture": "#pupil"},
"down": {"uv": [0, 0, 4, 1], "texture": "#pupil"}
}
},
{
"name": "pupil_highlight",
"from": [7, 8, 16],
"to": [8, 9, 16.5],
"faces": {
"north": {"uv": [0, 0, 1, 1], "texture": "#body"},
"east": {"uv": [0, 0, 0.5, 1], "texture": "#body"},
"south": {"uv": [0, 0, 1, 1], "texture": "#body"},
"west": {"uv": [0, 0, 0.5, 1], "texture": "#body"},
"up": {"uv": [0, 0, 1, 0.5], "texture": "#body"},
"down": {"uv": [0, 0, 1, 0.5], "texture": "#body"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [75, 0, 0],
"translation": [0, 2.5, 1],
"scale": [0.55, 0.55, 0.55]
},
"thirdperson_lefthand": {
"rotation": [75, 0, 0],
"translation": [0, 2.5, 1],
"scale": [0.55, 0.55, 0.55]
},
"firstperson_righthand": {
"rotation": [0, -90, 25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"firstperson_lefthand": {
"rotation": [0, 90, -25],
"translation": [1.13, 3.2, 1.13],
"scale": [0.68, 0.68, 0.68]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.35, 0.35, 0.35]
},
"gui": {
"rotation": [30, 225, 0],
"translation": [0, 0, 0],
"scale": [0.78, 0.78, 0.78]
},
"fixed": {
"rotation": [0, 180, 0],
"translation": [0, 0, 0],
"scale": [0.75, 0.75, 0.75]
}
}
}
@@ -0,0 +1,3 @@
{
"parent": "lzxnoneterraria:block/vision"
}
@@ -29,6 +29,12 @@
"summon_terraprisma": {
"sounds": ["lzxnoneterraria:summon_terraprisma"]
},
"whip_use": {
"sounds": ["lzxnoneterraria:whip_use"]
},
"whip": {
"sounds": ["lzxnoneterraria:whip"]
},
"shot": {
"sounds": ["lzxnoneterraria:shot"]
},
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB