v1.4.0
This commit is contained in:
1 parent
20158e11fa
commit
5bc92656bb
70 files changed
+1344
-138
No files matched your search
@@ -72,6 +72,12 @@ public class Config {
|
||||
public static final ModConfigSpec.DoubleValue LIGHTS_BANE_SMALL_DAMAGE;
|
||||
public static final ModConfigSpec.DoubleValue LIGHTS_BANE_TARGET_RANGE;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue MACE_PROJECTILE_SPEED;
|
||||
public static final ModConfigSpec.DoubleValue MACE_GRAVITY;
|
||||
public static final ModConfigSpec.DoubleValue MACE_DAMAGE;
|
||||
public static final ModConfigSpec.IntValue MACE_FLY_TIME;
|
||||
public static final ModConfigSpec.DoubleValue MACE_MAX_RANGE;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue MURAMASA_BEAM_DAMAGE;
|
||||
|
||||
public static final ModConfigSpec.DoubleValue TERRAGRIM_HIT_RANGE;
|
||||
@@ -203,6 +209,12 @@ public class Config {
|
||||
public static double lightsBaneSmallDamage;
|
||||
public static double lightsBaneTargetRange;
|
||||
|
||||
public static double maceProjectileSpeed;
|
||||
public static double maceGravity;
|
||||
public static double maceDamage;
|
||||
public static int maceFlyTime;
|
||||
public static double maceMaxRange;
|
||||
|
||||
public static double muramasaBeamDamage;
|
||||
|
||||
public static double terragrimHitRange;
|
||||
@@ -530,6 +542,29 @@ public class Config {
|
||||
|
||||
builder.pop();
|
||||
|
||||
builder.push("mace_settings");
|
||||
|
||||
MACE_PROJECTILE_SPEED = builder
|
||||
.comment("弹射速度")
|
||||
.defineInRange("mace_projectile_speed", 2.0, 0, 10);
|
||||
|
||||
MACE_GRAVITY = builder
|
||||
.comment("弹射重力")
|
||||
.defineInRange("mace_gravity", 0.75, 0, 5);
|
||||
|
||||
MACE_DAMAGE = builder
|
||||
.comment("弹射伤害")
|
||||
.defineInRange("mace_damage", 4.0, 0, 2147483647.0);
|
||||
|
||||
MACE_FLY_TIME = builder
|
||||
.comment("弹射最大飞行时间")
|
||||
.defineInRange("mace_fly_time", 10, 1, 100);
|
||||
|
||||
MACE_MAX_RANGE = builder
|
||||
.comment("弹射最大范围")
|
||||
.defineInRange("mace_max_range", 32.0, 1.0, 512.0);
|
||||
|
||||
builder.pop();
|
||||
|
||||
builder.push("muramasa_settings");
|
||||
|
||||
@@ -868,6 +903,11 @@ public class Config {
|
||||
lightsBaneBigDamage = LIGHTS_BANE_BIG_DAMAGE.get();
|
||||
lightsBaneSmallDamage = LIGHTS_BANE_SMALL_DAMAGE.get();
|
||||
lightsBaneTargetRange = LIGHTS_BANE_TARGET_RANGE.get();
|
||||
maceProjectileSpeed = MACE_PROJECTILE_SPEED.get();
|
||||
maceGravity = MACE_GRAVITY.get();
|
||||
maceDamage = MACE_DAMAGE.get();
|
||||
maceFlyTime = MACE_FLY_TIME.get();
|
||||
maceMaxRange = MACE_MAX_RANGE.get();
|
||||
muramasaBeamDamage = MURAMASA_BEAM_DAMAGE.get();
|
||||
terragrimHitRange = TERRAGRIM_HIT_RANGE.get();
|
||||
terragrimDamage = TERRAGRIM_DAMAGE.get();
|
||||
|
||||
@@ -63,4 +63,8 @@ public class ModSounds {
|
||||
SOUND_EVENTS.register("explosive_trap_explode2",
|
||||
() -> SoundEvent.createVariableRangeEvent(
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "explosive_trap_explode2")));
|
||||
public static final Supplier<SoundEvent> DIG =
|
||||
SOUND_EVENTS.register("dig",
|
||||
() -> SoundEvent.createVariableRangeEvent(
|
||||
ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "dig")));
|
||||
}
|
||||
@@ -40,5 +40,6 @@ public class ModCreativeModeTabs {
|
||||
output.accept(ModItems.VOLCANO.get());
|
||||
output.accept(ModItems.TERRAGRIM.get());
|
||||
output.accept(ModItems.FIRST_FRACTAL.get());
|
||||
output.accept(ModItems.MACE.get());
|
||||
}).build());
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class MEntityLuminance implements EntityLuminance {
|
||||
}
|
||||
}else if(entity instanceof StaticSummon summon) {
|
||||
switch(summon.getEntityData().get(StaticProjectile.BEHAVIOR)) {
|
||||
case StaticSummonBehaviors.THE_HORSEMANS_BLADE_JACK, StaticSummonBehaviors.INFLUX_WAVER_BEAM, StaticSummonBehaviors.MEOWMERE_PROJECTILE, StaticSummonBehaviors.TERRA_BLADE_BEAM, StaticSummonBehaviors.TRUE_NIGHTS_EDGE_BEAM, StaticSummonBehaviors.NIGHTS_EDGE_BEAM, StaticSummonBehaviors.LIGHTS_BANE_SLASH, StaticSummonBehaviors.TERRAGRIM_BEAM, StaticSummonBehaviors.FIRST_FRACTAL_PROJECTILE -> {
|
||||
case StaticSummonBehaviors.THE_HORSEMANS_BLADE_JACK, StaticSummonBehaviors.INFLUX_WAVER_BEAM, StaticSummonBehaviors.MEOWMERE_PROJECTILE, StaticSummonBehaviors.TERRA_BLADE_BEAM, StaticSummonBehaviors.TRUE_NIGHTS_EDGE_BEAM, StaticSummonBehaviors.NIGHTS_EDGE_BEAM, StaticSummonBehaviors.LIGHTS_BANE_SLASH, StaticSummonBehaviors.VOLCANO_LIGHT, StaticSummonBehaviors.TERRAGRIM_BEAM, StaticSummonBehaviors.FIRST_FRACTAL_PROJECTILE -> {
|
||||
return 15;
|
||||
}
|
||||
default -> {
|
||||
|
||||
@@ -64,6 +64,7 @@ public class EffectLogicHandler {
|
||||
}
|
||||
|
||||
public static boolean checkEffect(Holder<MobEffect> effect) {
|
||||
if(effect == null) return false;
|
||||
return
|
||||
effect == ModEffects.CONFUSED ||
|
||||
effect == ModEffects.BLOOD_BUTCHERED;
|
||||
|
||||
@@ -18,6 +18,7 @@ public class StaticProjectileBehaviors {
|
||||
public static final String ZENITH_PROJECTILE = "zenith_projectile";
|
||||
public static final String MURAMASA_PROJECTILE = "muramasa_projectile";
|
||||
public static final String LEAF_PROJECTILE = "leaf_projectile";
|
||||
public static final String MACE_PROJECTILE = "mace_projectile";
|
||||
|
||||
static {
|
||||
BEHAVIORS.put(DEFAULT, new IStaticProjectileBehavior() {
|
||||
@@ -41,6 +42,7 @@ public class StaticProjectileBehaviors {
|
||||
BEHAVIORS.put(ZENITH_PROJECTILE, Zenith.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(MURAMASA_PROJECTILE, Muramasa.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(LEAF_PROJECTILE, BladeOfGrass.PROJECTILE_BEHAVIOR);
|
||||
BEHAVIORS.put(MACE_PROJECTILE, Mace.PROJECTILE_BEHAVIOR);
|
||||
}
|
||||
|
||||
public static IStaticProjectileBehavior getBehavior(String id) {
|
||||
|
||||
@@ -17,6 +17,8 @@ import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface IStaticSummonBehavior {
|
||||
@@ -130,4 +132,8 @@ public interface IStaticSummonBehavior {
|
||||
default void onDied(StaticSummon summon) {
|
||||
if(!summon.level().isClientSide()) summon.discard();
|
||||
}
|
||||
|
||||
default AABB getBoundingBoxForCulling(StaticSummon summon) {
|
||||
return summon.getBoundingBox();
|
||||
}
|
||||
}
|
||||
@@ -9,13 +9,14 @@ import net.minecraft.network.syncher.SynchedEntityData;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.MoverType;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.AABB;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -199,4 +200,9 @@ public class StaticSummon extends Entity {
|
||||
if(tag.contains("customData")) this.entityData.set(CUSTOM_DATA, tag.getCompound("customData"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull AABB getBoundingBoxForCulling() {
|
||||
return StaticSummonBehaviors.getBehavior(this.entityData.get(BEHAVIOR)).getBoundingBoxForCulling(this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,8 +17,10 @@ public class StaticSummonBehaviors {
|
||||
public static final String TRUE_NIGHTS_EDGE_BEAM = "true_nights_edge_beam";
|
||||
public static final String NIGHTS_EDGE_BEAM = "nights_edge_beam";
|
||||
public static final String LIGHTS_BANE_SLASH = "lights_bane_slash";
|
||||
public static final String VOLCANO_LIGHT = "volcano_light";
|
||||
public static final String TERRAGRIM_BEAM = "terragrim_beam";
|
||||
public static final String FIRST_FRACTAL_PROJECTILE = "first_fractal_projectile";
|
||||
public static final String MACE_PROJECTILE = "mace_projectile";
|
||||
|
||||
static {
|
||||
BEHAVIORS.put(DEFAULT, new IStaticSummonBehavior() {});
|
||||
@@ -30,8 +32,10 @@ public class StaticSummonBehaviors {
|
||||
BEHAVIORS.put(TRUE_NIGHTS_EDGE_BEAM, TrueNightsEdge.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(NIGHTS_EDGE_BEAM, NightsEdge.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(LIGHTS_BANE_SLASH, LightsBane.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(VOLCANO_LIGHT, Volcano.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(TERRAGRIM_BEAM, Terragrim.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(FIRST_FRACTAL_PROJECTILE, FirstFractal.SUMMON_BEHAVIOR);
|
||||
BEHAVIORS.put(MACE_PROJECTILE, Mace.SUMMON_BEHAVIOR);
|
||||
}
|
||||
|
||||
public static IStaticSummonBehavior getBehavior(String id) {
|
||||
|
||||
@@ -91,7 +91,7 @@ public class InputHandler {
|
||||
@SubscribeEvent
|
||||
public static void onMovementInputUpdate(MovementInputUpdateEvent event) {
|
||||
Player player = event.getEntity();
|
||||
if(player.isUsingItem() && player.getUseItem().is(ModItems.TERRAGRIM.get())) {
|
||||
if(player.isUsingItem() && (player.getUseItem().is(ModItems.TERRAGRIM.get()) || player.getUseItem().is(ModItems.MACE.get()))) {
|
||||
Input input = event.getInput();
|
||||
input.forwardImpulse *= 5.0F;
|
||||
input.leftImpulse *= 5.0F;
|
||||
|
||||
@@ -34,6 +34,7 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> TRUE_EXCALIBUR = ITEMS.register("true_excalibur", TrueExcalibur::new);
|
||||
public static final DeferredItem<Item> TRUE_COPPER_SHORTSWORD = ITEMS.register("true_copper_shortsword", TrueCopperShortsword::new);
|
||||
public static final DeferredItem<Item> FIRST_FRACTAL = ITEMS.register("first_fractal", FirstFractal::new);
|
||||
public static final DeferredItem<Item> MACE = ITEMS.register("mace", Mace::new);
|
||||
|
||||
//弹射物
|
||||
public static final DeferredItem<Item> ENCHANTED_SWORD_BEAM = ITEMS.register("enchanted_sword_beam", EnchantedSwordBeam::new);
|
||||
@@ -59,4 +60,5 @@ public class ModItems {
|
||||
public static final DeferredItem<Item> FIRST_FRACTAL_PROJECTILE12 = ITEMS.register("first_fractal_projectile12", FirstFractalProjectile12::new);
|
||||
public static final DeferredItem<Item> FIRST_FRACTAL_PROJECTILE13 = ITEMS.register("first_fractal_projectile13", FirstFractalProjectile13::new);
|
||||
public static final DeferredItem<Item> FIRST_FRACTAL_PROJECTILE14 = ITEMS.register("first_fractal_projectile14", FirstFractalProjectile14::new);
|
||||
public static final DeferredItem<Item> MACE_PROJECTILE = ITEMS.register("mace_projectile", MaceProjectile::new);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.lzxnone.terraria.item.projectile;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class MaceProjectile extends Item {
|
||||
public MaceProjectile() {
|
||||
super(new Item.Properties());
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,7 @@ import net.minecraft.world.entity.EquipmentSlotGroup;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.EntityHitResult;
|
||||
@@ -48,7 +45,7 @@ public class Excalibur extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -1.0, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.UNCOMMON));
|
||||
}
|
||||
|
||||
public static final CompoundTag BEAM_DATA = Util.make(new CompoundTag(), tag -> {
|
||||
|
||||
@@ -54,7 +54,7 @@ public class FirstFractal extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).fireResistant().rarity(Rarity.EPIC));
|
||||
}
|
||||
|
||||
private static ItemStack[] weapons;
|
||||
@@ -109,12 +109,14 @@ public class FirstFractal extends SwordItem {
|
||||
|
||||
boolean isSlim = playerSkin.model() == PlayerSkin.Model.SLIM;
|
||||
PlayerModel<LivingEntity> activeModel = isSlim ? StaticSummonRenderer.getSlimModel() : StaticSummonRenderer.getWideModel();
|
||||
activeModel.head.resetPose();
|
||||
activeModel.body.resetPose();
|
||||
activeModel.rightArm.resetPose();
|
||||
activeModel.leftArm.resetPose();
|
||||
activeModel.rightLeg.resetPose();
|
||||
activeModel.leftLeg.resetPose();
|
||||
activeModel.rightSleeve.resetPose();
|
||||
activeModel.leftSleeve.resetPose();
|
||||
activeModel.rightPants.resetPose();
|
||||
activeModel.leftPants.resetPose();
|
||||
activeModel.young = false;
|
||||
|
||||
//确定模型方向
|
||||
@@ -125,6 +127,13 @@ public class FirstFractal extends SwordItem {
|
||||
activeModel.rightLeg.xRot = (float) Math.toRadians(-30);
|
||||
activeModel.leftLeg.xRot = (float) Math.toRadians(30);
|
||||
|
||||
activeModel.rightSleeve.xRot = activeModel.rightArm.xRot;
|
||||
activeModel.rightSleeve.yRot = activeModel.rightArm.yRot;
|
||||
activeModel.leftSleeve.xRot = activeModel.leftArm.xRot;
|
||||
activeModel.leftSleeve.yRot = activeModel.leftArm.yRot;
|
||||
activeModel.rightPants.xRot = activeModel.rightLeg.xRot;
|
||||
activeModel.leftPants.xRot = activeModel.leftLeg.xRot;
|
||||
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(summon.getLookAngle().toVector3f(), 0);
|
||||
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
|
||||
|
||||
@@ -264,6 +273,16 @@ public class FirstFractal extends SwordItem {
|
||||
activeModel.renderToBuffer(poseStack, modelConsumer, LightTexture.FULL_BRIGHT, OverlayTexture.NO_OVERLAY, packedColor);
|
||||
poseStack.popPose();
|
||||
|
||||
//恢复模型
|
||||
activeModel.rightArm.resetPose();
|
||||
activeModel.leftArm.resetPose();
|
||||
activeModel.rightLeg.resetPose();
|
||||
activeModel.leftLeg.resetPose();
|
||||
activeModel.rightSleeve.resetPose();
|
||||
activeModel.leftSleeve.resetPose();
|
||||
activeModel.rightPants.resetPose();
|
||||
activeModel.leftPants.resetPose();
|
||||
activeModel.young = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -28,10 +28,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.entity.monster.Monster;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -54,7 +51,7 @@ public class InfluxWaver extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final float FADE_OUT = 0.1f;
|
||||
|
||||
@@ -0,0 +1,591 @@
|
||||
package com.lzxnone.terraria.item.weapon.melee;
|
||||
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
import com.lzxnone.terraria.ModSounds;
|
||||
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.item.ModItems;
|
||||
import com.lzxnone.terraria.utils.*;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.mojang.math.Axis;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.core.particles.BlockParticleOption;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResultHolder;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EquipmentSlotGroup;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.*;
|
||||
import org.joml.Vector3f;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Mace extends SwordItem {
|
||||
public Mace() {
|
||||
super(Tiers.IRON, new Item.Properties().attributes(ItemAttributeModifiers.builder()
|
||||
.add(Attributes.ATTACK_DAMAGE,
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_damage"), 3, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.add(Attributes.ATTACK_SPEED,
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
}
|
||||
|
||||
public enum State {
|
||||
IDLE,
|
||||
USING,
|
||||
THROWING,
|
||||
THROWING_BACK,
|
||||
DROPPING
|
||||
}
|
||||
|
||||
public static final ResourceLocation RES = ResourceLocation.parse("lzxnoneterraria:textures/vfx/mace_chain.png");
|
||||
public static final float CHAIN_LENGTH = 0.25f;
|
||||
|
||||
public static final double DIRECTION_OFFSET = 0.6;
|
||||
public static final double UP_OFFSET = -0.3;
|
||||
public static final double RIGHT_OFFSET = -0.3;
|
||||
|
||||
public static final IStaticProjectileBehavior PROJECTILE_BEHAVIOR = new IStaticProjectileBehavior() {
|
||||
@Override
|
||||
public void render(Entity entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
|
||||
if(!(entity instanceof StaticProjectile projectile)) return;
|
||||
if(projectile.getOwner() == null) return;
|
||||
ItemStack itemStack = projectile.getEntityData().get(StaticProjectile.ITEM);
|
||||
if(itemStack == ItemStack.EMPTY) return;
|
||||
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(projectile.getOwner());
|
||||
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
//旋转(方向修正)
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(-xyRot[1]));
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(xyRot[0]));
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().renderStatic(
|
||||
itemStack,
|
||||
ItemDisplayContext.NONE,
|
||||
packedLight,
|
||||
OverlayTexture.NO_OVERLAY,
|
||||
poseStack,
|
||||
bufferSource,
|
||||
entity.level(),
|
||||
0
|
||||
);
|
||||
poseStack.popPose();
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
//旋转(方向修正)
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(-xyRot[1]));
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(xyRot[0] + 90));
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().renderStatic(
|
||||
itemStack,
|
||||
ItemDisplayContext.NONE,
|
||||
packedLight,
|
||||
OverlayTexture.NO_OVERLAY,
|
||||
poseStack,
|
||||
bufferSource,
|
||||
entity.level(),
|
||||
0
|
||||
);
|
||||
poseStack.popPose();
|
||||
|
||||
if(projectile.getOwner() == null) return;
|
||||
Vec3 eyePos = projectile.getOwner().getEyePosition();
|
||||
Vec3 start = eyePos.add(new Vec3(
|
||||
dirs[0].x * DIRECTION_OFFSET + dirs[1].x * UP_OFFSET + dirs[2].x * RIGHT_OFFSET,
|
||||
dirs[0].y * DIRECTION_OFFSET + dirs[1].y * UP_OFFSET + dirs[2].y * RIGHT_OFFSET,
|
||||
dirs[0].z * DIRECTION_OFFSET + dirs[1].z * UP_OFFSET + dirs[2].z * RIGHT_OFFSET
|
||||
));
|
||||
Vec3 end = projectile.getPosition(partialTick);
|
||||
double dist = end.subtract(start).length();
|
||||
Vector3f[] dirs2 = MathUtil.computeCoordinateSystem(end.subtract(start).toVector3f(), 0);
|
||||
Vec3 dir = MathUtil.toVec3(dirs2[0]);
|
||||
Vec3 right = MathUtil.toVec3(dirs2[2]);
|
||||
Vec3 up = MathUtil.toVec3(dirs2[1]);
|
||||
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityCutoutNoCull(RES));
|
||||
|
||||
int count = (int) (dist / CHAIN_LENGTH);
|
||||
for(int j = 0;j < 2;j++) {
|
||||
for(int i = 0; i < count; i++) {
|
||||
Vec3 current = start.add(new Vec3(
|
||||
dir.x * i * CHAIN_LENGTH,
|
||||
dir.y * i * CHAIN_LENGTH,
|
||||
dir.z * i * CHAIN_LENGTH
|
||||
)).subtract(projectile.getPosition(partialTick));
|
||||
|
||||
Vec3 next = start.add(new Vec3(
|
||||
dir.x * (i + 1) * CHAIN_LENGTH,
|
||||
dir.y * (i + 1) * CHAIN_LENGTH,
|
||||
dir.z * (i + 1) * CHAIN_LENGTH
|
||||
)).subtract(projectile.getPosition(partialTick));
|
||||
|
||||
Vec3 p1, p2, p3, p4;
|
||||
if(j == 0) {
|
||||
p1 = current.add(right.scale(0.125));
|
||||
p2 = current.add(right.scale(-0.125));
|
||||
p3 = next.add(right.scale(-0.125));
|
||||
p4 = next.add(right.scale(0.125));
|
||||
}else {
|
||||
p1 = current.add(up.scale(0.125));
|
||||
p2 = current.add(up.scale(-0.125));
|
||||
p3 = next.add(up.scale(-0.125));
|
||||
p4 = next.add(up.scale(0.125));
|
||||
}
|
||||
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p1.x, (float) p1.y, (float) p1.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(0.0f, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p2.x, (float) p2.y, (float) p2.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(0.0f, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p3.x, (float) p3.y, (float) p3.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(1.0f, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p4.x, (float) p4.y, (float) p4.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(1.0f, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMoving(StaticProjectile projectile) {
|
||||
Entity entity = projectile.getOwner();
|
||||
if(!(entity instanceof Player player)) return;
|
||||
ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND);
|
||||
if(!stack.is(ModItems.MACE.get())) {
|
||||
onDied(projectile);
|
||||
return;
|
||||
}
|
||||
|
||||
projectile.setBoundingBox(new AABB(
|
||||
projectile.getX() - 0.5f, projectile.getY() - 0.5f, projectile.getZ() - 0.5f,
|
||||
projectile.getX() + 0.5f, projectile.getY() + 0.5f, projectile.getZ() + 0.5f
|
||||
));
|
||||
|
||||
int state = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY)
|
||||
.copyTag().getInt("state");
|
||||
if(state == State.USING.ordinal()) {
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
Vec3 eyePos = player.getEyePosition();
|
||||
Vec3 pos = eyePos.add(new Vec3(
|
||||
dirs[0].x * DIRECTION_OFFSET + dirs[1].x * UP_OFFSET + dirs[2].x * RIGHT_OFFSET,
|
||||
dirs[0].y * DIRECTION_OFFSET + dirs[1].y * UP_OFFSET + dirs[2].y * RIGHT_OFFSET,
|
||||
dirs[0].z * DIRECTION_OFFSET + dirs[1].z * UP_OFFSET + dirs[2].z * RIGHT_OFFSET
|
||||
));
|
||||
projectile.getEntityData().set(StaticProjectile.ORIGIN, pos.toVector3f());
|
||||
projectile.getEntityData().set(StaticProjectile.DIRECTION, dirs[0]);
|
||||
projectile.getEntityData().set(StaticProjectile.UP, dirs[1]);
|
||||
projectile.getEntityData().set(StaticProjectile.RIGHT, dirs[2]);
|
||||
|
||||
if(!projectile.level().isClientSide()) {
|
||||
List<Entity> targets = projectile.level().getEntitiesOfClass(
|
||||
Entity.class,
|
||||
projectile.getBoundingBox(),
|
||||
FilterUtil.createTargetFilter(projectile, player)
|
||||
);
|
||||
for(Entity target : targets) {
|
||||
if(DamageUtil.attack(player, target, (float) Config.maceDamage)) {
|
||||
target.invulnerableTime = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
onDied(projectile);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDied(StaticProjectile projectile) {
|
||||
Entity entity = projectile.getOwner();
|
||||
if(!(entity instanceof Player player)) {
|
||||
if(!projectile.level().isClientSide()) projectile.discard();
|
||||
return;
|
||||
}
|
||||
if(!projectile.level().isClientSide()) projectile.discard();
|
||||
}
|
||||
};
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
@Override
|
||||
public void render(Entity entity, float entityYaw, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight) {
|
||||
if(!(entity instanceof StaticSummon summon)) return;
|
||||
ItemStack itemStack = summon.getEntityData().get(StaticSummon.ITEM);
|
||||
if(itemStack == ItemStack.EMPTY) return;
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
//旋转(方向修正)
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(-Mth.lerp(partialTick, summon.yRotO, summon.getYRot())));
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(Mth.lerp(partialTick, summon.xRotO, summon.getXRot())));
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().renderStatic(
|
||||
itemStack,
|
||||
ItemDisplayContext.NONE,
|
||||
packedLight,
|
||||
OverlayTexture.NO_OVERLAY,
|
||||
poseStack,
|
||||
bufferSource,
|
||||
entity.level(),
|
||||
0
|
||||
);
|
||||
poseStack.popPose();
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
//旋转(方向修正)
|
||||
poseStack.mulPose(Axis.YP.rotationDegrees(-Mth.lerp(partialTick, summon.yRotO, summon.getYRot())));
|
||||
poseStack.mulPose(Axis.XP.rotationDegrees(Mth.lerp(partialTick, summon.xRotO + 90, summon.getXRot() + 90)));
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().renderStatic(
|
||||
itemStack,
|
||||
ItemDisplayContext.NONE,
|
||||
packedLight,
|
||||
OverlayTexture.NO_OVERLAY,
|
||||
poseStack,
|
||||
bufferSource,
|
||||
entity.level(),
|
||||
0
|
||||
);
|
||||
poseStack.popPose();
|
||||
|
||||
if(summon.getOwner() == null) return;
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(summon.getOwner());
|
||||
Vec3 eyePos = summon.getOwner().getEyePosition();
|
||||
Vec3 start = eyePos.add(new Vec3(
|
||||
dirs[0].x * DIRECTION_OFFSET + dirs[1].x * UP_OFFSET + dirs[2].x * RIGHT_OFFSET,
|
||||
dirs[0].y * DIRECTION_OFFSET + dirs[1].y * UP_OFFSET + dirs[2].y * RIGHT_OFFSET,
|
||||
dirs[0].z * DIRECTION_OFFSET + dirs[1].z * UP_OFFSET + dirs[2].z * RIGHT_OFFSET
|
||||
));
|
||||
Vec3 end = summon.getPosition(partialTick);
|
||||
double dist = end.subtract(start).length();
|
||||
Vector3f[] dirs2 = MathUtil.computeCoordinateSystem(end.subtract(start).toVector3f(), 0);
|
||||
Vec3 dir = MathUtil.toVec3(dirs2[0]);
|
||||
Vec3 right = MathUtil.toVec3(dirs2[2]);
|
||||
Vec3 up = MathUtil.toVec3(dirs2[1]);
|
||||
|
||||
VertexConsumer vertexConsumer = bufferSource.getBuffer(RenderType.entityCutoutNoCull(RES));
|
||||
|
||||
int count = (int) (dist / CHAIN_LENGTH);
|
||||
for(int j = 0;j < 2;j++) {
|
||||
for(int i = 0; i < count; i++) {
|
||||
Vec3 current = start.add(new Vec3(
|
||||
dir.x * i * CHAIN_LENGTH,
|
||||
dir.y * i * CHAIN_LENGTH,
|
||||
dir.z * i * CHAIN_LENGTH
|
||||
)).subtract(summon.getPosition(partialTick));
|
||||
|
||||
Vec3 next = start.add(new Vec3(
|
||||
dir.x * (i + 1) * CHAIN_LENGTH,
|
||||
dir.y * (i + 1) * CHAIN_LENGTH,
|
||||
dir.z * (i + 1) * CHAIN_LENGTH
|
||||
)).subtract(summon.getPosition(partialTick));
|
||||
|
||||
Vec3 p1, p2, p3, p4;
|
||||
if(j == 0) {
|
||||
p1 = current.add(right.scale(0.125));
|
||||
p2 = current.add(right.scale(-0.125));
|
||||
p3 = next.add(right.scale(-0.125));
|
||||
p4 = next.add(right.scale(0.125));
|
||||
}else {
|
||||
p1 = current.add(up.scale(0.125));
|
||||
p2 = current.add(up.scale(-0.125));
|
||||
p3 = next.add(up.scale(-0.125));
|
||||
p4 = next.add(up.scale(0.125));
|
||||
}
|
||||
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p1.x, (float) p1.y, (float) p1.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(0.0f, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p2.x, (float) p2.y, (float) p2.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(0.0f, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p3.x, (float) p3.y, (float) p3.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(1.0f, 1.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
vertexConsumer.addVertex(poseStack.last().pose(), (float) p4.x, (float) p4.y, (float) p4.z)
|
||||
.setColor(1.0f, 1.0f, 1.0f, 1.0f).setUv(1.0f, 0.0f)
|
||||
.setOverlay(OverlayTexture.NO_OVERLAY).setLight(packedLight).setNormal(0, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AABB getBoundingBoxForCulling(StaticSummon summon) {
|
||||
Entity owner = summon.getOwner();
|
||||
if(owner != null) {
|
||||
AABB hammerBox = summon.getBoundingBox();
|
||||
AABB ownerBox = owner.getBoundingBoxForCulling();
|
||||
return hammerBox.minmax(ownerBox).inflate(1.0D);
|
||||
}
|
||||
return summon.getBoundingBox();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick(StaticSummon summon) {
|
||||
this.checkBeforeTick(summon);
|
||||
Entity entity = summon.getOwner();
|
||||
if(!(entity instanceof Player player)) {
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND);
|
||||
if(!stack.is(ModItems.MACE.get())) {
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
summon.setBoundingBox(new AABB(
|
||||
summon.getX() - 0.25f, summon.getY() - 0.25f, summon.getZ() - 0.25f,
|
||||
summon.getX() + 0.25f, summon.getY() + 0.25f, summon.getZ() + 0.25f
|
||||
));
|
||||
int state = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY)
|
||||
.copyTag().getInt("state");
|
||||
if(state == State.THROWING.ordinal()) {
|
||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||
int flyTime = customData.contains("flyTime") ? customData.getInt("flyTime") : 0;
|
||||
int age = summon.getEntityData().get(StaticSummon.AGE);
|
||||
if(age < flyTime) {
|
||||
summon.setDeltaMovement(summon.getLookAngle().normalize().scale(Config.maceProjectileSpeed));
|
||||
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(summon.getDeltaMovement()));
|
||||
if(blockHitResult.getType() != HitResult.Type.MISS) {
|
||||
summon.getEntityData().set(StaticSummon.AGE, flyTime);
|
||||
if(summon.level() instanceof ServerLevel serverLevel) {
|
||||
BlockState hitState = serverLevel.getBlockState(blockHitResult.getBlockPos());
|
||||
ParticleUtil.addParticles(
|
||||
serverLevel, new BlockParticleOption(ParticleTypes.BLOCK, hitState),
|
||||
blockHitResult.getLocation(), new Vec3(0, 0, 0),
|
||||
0.2, 25
|
||||
);
|
||||
SoundUtil.playServerSound(serverLevel, ModSounds.DIG.get(), blockHitResult.getLocation());
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Vec3 moveDir = player.getEyePosition().subtract(summon.position());
|
||||
double dist = moveDir.length();
|
||||
summon.setDeltaMovement(moveDir.normalize().scale(Config.maceProjectileSpeed));
|
||||
if(dist < 2.0f) {
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
BlockHitResult blockHitResult = CollisionUtil.checkBlockHit(summon, summon.position().add(summon.getDeltaMovement()));
|
||||
if(blockHitResult.getType() != HitResult.Type.MISS) {
|
||||
int hitBlockCount = customData.contains("hitBlockCount") ? customData.getInt("hitBlockCount") : 0;
|
||||
if(hitBlockCount > 10) {
|
||||
summon.noPhysics = true;
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.THROWING_BACK.ordinal()));
|
||||
}else {
|
||||
customData.putInt("hitBlockCount", hitBlockCount + 1);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
}
|
||||
if(summon.level() instanceof ServerLevel serverLevel) {
|
||||
BlockState hitState = serverLevel.getBlockState(blockHitResult.getBlockPos());
|
||||
ParticleUtil.addParticles(
|
||||
serverLevel, new BlockParticleOption(ParticleTypes.BLOCK, hitState),
|
||||
blockHitResult.getLocation(), new Vec3(0, 0, 0),
|
||||
0.2, 25
|
||||
);
|
||||
SoundUtil.playServerSound(serverLevel, ModSounds.DIG.get(), blockHitResult.getLocation());
|
||||
}
|
||||
}
|
||||
}
|
||||
double dist = summon.position().subtract(player.position()).length();
|
||||
if(dist > Config.maceMaxRange) {
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.THROWING_BACK.ordinal()));
|
||||
}
|
||||
if(!summon.level().isClientSide()) {
|
||||
EntityHitResult entityHitResult = CollisionUtil.checkEntityHit(summon, summon.position().add(summon.getDeltaMovement()));
|
||||
if(entityHitResult != null) {
|
||||
Entity target = entityHitResult.getEntity();
|
||||
if(DamageUtil.attack(player, target, (float) Config.maceDamage)) {
|
||||
target.invulnerableTime = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if(state == State.DROPPING.ordinal()) {
|
||||
Vec3 g = new Vec3(0, -1, 0);
|
||||
summon.setDeltaMovement(g.scale(Config.maceGravity));
|
||||
double dist = summon.position().subtract(player.position()).length();
|
||||
if(dist > Config.maceMaxRange) {
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.THROWING_BACK.ordinal()));
|
||||
}
|
||||
List<Entity> targets = summon.level().getEntitiesOfClass(
|
||||
Entity.class,
|
||||
summon.getBoundingBox(),
|
||||
FilterUtil.createTargetFilter(summon, summon.getOwner())
|
||||
);
|
||||
for(Entity target : targets) {
|
||||
DamageUtil.attack(player, target, (float) Config.maceDamage);
|
||||
}
|
||||
}else if(state == State.THROWING_BACK.ordinal()){
|
||||
Vec3 moveDir = player.getEyePosition().subtract(summon.position());
|
||||
double dist = moveDir.length();
|
||||
summon.setDeltaMovement(moveDir.normalize().scale(Config.maceProjectileSpeed));
|
||||
EntityHitResult entityHitResult = CollisionUtil.checkEntityHit(summon, summon.position().add(summon.getDeltaMovement()));
|
||||
if(entityHitResult != null) {
|
||||
Entity target = entityHitResult.getEntity();
|
||||
if(DamageUtil.attack(player, target, (float) Config.maceDamage)) {
|
||||
target.invulnerableTime = 10;
|
||||
}
|
||||
}
|
||||
if(dist < 2.0f) {
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
onDied(summon);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDied(StaticSummon summon) {
|
||||
Entity entity = summon.getOwner();
|
||||
if(!(entity instanceof Player player)) {
|
||||
if(!summon.level().isClientSide()) summon.discard();
|
||||
return;
|
||||
}
|
||||
ItemStack stack = player.getItemInHand(InteractionHand.MAIN_HAND);
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.IDLE.ordinal()));
|
||||
if(!summon.level().isClientSide()) summon.discard();
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
int state = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY)
|
||||
.copyTag().getInt("state");
|
||||
if(state == State.IDLE.ordinal()) {
|
||||
StaticProjectile projectile = new StaticProjectile(ModEntities.STATIC_PROJECTILE.get(), level);
|
||||
projectile.setOwner(player);
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
|
||||
Vec3 pos = new Vec3(player.getX(), player.getEyeY() - 0.1, player.getZ());
|
||||
projectile.setPos(pos);
|
||||
projectile.getEntityData().set(StaticProjectile.BEHAVIOR, StaticProjectileBehaviors.MACE_PROJECTILE);
|
||||
projectile.getEntityData().set(StaticProjectile.RENDER_MODE, "custom");
|
||||
projectile.getEntityData().set(StaticProjectile.ITEM, new ItemStack(ModItems.MACE_PROJECTILE.get()));
|
||||
projectile.getEntityData().set(StaticProjectile.ORIGIN, pos.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.EXPRESSION_Z, String.format("%.3f*cos(%.3f*t)", 1.0, 1.0));
|
||||
projectile.getEntityData().set(StaticProjectile.EXPRESSION_Y, String.format("%.3f*sin(%.3f*t)", 1.0, 1.0));
|
||||
|
||||
projectile.getEntityData().set(StaticProjectile.LIFETIME, 12000);
|
||||
level.addFreshEntity(projectile);
|
||||
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.USING.ordinal()));
|
||||
player.startUsingItem(hand);
|
||||
return InteractionResultHolder.consume(stack);
|
||||
}else if(state == State.THROWING.ordinal()) {
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.DROPPING.ordinal()));
|
||||
player.startUsingItem(hand);
|
||||
return InteractionResultHolder.consume(stack);
|
||||
}else {
|
||||
return InteractionResultHolder.pass(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void releaseUsing(ItemStack stack, Level level, LivingEntity entity, int timeLeft) {
|
||||
if(!(entity instanceof Player player)) return;
|
||||
int state = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY)
|
||||
.copyTag().getInt("state");
|
||||
if(state == State.USING.ordinal()) {
|
||||
if(!level.isClientSide()) {
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.THROWING.ordinal()));
|
||||
|
||||
Vector3f[] dirs = MathUtil.computeCoordinateSystem(player);
|
||||
float[] xyRot = MathUtil.computeXYRot(dirs[0], dirs[1]);
|
||||
StaticSummon summon = new StaticSummon(ModEntities.STATIC_SUMMON.get(), level);
|
||||
summon.setOwner(player);
|
||||
Vec3 pos = new Vec3(player.getX(), player.getEyeY() - 0.1, player.getZ());
|
||||
summon.setPos(pos);
|
||||
summon.getEntityData().set(StaticSummon.BEHAVIOR, StaticSummonBehaviors.MACE_PROJECTILE);
|
||||
summon.getEntityData().set(StaticSummon.RENDER_MODE, "custom");
|
||||
summon.getEntityData().set(StaticSummon.ITEM, new ItemStack(ModItems.MACE_PROJECTILE.get()));
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, 12000);
|
||||
|
||||
summon.setXRot(xyRot[0]);
|
||||
summon.xRotO = xyRot[0];
|
||||
summon.setYRot(xyRot[1]);
|
||||
summon.yRotO = xyRot[1];
|
||||
|
||||
CompoundTag customData = new CompoundTag();
|
||||
customData.putInt("flyTime", Config.maceFlyTime);
|
||||
summon.getEntityData().set(StaticSummon.CUSTOM_DATA, customData);
|
||||
|
||||
summon.setNoGravity(true);
|
||||
|
||||
level.addFreshEntity(summon);
|
||||
}
|
||||
}else if(state == State.DROPPING.ordinal()) {
|
||||
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.THROWING_BACK.ordinal()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull UseAnim getUseAnimation(ItemStack stack) {
|
||||
return UseAnim.BLOCK;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUseDuration(ItemStack stack, LivingEntity entity) {
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inventoryTick(ItemStack stack, Level level, net.minecraft.world.entity.Entity entity, int slotId, boolean isSelected) {
|
||||
super.inventoryTick(stack, level, entity, slotId, isSelected);
|
||||
if(entity instanceof Player player) {
|
||||
if(!isSelected) {
|
||||
CustomData.update(DataComponents.CUSTOM_DATA, stack,
|
||||
tag -> tag.putInt("state", State.IDLE.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class Meowmere extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final DustParticleOptions PARTICLE = new DustParticleOptions(
|
||||
|
||||
@@ -32,10 +32,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -58,7 +55,7 @@ public class NightsEdge extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -1.5, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.UNCOMMON));
|
||||
}
|
||||
|
||||
public static final CompoundTag BEAM_DATA = Util.make(new CompoundTag(), tag -> {
|
||||
|
||||
@@ -25,10 +25,7 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.monster.Monster;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.*;
|
||||
@@ -47,7 +44,7 @@ public class Seedler extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.UNCOMMON));
|
||||
}
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {
|
||||
|
||||
@@ -23,10 +23,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -43,7 +40,7 @@ public class StarWrath extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final DustParticleOptions PARTICLE = new DustParticleOptions(
|
||||
|
||||
@@ -25,10 +25,7 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.projectile.ProjectileUtil;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
|
||||
@@ -34,10 +34,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -62,7 +59,7 @@ public class TerraBlade extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -1.0, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final CompoundTag BEAM_DATA = Util.make(new CompoundTag(), tag -> {
|
||||
|
||||
@@ -31,10 +31,7 @@ import net.minecraft.world.entity.ai.attributes.AttributeInstance;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -56,7 +53,7 @@ public class Terragrim extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -0.5, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final ResourceLocation[] RES = {
|
||||
|
||||
@@ -31,10 +31,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
|
||||
import net.minecraft.world.entity.monster.Monster;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
@@ -59,7 +56,7 @@ public class TheHorsemansBlade extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final CompoundTag BEAM_DATA = Util.make(new CompoundTag(), tag -> {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class TrueCopperShortsword extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).fireResistant().rarity(Rarity.EPIC));
|
||||
}
|
||||
|
||||
public static void summon(Player player, double deltaDist) {
|
||||
|
||||
@@ -27,10 +27,7 @@ import net.minecraft.world.entity.EquipmentSlotGroup;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.phys.EntityHitResult;
|
||||
@@ -50,7 +47,7 @@ public class TrueExcalibur extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -1.0, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final CompoundTag BEAM_DATA = Util.make(new CompoundTag(), tag -> {
|
||||
|
||||
@@ -32,10 +32,7 @@ import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.SwordItem;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.*;
|
||||
import net.minecraft.world.item.component.ItemAttributeModifiers;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -58,7 +55,7 @@ public class TrueNightsEdge extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).rarity(Rarity.RARE));
|
||||
}
|
||||
|
||||
public static final CompoundTag BEAM_DATA = Util.make(new CompoundTag(), tag -> {
|
||||
|
||||
@@ -3,6 +3,10 @@ package com.lzxnone.terraria.item.weapon.melee;
|
||||
import com.lzxnone.terraria.Config;
|
||||
import com.lzxnone.terraria.LzxnoneTerraria;
|
||||
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;
|
||||
import com.lzxnone.terraria.entity.summon.StaticSummonBehaviors;
|
||||
import com.lzxnone.terraria.item.IItemWaveBehavior;
|
||||
import com.lzxnone.terraria.particle.DustParticleOptions;
|
||||
import com.lzxnone.terraria.particle.ModParticles;
|
||||
@@ -54,6 +58,8 @@ public class Volcano extends SwordItem {
|
||||
}
|
||||
);
|
||||
|
||||
public static final IStaticSummonBehavior SUMMON_BEHAVIOR = new IStaticSummonBehavior() {};
|
||||
|
||||
public static final IItemWaveBehavior ITEM_WAVE_BEHAVIOR = new IItemWaveBehavior() {
|
||||
@Override
|
||||
public void onLeftClickAir(PlayerInteractEvent.LeftClickEmpty event) {
|
||||
@@ -117,6 +123,18 @@ public class Volcano extends SwordItem {
|
||||
hitCount++;
|
||||
}
|
||||
}
|
||||
|
||||
StaticSummon summon = new StaticSummon(ModEntities.STATIC_SUMMON.get(), livingTarget.level());
|
||||
summon.setOwner(player);
|
||||
Vec3 pos = livingTarget.position();
|
||||
summon.setPos(pos);
|
||||
summon.getEntityData().set(StaticSummon.BEHAVIOR, StaticSummonBehaviors.VOLCANO_LIGHT);
|
||||
summon.getEntityData().set(StaticSummon.RENDER_MODE, "custom");
|
||||
summon.getEntityData().set(StaticSummon.LIFETIME, 10);
|
||||
summon.setNoGravity(true);
|
||||
summon.noPhysics = true;
|
||||
summon.level().addFreshEntity(summon);
|
||||
|
||||
int randomSound = player.getRandom().nextInt(3);
|
||||
if(randomSound == 0) {
|
||||
SoundUtil.playServerSound(target.level(), ModSounds.EXPLOSIVE_TRAP_EXPLODE0.get(), target.position());
|
||||
@@ -133,14 +151,14 @@ public class Volcano extends SwordItem {
|
||||
ParticleUtil.addParticles(
|
||||
(ServerLevel) target.level(), ModParticles.EXPLODE_PARTICLE.get(),
|
||||
new Vec3(target.getX(), target.getY() + target.getBbHeight() / 2.0, target.getZ()), new Vec3(0, 0, 0),
|
||||
0.2, (int) (4 + Math.random() * 4)
|
||||
0.2, (int) (30 + Math.random() * 30)
|
||||
);
|
||||
ParticleUtil.addParticles(
|
||||
(ServerLevel) target.level(), PARTICLE,
|
||||
new Vec3(target.getX(), target.getY() + target.getBbHeight() / 2.0, target.getZ()), new Vec3(0, 0, 0),
|
||||
0.4, 50
|
||||
0.4, 100
|
||||
);
|
||||
player.getCooldowns().addCooldown(item, 20);
|
||||
player.getCooldowns().addCooldown(item, 10);
|
||||
}
|
||||
if(player.getRandom().nextInt(2) == 0) livingTarget.igniteForSeconds(Config.volcanoIgniteSeconds);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Zenith extends SwordItem {
|
||||
new AttributeModifier(ResourceLocation.fromNamespaceAndPath(LzxnoneTerraria.MODID, "base_attack_speed"), -2.4, AttributeModifier.Operation.ADD_VALUE),
|
||||
EquipmentSlotGroup.MAINHAND)
|
||||
.build()
|
||||
));
|
||||
).fireResistant().rarity(Rarity.EPIC));
|
||||
}
|
||||
|
||||
private static ItemStack[] weapons;
|
||||
|
||||
+51
-2
@@ -1,6 +1,7 @@
|
||||
package com.lzxnone.terraria.mixin;
|
||||
|
||||
import com.lzxnone.terraria.item.ModItems;
|
||||
import com.lzxnone.terraria.item.weapon.melee.Mace;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.player.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.ItemInHandRenderer;
|
||||
@@ -9,6 +10,7 @@ import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.HumanoidArm;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.component.CustomData;
|
||||
@@ -19,7 +21,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ItemInHandRenderer.class)
|
||||
public class ZenithRenderMixin {
|
||||
public class ItemInHandRenderMixin {
|
||||
@Shadow
|
||||
private void renderPlayerArm(PoseStack poseStack, MultiBufferSource buffer, int packedLight,
|
||||
float equippedProgress, float swingProgress, HumanoidArm side) {}
|
||||
@@ -44,6 +46,39 @@ public class ZenithRenderMixin {
|
||||
this.renderPlayerArm(poseStack, buffer, combinedLight, equippedProgress, swingProgress, humanoidarm);
|
||||
}
|
||||
|
||||
poseStack.popPose();
|
||||
ci.cancel();
|
||||
}
|
||||
}else if(stack.is(ModItems.TERRAGRIM.get())) {
|
||||
if(player.isUsingItem()) {
|
||||
ItemStack usingStack = player.getUseItem();
|
||||
if(usingStack.is(ModItems.TERRAGRIM.get())) {
|
||||
boolean isMainHand = hand == InteractionHand.MAIN_HAND;
|
||||
HumanoidArm humanoidarm = isMainHand ? player.getMainArm() : player.getMainArm().getOpposite();
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
if(!player.isInvisible()) {
|
||||
this.renderPlayerArm(poseStack, buffer, combinedLight, equippedProgress, swingProgress, humanoidarm);
|
||||
}
|
||||
|
||||
poseStack.popPose();
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}else if(stack.is(ModItems.MACE.get())) {
|
||||
int state = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY)
|
||||
.copyTag().getInt("state");
|
||||
if(state != Mace.State.IDLE.ordinal()) {
|
||||
boolean isMainHand = hand == InteractionHand.MAIN_HAND;
|
||||
HumanoidArm humanoidarm = isMainHand ? player.getMainArm() : player.getMainArm().getOpposite();
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
if(!player.isInvisible()) {
|
||||
this.renderPlayerArm(poseStack, buffer, combinedLight, equippedProgress, swingProgress, humanoidarm);
|
||||
}
|
||||
|
||||
poseStack.popPose();
|
||||
ci.cancel();
|
||||
}
|
||||
@@ -52,7 +87,7 @@ public class ZenithRenderMixin {
|
||||
}
|
||||
|
||||
@Inject(method = "renderItem", at = @At("HEAD"), cancellable = true)
|
||||
private void renderZenith(LivingEntity entity, ItemStack itemStack, ItemDisplayContext displayContext,
|
||||
private void renderItem(LivingEntity entity, ItemStack itemStack, ItemDisplayContext displayContext,
|
||||
boolean leftHand, PoseStack poseStack, MultiBufferSource buffer,
|
||||
int seed, CallbackInfo ci) {
|
||||
|
||||
@@ -62,6 +97,20 @@ public class ZenithRenderMixin {
|
||||
if(count > 0) {
|
||||
ci.cancel();
|
||||
}
|
||||
}else if(itemStack.is(ModItems.TERRAGRIM.get()) && entity instanceof Player player) {
|
||||
if(player.isUsingItem()) {
|
||||
ItemStack usingStack = player.getUseItem();
|
||||
if(usingStack.is(ModItems.TERRAGRIM.get())) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}else if(itemStack.is(ModItems.MACE.get())) {
|
||||
int state = itemStack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY)
|
||||
.copyTag().getInt("state");
|
||||
if(state != Mace.State.IDLE.ordinal()) {
|
||||
ci.cancel();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.lzxnone.terraria.mixin;
|
||||
|
||||
import com.lzxnone.terraria.item.ModItems;
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import net.minecraft.client.player.AbstractClientPlayer;
|
||||
import net.minecraft.client.renderer.ItemInHandRenderer;
|
||||
import net.minecraft.client.renderer.MultiBufferSource;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.HumanoidArm;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemDisplayContext;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
@Mixin(ItemInHandRenderer.class)
|
||||
public class TerragrimRenderMixin {
|
||||
@Shadow
|
||||
private void renderPlayerArm(PoseStack poseStack, MultiBufferSource buffer, int packedLight,
|
||||
float equippedProgress, float swingProgress, HumanoidArm side) {}
|
||||
|
||||
@Inject(method = "renderArmWithItem", at = @At("HEAD"), cancellable = true)
|
||||
private void renderHand(AbstractClientPlayer player, float partialTicks, float pitch,
|
||||
InteractionHand hand, float swingProgress, ItemStack stack,
|
||||
float equippedProgress, PoseStack poseStack,
|
||||
MultiBufferSource buffer, int combinedLight, CallbackInfo ci) {
|
||||
|
||||
if(!player.isScoping()) {
|
||||
if(stack.is(ModItems.TERRAGRIM.get())) {
|
||||
if(player.isUsingItem()) {
|
||||
ItemStack usingStack = player.getUseItem();
|
||||
if(usingStack.is(ModItems.TERRAGRIM.get())) {
|
||||
boolean isMainHand = hand == InteractionHand.MAIN_HAND;
|
||||
HumanoidArm humanoidarm = isMainHand ? player.getMainArm() : player.getMainArm().getOpposite();
|
||||
|
||||
poseStack.pushPose();
|
||||
|
||||
if(!player.isInvisible()) {
|
||||
this.renderPlayerArm(poseStack, buffer, combinedLight, equippedProgress, swingProgress, humanoidarm);
|
||||
}
|
||||
|
||||
poseStack.popPose();
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "renderItem", at = @At("HEAD"), cancellable = true)
|
||||
private void renderTerragrim(LivingEntity entity, ItemStack itemStack, ItemDisplayContext displayContext,
|
||||
boolean leftHand, PoseStack poseStack, MultiBufferSource buffer,
|
||||
int seed, CallbackInfo ci) {
|
||||
|
||||
if(itemStack.is(ModItems.TERRAGRIM.get()) && entity instanceof Player player) {
|
||||
if(player.isUsingItem()) {
|
||||
ItemStack usingStack = player.getUseItem();
|
||||
if(usingStack.is(ModItems.TERRAGRIM.get())) {
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@
|
||||
"item.lzxnoneterraria.true_excalibur": "True Excalibur",
|
||||
"item.lzxnoneterraria.true_copper_shortsword": "True Copper Shortsword",
|
||||
"item.lzxnoneterraria.first_fractal": "First Fractal",
|
||||
"item.lzxnoneterraria.mace": "Mace",
|
||||
|
||||
"entity.lzxnoneterraria.static_projectile": "Projectile",
|
||||
"entity.lzxnoneterraria.static_summon": "Summon",
|
||||
@@ -157,6 +158,18 @@
|
||||
"lzxnoneterraria.configuration.lights_bane_target_range": "Target Acquisition Range",
|
||||
"lzxnoneterraria.configuration.lights_bane_target_range.tooltip": "Range to search for nearby enemies",
|
||||
|
||||
"lzxnoneterraria.configuration.mace_settings": "Mace Settings",
|
||||
"lzxnoneterraria.configuration.mace_projectile_speed": "Projectile Speed",
|
||||
"lzxnoneterraria.configuration.mace_projectile_speed.tooltip": "Projectile movement speed",
|
||||
"lzxnoneterraria.configuration.mace_gravity": "Gravity",
|
||||
"lzxnoneterraria.configuration.mace_gravity.tooltip": "Gravity applied to projectile",
|
||||
"lzxnoneterraria.configuration.mace_damage": "Damage",
|
||||
"lzxnoneterraria.configuration.mace_damage.tooltip": "Damage per hit",
|
||||
"lzxnoneterraria.configuration.mace_fly_time": "Max Fly Time",
|
||||
"lzxnoneterraria.configuration.mace_fly_time.tooltip": "Maximum projectile fly time in ticks",
|
||||
"lzxnoneterraria.configuration.mace_max_range": "Max Range",
|
||||
"lzxnoneterraria.configuration.mace_max_range.tooltip": "Maximum projectile travel range",
|
||||
|
||||
"lzxnoneterraria.configuration.muramasa_settings": "Muramasa Settings",
|
||||
"lzxnoneterraria.configuration.muramasa_beam_damage": "Beam Damage",
|
||||
"lzxnoneterraria.configuration.muramasa_beam_damage.tooltip": "Damage dealt by the blue beam",
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"item.lzxnoneterraria.true_excalibur": "真断钢剑",
|
||||
"item.lzxnoneterraria.true_copper_shortsword": "真铜短剑",
|
||||
"item.lzxnoneterraria.first_fractal": "第一分形",
|
||||
"item.lzxnoneterraria.mace": "链锤",
|
||||
|
||||
"entity.lzxnoneterraria.static_projectile": "弹射物",
|
||||
"entity.lzxnoneterraria.static_summon": "召唤物",
|
||||
@@ -157,6 +158,18 @@
|
||||
"lzxnoneterraria.configuration.lights_bane_target_range": "寻敌范围",
|
||||
"lzxnoneterraria.configuration.lights_bane_target_range.tooltip": "搜索附近敌人的距离",
|
||||
|
||||
"lzxnoneterraria.configuration.mace_settings": "链球 设置",
|
||||
"lzxnoneterraria.configuration.mace_projectile_speed": "弹射速度",
|
||||
"lzxnoneterraria.configuration.mace_projectile_speed.tooltip": "弹射物移动速度",
|
||||
"lzxnoneterraria.configuration.mace_gravity": "重力",
|
||||
"lzxnoneterraria.configuration.mace_gravity.tooltip": "弹射物受到的重力",
|
||||
"lzxnoneterraria.configuration.mace_damage": "伤害",
|
||||
"lzxnoneterraria.configuration.mace_damage.tooltip": "每次命中伤害",
|
||||
"lzxnoneterraria.configuration.mace_fly_time": "最大飞行时间",
|
||||
"lzxnoneterraria.configuration.mace_fly_time.tooltip": "弹射物最大飞行时间(刻)",
|
||||
"lzxnoneterraria.configuration.mace_max_range": "最大范围",
|
||||
"lzxnoneterraria.configuration.mace_max_range.tooltip": "弹射物最大飞行距离",
|
||||
|
||||
"lzxnoneterraria.configuration.muramasa_settings": "村正 设置",
|
||||
"lzxnoneterraria.configuration.muramasa_beam_damage": "光线伤害",
|
||||
"lzxnoneterraria.configuration.muramasa_beam_damage.tooltip": "蓝色光线造成的伤害",
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"parent": "item/handheld",
|
||||
"display": {
|
||||
"thirdperson_righthand": {
|
||||
"rotation": [0, -90, 55],
|
||||
"translation": [0, -1.0, -3.0],
|
||||
"scale": [0.85, 0.85, 0.85]
|
||||
},
|
||||
"thirdperson_lefthand": {
|
||||
"rotation": [0, 90, -55],
|
||||
"translation": [0, -1.0, -3.0],
|
||||
"scale": [0.85, 0.85, 0.85]
|
||||
},
|
||||
"firstperson_righthand": {
|
||||
"rotation": [0, -90, 25],
|
||||
"translation": [1.13, 6.2, 0.0],
|
||||
"scale": [0.68, 0.68, 0.68]
|
||||
},
|
||||
"firstperson_lefthand": {
|
||||
"rotation": [0, 90, -25],
|
||||
"translation": [1.13, 6.2, 0.0],
|
||||
"scale": [0.68, 0.68, 0.68]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "lzxnoneterraria:item/flail",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/mace"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "lzxnoneterraria:item/mace_projectile"
|
||||
}
|
||||
}
|
||||
@@ -37,5 +37,8 @@
|
||||
},
|
||||
"explosive_trap_explode2": {
|
||||
"sounds": ["lzxnoneterraria:explosive_trap_explode2"]
|
||||
},
|
||||
"dig": {
|
||||
"sounds": ["lzxnoneterraria:dig"]
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 232 B |
Binary file not shown.
|
After Width: | Height: | Size: 426 B |
Binary file not shown.
|
After Width: | Height: | Size: 193 B |
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
"BA ",
|
||||
"CB "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:honey_block" },
|
||||
"B": { "item": "minecraft:honey_bottle" },
|
||||
"C": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:bee_keeper",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
"BA ",
|
||||
"DC "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:grass_block" },
|
||||
"B": { "item": "minecraft:short_grass" },
|
||||
"C": { "item": "minecraft:tall_grass" },
|
||||
"D": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:blade_of_grass",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
" B ",
|
||||
"C "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:emerald" },
|
||||
"B": { "item": "minecraft:stick" },
|
||||
"C": { "item": "minecraft:nether_wart_block" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:blood_butcherer",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
" A ",
|
||||
"B "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:copper_ingot" },
|
||||
"B": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:copper_shortsword",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
"BA ",
|
||||
"CB "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond" },
|
||||
"B": { "item": "minecraft:obsidian" },
|
||||
"C": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:enchanted_sword",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"CBA",
|
||||
"DAB",
|
||||
"EDC"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:gold_block" },
|
||||
"B": { "item": "minecraft:netherite_ingot" },
|
||||
"C": { "item": "minecraft:diamond_block" },
|
||||
"D": { "item": "minecraft:echo_shard" },
|
||||
"E": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:excalibur",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"type": "minecraft:smithing_transform",
|
||||
"template": {
|
||||
"item": "minecraft:netherite_upgrade_smithing_template"
|
||||
},
|
||||
"base": {
|
||||
"item": "lzxnoneterraria:terragrim"
|
||||
},
|
||||
"addition": {
|
||||
"item": "minecraft:music_disc_5"
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:first_fractal",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"FDA",
|
||||
"BAD",
|
||||
"CBF"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond_block" },
|
||||
"B": { "item": "minecraft:netherite_ingot" },
|
||||
"C": { "item": "minecraft:stick" },
|
||||
"D": { "item": "minecraft:elytra" },
|
||||
"F": { "item": "minecraft:dragon_breath" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:influx_waver",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
" B ",
|
||||
"C "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond" },
|
||||
"B": { "item": "minecraft:stick" },
|
||||
"C": { "item": "minecraft:prismarine" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:lights_bane",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"AAB",
|
||||
"AAB",
|
||||
"AAB"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:iron_ingot" },
|
||||
"B": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:mace",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"EFA",
|
||||
"BCF",
|
||||
"DBE"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond_block" },
|
||||
"B": { "item": "minecraft:nether_star" },
|
||||
"C": { "item": "minecraft:dragon_egg" },
|
||||
"D": { "item": "minecraft:stick" },
|
||||
"E": { "item": "minecraft:mace" },
|
||||
"F": { "item": "minecraft:ominous_bottle" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:meowmere",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
"BA ",
|
||||
"CB "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond" },
|
||||
"B": { "item": "minecraft:prismarine_shard" },
|
||||
"C": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:muramasa",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"ABC",
|
||||
"EDE",
|
||||
"FGF"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "lzxnoneterraria:blade_of_grass" },
|
||||
"B": { "item": "lzxnoneterraria:muramasa" },
|
||||
"C": { "item": "lzxnoneterraria:volcano" },
|
||||
"D": { "item": "lzxnoneterraria:lights_bane" },
|
||||
"E": { "item": "minecraft:netherite_ingot" },
|
||||
"F": { "item": "minecraft:diamond_block" },
|
||||
"G": { "item": "minecraft:nether_star" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:nights_edge",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"ABC",
|
||||
"EDE",
|
||||
"FGF"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "lzxnoneterraria:blade_of_grass" },
|
||||
"B": { "item": "lzxnoneterraria:muramasa" },
|
||||
"C": { "item": "lzxnoneterraria:volcano" },
|
||||
"D": { "item": "lzxnoneterraria:blood_butcherer" },
|
||||
"E": { "item": "minecraft:netherite_ingot" },
|
||||
"F": { "item": "minecraft:diamond_block" },
|
||||
"G": { "item": "minecraft:nether_star" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:nights_edge",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
"BA ",
|
||||
"CB "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond_block" },
|
||||
"B": { "item": "minecraft:emerald_block" },
|
||||
"C": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:seedler",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"EFA",
|
||||
"BCF",
|
||||
"DBE"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond_block" },
|
||||
"B": { "item": "minecraft:netherite_ingot" },
|
||||
"C": { "item": "minecraft:nether_star"},
|
||||
"D": { "item": "minecraft:stick" },
|
||||
"E": { "item": "minecraft:conduit" },
|
||||
"F": { "item": "minecraft:silence_armor_trim_smithing_template" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:star_wrath",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
"BA ",
|
||||
"CB "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:diamond" },
|
||||
"B": { "item": "minecraft:gold_block" },
|
||||
"C": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:starfury",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"EDA",
|
||||
"CBD",
|
||||
"FCE"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "lzxnoneterraria:true_excalibur" },
|
||||
"B": { "item": "lzxnoneterraria:true_nights_edge" },
|
||||
"C": { "item": "minecraft:netherite_block"},
|
||||
"D": { "item": "minecraft:emerald_block"},
|
||||
"E": { "item": "minecraft:totem_of_undying" },
|
||||
"F": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:terra_blade",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"ABC",
|
||||
"DEF",
|
||||
"GHI"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "lzxnoneterraria:enchanted_sword" },
|
||||
"B": { "item": "lzxnoneterraria:bee_keeper" },
|
||||
"C": { "item": "lzxnoneterraria:starfury" },
|
||||
"D": { "item": "lzxnoneterraria:seedler" },
|
||||
"E": { "item": "lzxnoneterraria:the_horsemans_blade" },
|
||||
"F": { "item": "lzxnoneterraria:influx_waver" },
|
||||
"G": { "item": "lzxnoneterraria:star_wrath" },
|
||||
"H": { "item": "lzxnoneterraria:meowmere" },
|
||||
"I": { "item": "lzxnoneterraria:terra_blade" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:terragrim",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"EFA",
|
||||
"BAG",
|
||||
"CBH"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:gold_block" },
|
||||
"B": { "item": "minecraft:netherite_ingot" },
|
||||
"C": { "item": "minecraft:stick" },
|
||||
"E": { "item": "minecraft:skeleton_skull" },
|
||||
"F": { "item": "minecraft:zombie_head" },
|
||||
"G": { "item": "minecraft:creeper_head" },
|
||||
"H": { "item": "minecraft:piglin_head" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:the_horsemans_blade",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:smelting",
|
||||
"category": "misc",
|
||||
"ingredient": {
|
||||
"item": "lzxnoneterraria:zenith"
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:true_copper_shortsword"
|
||||
},
|
||||
"experience": 0.0,
|
||||
"cookingtime": 1200
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"DBD",
|
||||
"EAE",
|
||||
"DCD"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "lzxnoneterraria:excalibur" },
|
||||
"B": { "item": "minecraft:dragon_egg" },
|
||||
"C": { "item": "minecraft:nether_star" },
|
||||
"D": { "item": "minecraft:netherite_ingot" },
|
||||
"E": { "item": "minecraft:dragon_head" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:true_excalibur",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
"DBD",
|
||||
"EAE",
|
||||
"DCD"
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "lzxnoneterraria:nights_edge" },
|
||||
"B": { "item": "minecraft:dragon_egg" },
|
||||
"C": { "item": "minecraft:nether_star" },
|
||||
"D": { "item": "minecraft:netherite_ingot" },
|
||||
"E": { "item": "minecraft:dragon_head" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:true_nights_edge",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "combat",
|
||||
"pattern": [
|
||||
" A",
|
||||
"BA ",
|
||||
"DC "
|
||||
],
|
||||
"key": {
|
||||
"A": { "item": "minecraft:magma_block" },
|
||||
"B": { "item": "minecraft:magma_cream" },
|
||||
"C": { "item": "minecraft:nether_wart" },
|
||||
"D": { "item": "minecraft:stick" }
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:volcano",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"type": "minecraft:smithing_transform",
|
||||
"template": {
|
||||
"item": "minecraft:netherite_upgrade_smithing_template"
|
||||
},
|
||||
"base": {
|
||||
"item": "lzxnoneterraria:terragrim"
|
||||
},
|
||||
"addition": {
|
||||
"item": "lzxnoneterraria:copper_shortsword"
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:zenith",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"type": "minecraft:smelting",
|
||||
"category": "misc",
|
||||
"ingredient": {
|
||||
"item": "lzxnoneterraria:true_copper_shortsword"
|
||||
},
|
||||
"result": {
|
||||
"id": "lzxnoneterraria:zenith"
|
||||
},
|
||||
"experience": 0.0,
|
||||
"cookingtime": 1200
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"parent": "bettercombat:mace"
|
||||
}
|
||||
@@ -4,8 +4,7 @@
|
||||
"package": "com.lzxnone.terraria.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"ZenithRenderMixin",
|
||||
"TerragrimRenderMixin"
|
||||
"ItemInHandRenderMixin"
|
||||
],
|
||||
"client": [],
|
||||
"injectors": {
|
||||
|
||||
Reference in new issue
Block a user