v1.9.1
No files matched your search
@@ -36,7 +36,7 @@ public class RobeModel extends HumanoidArmorModel<LivingEntity> {
|
|||||||
.texOffs(46, 0).addBox(-2.5F, 0.0F, -2.5F, 5.0F, 5.0F, 1.0F, new CubeDeformation(0.0F))
|
.texOffs(46, 0).addBox(-2.5F, 0.0F, -2.5F, 5.0F, 5.0F, 1.0F, new CubeDeformation(0.0F))
|
||||||
.texOffs(76, 0).addBox(-3.8F, 0.5F, -2.8F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F))
|
.texOffs(76, 0).addBox(-3.8F, 0.5F, -2.8F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F))
|
||||||
.texOffs(76, 0).mirror().addBox(1.8F, 0.5F, -2.8F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false)
|
.texOffs(76, 0).mirror().addBox(1.8F, 0.5F, -2.8F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false)
|
||||||
.texOffs(60, 0).addBox(-1.0F, 4.0F, -3.2F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F))
|
.texOffs(60, 0).addBox(-1.0F, 2.0F, -3.2F, 2.0F, 2.0F, 1.0F, new CubeDeformation(0.0F))
|
||||||
.texOffs(68, 0).addBox(-1.0F, 6.0F, -2.5F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)),
|
.texOffs(68, 0).addBox(-1.0F, 6.0F, -2.5F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)),
|
||||||
PartPose.ZERO
|
PartPose.ZERO
|
||||||
);
|
);
|
||||||
@@ -69,7 +69,7 @@ public class RobeModel extends HumanoidArmorModel<LivingEntity> {
|
|||||||
.texOffs(64, 36).addBox(-3.0F, 6.0F, -3.0F, 5.0F, 6.0F, 6.0F, new CubeDeformation(0.0F))
|
.texOffs(64, 36).addBox(-3.0F, 6.0F, -3.0F, 5.0F, 6.0F, 6.0F, new CubeDeformation(0.0F))
|
||||||
.texOffs(10, 52).addBox(-2.4F, 0.0F, -2.9F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F))
|
.texOffs(10, 52).addBox(-2.4F, 0.0F, -2.9F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F))
|
||||||
.texOffs(30, 52).addBox(-3.3F, 6.0F, -1.5F, 1.0F, 6.0F, 3.0F, new CubeDeformation(0.0F)),
|
.texOffs(30, 52).addBox(-3.3F, 6.0F, -1.5F, 1.0F, 6.0F, 3.0F, new CubeDeformation(0.0F)),
|
||||||
PartPose.offset(-1.9F, 12.0F, 0.0F)
|
PartPose.offset(-2.0F, 12.0F, 0.0F)
|
||||||
);
|
);
|
||||||
|
|
||||||
// 左腿 (长袍内衬 + 左半侧裙摆,随左腿前后摆动)
|
// 左腿 (长袍内衬 + 左半侧裙摆,随左腿前后摆动)
|
||||||
@@ -79,7 +79,7 @@ public class RobeModel extends HumanoidArmorModel<LivingEntity> {
|
|||||||
.texOffs(64, 36).mirror().addBox(-2.0F, 6.0F, -3.0F, 5.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)).mirror(false)
|
.texOffs(64, 36).mirror().addBox(-2.0F, 6.0F, -3.0F, 5.0F, 6.0F, 6.0F, new CubeDeformation(0.0F)).mirror(false)
|
||||||
.texOffs(10, 52).mirror().addBox(0.4F, 0.0F, -2.9F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false)
|
.texOffs(10, 52).mirror().addBox(0.4F, 0.0F, -2.9F, 2.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)).mirror(false)
|
||||||
.texOffs(30, 52).mirror().addBox(2.3F, 6.0F, -1.5F, 1.0F, 6.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false),
|
.texOffs(30, 52).mirror().addBox(2.3F, 6.0F, -1.5F, 1.0F, 6.0F, 3.0F, new CubeDeformation(0.0F)).mirror(false),
|
||||||
PartPose.offset(1.9F, 12.0F, 0.0F)
|
PartPose.offset(2.0F, 12.0F, 0.0F)
|
||||||
);
|
);
|
||||||
|
|
||||||
return LayerDefinition.create(meshdefinition, 128, 128);
|
return LayerDefinition.create(meshdefinition, 128, 128);
|
||||||
|
|||||||
@@ -81,28 +81,45 @@ public class FallenStar extends Item {
|
|||||||
);
|
);
|
||||||
if(players.isEmpty()) return false;
|
if(players.isEmpty()) return false;
|
||||||
|
|
||||||
ServerPlayer player = players.getFirst();
|
// 1. 标准包围盒碰撞检测捡起
|
||||||
|
for (ServerPlayer player : players) {
|
||||||
|
if (player.getBoundingBox().intersects(summon.getBoundingBox())) {
|
||||||
|
ItemStack stack = new ItemStack(ModItems.FALLEN_STAR.get());
|
||||||
|
if (player.getInventory().add(stack)) {
|
||||||
|
player.take(summon, 1);
|
||||||
|
player.containerMenu.broadcastChanges();
|
||||||
|
player.playNotifySound(
|
||||||
|
SoundEvents.ITEM_PICKUP,
|
||||||
|
SoundSource.PLAYERS,
|
||||||
|
0.2F,
|
||||||
|
((player.getRandom().nextFloat() - player.getRandom().nextFloat()) * 0.7F + 1.0F) * 2.0F
|
||||||
|
);
|
||||||
|
onDied(summon);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
double attractRange = Math.max(AccessoryUtil.getStarPickupRange(player), MIN_ATTRACT_RADIUS);
|
// 2. 吸引逻辑(保持原有吸引范围,寻找最近的可吸引玩家)
|
||||||
Vec3 dir = player.getBoundingBox().getCenter().subtract(summon.position());
|
ServerPlayer closestPlayer = null;
|
||||||
double dist = dir.length();
|
double closestDistSq = Double.MAX_VALUE;
|
||||||
if(dist <= attractRange) {
|
for (ServerPlayer player : players) {
|
||||||
summon.setDeltaMovement(dir.scale(ATTRACT_SPEED));
|
double distSq = summon.distanceToSqr(player);
|
||||||
|
if (distSq < closestDistSq) {
|
||||||
|
closestDistSq = distSq;
|
||||||
|
closestPlayer = player;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(dist <= PICKUP_RADIUS) {
|
|
||||||
ItemStack stack = new ItemStack(ModItems.FALLEN_STAR.get());
|
if (closestPlayer != null) {
|
||||||
if(!player.getInventory().add(stack)) return false;
|
double attractRange = Math.max(AccessoryUtil.getStarPickupRange(closestPlayer), MIN_ATTRACT_RADIUS);
|
||||||
player.take(summon, 1);
|
Vec3 dir = closestPlayer.getBoundingBox().getCenter().subtract(summon.position());
|
||||||
player.containerMenu.broadcastChanges();
|
double dist = dir.length();
|
||||||
player.playNotifySound(
|
if (dist <= attractRange) {
|
||||||
SoundEvents.ITEM_PICKUP,
|
summon.setDeltaMovement(dir.scale(ATTRACT_SPEED));
|
||||||
SoundSource.PLAYERS,
|
}
|
||||||
0.2F,
|
|
||||||
((player.getRandom().nextFloat() - player.getRandom().nextFloat()) * 0.7F + 1.0F) * 2.0F
|
|
||||||
);
|
|
||||||
onDied(summon);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class ManaStar extends Item {
|
|||||||
summon.getEntityData().set(StaticSummon.AGE, age + 1);
|
summon.getEntityData().set(StaticSummon.AGE, age + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean tryPickup(StaticSummon summon) {
|
private boolean tryPickup(StaticSummon summon) {
|
||||||
List<ServerPlayer> players = summon.level().getEntitiesOfClass(
|
List<ServerPlayer> players = summon.level().getEntitiesOfClass(
|
||||||
ServerPlayer.class,
|
ServerPlayer.class,
|
||||||
summon.getBoundingBox().inflate(MAX_PICKUP_RADIUS),
|
summon.getBoundingBox().inflate(MAX_PICKUP_RADIUS),
|
||||||
@@ -62,22 +62,39 @@ public class ManaStar extends Item {
|
|||||||
);
|
);
|
||||||
if(players.isEmpty()) return false;
|
if(players.isEmpty()) return false;
|
||||||
|
|
||||||
ServerPlayer player = players.getFirst();
|
|
||||||
|
|
||||||
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
CompoundTag customData = summon.getEntityData().get(StaticSummon.CUSTOM_DATA);
|
||||||
double attractRange = Math.max(AccessoryUtil.getStarPickupRange(player), customData.contains("min_attract_range") ? customData.getDouble("min_attract_range") : 4.0D);
|
|
||||||
Vec3 dir = player.getBoundingBox().getCenter().subtract(summon.position());
|
// 1. 标准包围盒碰撞检测捡起
|
||||||
double dist = dir.length();
|
for (ServerPlayer player : players) {
|
||||||
if(dist <= attractRange) {
|
if (player.getBoundingBox().intersects(summon.getBoundingBox())) {
|
||||||
summon.setDeltaMovement(dir.scale(ATTRACT_SPEED));
|
int amount = customData.contains("mana") ? customData.getInt("mana") : 0;
|
||||||
|
PlayerMana.recoverMana(player, amount);
|
||||||
|
player.addEffect(new MobEffectInstance(ModEffects.MANA_SURGE, MANA_SURGE_DURATION_TICKS, 0));
|
||||||
|
onDied(summon);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(dist <= PICKUP_RADIUS) {
|
|
||||||
int amount = customData.contains("mana") ? customData.getInt("mana") : 0;
|
// 2. 吸引逻辑(保持原有基础吸引范围不变,寻找最近的可吸引玩家)
|
||||||
PlayerMana.recoverMana(player, amount);
|
ServerPlayer closestPlayer = null;
|
||||||
player.addEffect(new MobEffectInstance(ModEffects.MANA_SURGE, MANA_SURGE_DURATION_TICKS, 0));
|
double closestDistSq = Double.MAX_VALUE;
|
||||||
onDied(summon);
|
for (ServerPlayer player : players) {
|
||||||
return true;
|
double distSq = summon.distanceToSqr(player);
|
||||||
|
if (distSq < closestDistSq) {
|
||||||
|
closestDistSq = distSq;
|
||||||
|
closestPlayer = player;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (closestPlayer != null) {
|
||||||
|
double attractRange = Math.max(AccessoryUtil.getStarPickupRange(closestPlayer), customData.contains("min_attract_range") ? customData.getDouble("min_attract_range") : 4.0D);
|
||||||
|
Vec3 dir = closestPlayer.getBoundingBox().getCenter().subtract(summon.position());
|
||||||
|
double dist = dir.length();
|
||||||
|
if (dist <= attractRange) {
|
||||||
|
summon.setDeltaMovement(dir.scale(ATTRACT_SPEED));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |