Skip to content

Commit

Permalink
version up
Browse files Browse the repository at this point in the history
  • Loading branch information
hrmcngs committed Nov 20, 2024
1 parent 1ac09eb commit 92ff24b
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 31 deletions.
2 changes: 1 addition & 1 deletion elements/LunaenteiteigaaitemuwoZhentutaShi.mod.json

Large diffs are not rendered by default.

36 changes: 26 additions & 10 deletions minecraft_armor_weapon.mcreator
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,22 @@
{
"name": "entity",
"type": "entity"
},
{
"name": "x",
"type": "number"
},
{
"name": "y",
"type": "number"
},
{
"name": "z",
"type": "number"
},
{
"name": "world",
"type": "world"
}
]
}
Expand Down Expand Up @@ -9096,19 +9112,19 @@
"itemGroup.tabmagic_books": "Magic Books",
"itemGroup.tabyopkeinamono": "建築とかに",
"effect.minecraft_armor_weapon.syugeki": "aa",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.illusioner_armor_boots": "Illusioner Armor Boots",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.ruami_284_spawn_egg": "ruami284 Spawn Egg",
"entity.minecraft_armor_weapon.comet": "Comet",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"effect.minecraft_armor_weapon.bow_attack": "illusioner_armor_effect",
"entity.minecraft_armor_weapon.comet_kill": "Comet",
"effect.minecraft_armor_weapon.bow_attack": "illusioner_armor_effect",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"block.minecraft_armor_weapon.stone_katana_block": "Netherite Katana Block",
"item.minecraft_armor_weapon.blackhole_spawn_egg": "Blackhole Spawn Egg",
"entity.minecraft_armor_weapon.blackhole": "Blackhole",
"advancements.magical_swordsman_achievements.descr": "§eGet Magisches feen katana",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"effect.minecraft_armor_weapon.suityuu": "suityuu",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"advancements.you_have_become_a_vampire.descr": "You have become a vampire.",
"effect.minecraft_armor_weapon.bakuhatu": "explosion",
"effect.minecraft_armor_weapon.aaaa": "bunnsinn",
Expand All @@ -9128,8 +9144,8 @@
"block.minecraft_armor_weapon.stone_bricks_trap_door": "Stone Bricks Trap Door",
"item.minecraft_armor_weapon.stone_katana": "§7Stone Katana",
"item.minecraft_armor_weapon.dragon_black_armor_helmet": "§8Dragon black helmet",
"item.minecraft_armor_weapon.kurikarakensword": "§5倶利伽羅剣",
"item.minecraft_armor_weapon.kaminari_kurikaraken_sword": "Kaminari Kurikaraken Sword",
"item.minecraft_armor_weapon.kurikarakensword": "§5倶利伽羅剣",
"item.minecraft_armor_weapon.scythe": "Scythe",
"item.minecraft_armor_weapon.wind_step": "§2Windstep",
"item.minecraft_armor_weapon.a": "A",
Expand Down Expand Up @@ -9356,19 +9372,19 @@
"itemGroup.tabmagic_books": "Magic Books",
"itemGroup.tabyopkeinamono": "建築とかに",
"effect.minecraft_armor_weapon.syugeki": "aa",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.illusioner_armor_boots": "Illusioner Armor Boots",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.ruami_284_spawn_egg": "ruami284 Spawn Egg",
"entity.minecraft_armor_weapon.comet": "Comet",
"entity.minecraft_armor_weapon.comet_kill": "Comet",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"effect.minecraft_armor_weapon.bow_attack": "illusioner_armor_effect",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"entity.minecraft_armor_weapon.comet_kill": "Comet",
"block.minecraft_armor_weapon.stone_katana_block": "Netherite Katana Block",
"item.minecraft_armor_weapon.blackhole_spawn_egg": "Blackhole Spawn Egg",
"entity.minecraft_armor_weapon.blackhole": "Blackhole",
"advancements.magical_swordsman_achievements.descr": "Magisches feen katanaを得る",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"effect.minecraft_armor_weapon.suityuu": "suityuu",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"advancements.you_have_become_a_vampire.descr": "吸血鬼になったよ",
"effect.minecraft_armor_weapon.bakuhatu": "explosion",
"effect.minecraft_armor_weapon.aaaa": "bunnsinn",
Expand All @@ -9388,8 +9404,8 @@
"block.minecraft_armor_weapon.stone_bricks_trap_door": "Stone Bricks Trap Door",
"item.minecraft_armor_weapon.dragon_black_armor_helmet": "§8Dragon black helmet",
"item.minecraft_armor_weapon.stone_katana": "§7石の刀",
"item.minecraft_armor_weapon.kaminari_kurikaraken_sword": "Kaminari Kurikaraken Sword",
"item.minecraft_armor_weapon.kurikarakensword": "§5倶利伽羅剣",
"item.minecraft_armor_weapon.kaminari_kurikaraken_sword": "Kaminari Kurikaraken Sword",
"item.minecraft_armor_weapon.wind_step": "§2Windstep",
"item.minecraft_armor_weapon.scythe": "Scythe",
"item.minecraft_armor_weapon.a": "A",
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/minecraftarmorweapon/item/LunaItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public InteractionResultHolder<ItemStack> use(Level world, Player entity, Intera
@Override
public boolean onEntitySwing(ItemStack itemstack, LivingEntity entity) {
boolean retval = super.onEntitySwing(itemstack, entity);
LunaenteiteigaaitemuwoZhentutaShiProcedure.execute(entity);
LunaenteiteigaaitemuwoZhentutaShiProcedure.execute(entity.level, entity.getX(), entity.getY(), entity.getZ(), entity);
return retval;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
package minecraftarmorweapon.procedures;

import net.minecraft.world.phys.Vec3;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.core.BlockPos;
import net.minecraft.commands.CommandSourceStack;
import net.minecraft.commands.CommandSource;

import minecraftarmorweapon.init.MinecraftArmorWeaponModMobEffects;
import minecraftarmorweapon.init.MinecraftArmorWeaponModItems;
import minecraftarmorweapon.init.MinecraftArmorWeaponModEnchantments;

import minecraftarmorweapon.entity.SkeltonMobEntity;
import minecraftarmorweapon.entity.OtiruyoEntity;

import java.util.stream.Collectors;
import java.util.List;
import java.util.Comparator;

public class LunaenteiteigaaitemuwoZhentutaShiProcedure {
public static void execute(Entity entity) {
public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
if (entity == null)
return;
double r = 0;
Expand All @@ -31,16 +49,73 @@ public static void execute(Entity entity) {
if (MinecraftArmorWeaponModItems.LUNA.get() == (entity instanceof LivingEntity _livEnt ? _livEnt.getOffhandItem() : ItemStack.EMPTY).getItem()
|| MinecraftArmorWeaponModItems.LUNA.get() == (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem()) {
if (!(entity instanceof LivingEntity _livEnt ? _livEnt.hasEffect(MinecraftArmorWeaponModMobEffects.WAZA.get()) : false)) {
if (entity instanceof LivingEntity _entity)
_entity.setHealth((float) ((entity instanceof LivingEntity _livEnt ? _livEnt.getHealth() : -1) + 19));
if (entity instanceof Player _player)
_player.getFoodData().setSaturation((float) ((entity instanceof Player _plr ? _plr.getFoodData().getFoodLevel() : 0) + 19));
if (entity instanceof Player _player)
_player.getFoodData().setFoodLevel((int) ((entity instanceof Player _plr ? _plr.getFoodData().getSaturationLevel() : 0) + 19));
if (entity instanceof LivingEntity _entity && !_entity.level.isClientSide())
_entity.addEffect(new MobEffectInstance(MinecraftArmorWeaponModMobEffects.WAZA.get(), 15, 1, true, false));
if (entity instanceof Player _player)
_player.getCooldowns().addCooldown((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem(), 15);
r = 1;
alpha = entity.getYRot();
beta = entity.getXRot();
{
Entity _ent = entity;
if (!_ent.level.isClientSide() && _ent.getServer() != null) {
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(), _ent.level instanceof ServerLevel ? (ServerLevel) _ent.level : null, 4,
_ent.getName().getString(), _ent.getDisplayName(), _ent.level.getServer(), _ent), "particle minecraft:enchanted_hit ^ ^ ^1 0.5 0.5 0.5 .0 20 force @p");
}
}
{
Entity _ent = entity;
if (!_ent.level.isClientSide() && _ent.getServer() != null) {
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(), _ent.level instanceof ServerLevel ? (ServerLevel) _ent.level : null, 4,
_ent.getName().getString(), _ent.getDisplayName(), _ent.level.getServer(), _ent), "particle minecraft:end_rod ^ ^ ^ 1 1 1 .0 5 force @p");
}
}
for (int index0 = 0; index0 < 100; index0++) {
{
final Vec3 _center = new Vec3((x - r * Math.cos(Math.toRadians(beta)) * Math.sin(Math.toRadians(alpha))), ((y + 1) - r * Math.sin(Math.toRadians(beta))),
(z + r * Math.cos(Math.toRadians(beta)) * Math.cos(Math.toRadians(alpha))));
List<Entity> _entfound = world.getEntitiesOfClass(Entity.class, new AABB(_center, _center).inflate(0.5 / 2d), e -> true).stream().sorted(Comparator.comparingDouble(_entcnd -> _entcnd.distanceToSqr(_center)))
.collect(Collectors.toList());
for (Entity entityiterator : _entfound) {
if (!(entityiterator == entity)) {
if (!(entityiterator instanceof OtiruyoEntity)) {
if (!(entityiterator instanceof SkeltonMobEntity)) {
if (entityiterator instanceof LivingEntity) {
if (EnchantmentHelper.getItemEnchantmentLevel(MinecraftArmorWeaponModEnchantments.KILL.get(), (entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY)) != 0) {
{
Entity _ent = entityiterator;
if (!_ent.level.isClientSide() && _ent.getServer() != null) {
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(),
_ent.level instanceof ServerLevel ? (ServerLevel) _ent.level : null, 4, _ent.getName().getString(), _ent.getDisplayName(), _ent.level.getServer(), _ent), "/kill @s");
}
}
{
Entity _ent = entityiterator;
if (!_ent.level.isClientSide() && _ent.getServer() != null) {
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(),
_ent.level instanceof ServerLevel ? (ServerLevel) _ent.level : null, 4, _ent.getName().getString(), _ent.getDisplayName(), _ent.level.getServer(), _ent),
"/deta merge entity @s (Health:0)");
}
}
} else {
entityiterator.hurt(DamageSource.GENERIC, 5);
}
}
}
}
}
}
}
if (world instanceof ServerLevel _level)
_level.sendParticles(ParticleTypes.END_ROD, (x - r * Math.cos(Math.toRadians(beta)) * Math.sin(Math.toRadians(alpha))), ((y + 1) - r * Math.sin(Math.toRadians(beta))),
(z + r * Math.cos(Math.toRadians(beta)) * Math.cos(Math.toRadians(alpha))), 2, 0.1, 0.1, 0.1, 0);
if (world
.getBlockState(new BlockPos(x - r * Math.cos(Math.toRadians(beta)) * Math.sin(Math.toRadians(alpha)), (y + 2) - r * Math.sin(Math.toRadians(beta)), z + r * Math.cos(Math.toRadians(beta)) * Math.cos(Math.toRadians(alpha))))
.canOcclude()) {
break;
}
r = r + 0.2;
if (entity instanceof Player _player)
_player.getCooldowns().addCooldown((entity instanceof LivingEntity _livEnt ? _livEnt.getMainHandItem() : ItemStack.EMPTY).getItem(), 15);
}
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/assets/minecraft_armor_weapon/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"itemGroup.tabmagic_books": "Magic Books",
"itemGroup.tabyopkeinamono": "建築とかに",
"effect.minecraft_armor_weapon.syugeki": "aa",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.illusioner_armor_boots": "Illusioner Armor Boots",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.ruami_284_spawn_egg": "ruami284 Spawn Egg",
"entity.minecraft_armor_weapon.comet": "Comet",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"effect.minecraft_armor_weapon.bow_attack": "illusioner_armor_effect",
"entity.minecraft_armor_weapon.comet_kill": "Comet",
"effect.minecraft_armor_weapon.bow_attack": "illusioner_armor_effect",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"block.minecraft_armor_weapon.stone_katana_block": "Netherite Katana Block",
"item.minecraft_armor_weapon.blackhole_spawn_egg": "Blackhole Spawn Egg",
"entity.minecraft_armor_weapon.blackhole": "Blackhole",
"advancements.magical_swordsman_achievements.descr": "§eGet Magisches feen katana",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"effect.minecraft_armor_weapon.suityuu": "suityuu",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"advancements.you_have_become_a_vampire.descr": "You have become a vampire.",
"effect.minecraft_armor_weapon.bakuhatu": "explosion",
"effect.minecraft_armor_weapon.aaaa": "bunnsinn",
Expand All @@ -37,8 +37,8 @@
"block.minecraft_armor_weapon.stone_bricks_trap_door": "Stone Bricks Trap Door",
"item.minecraft_armor_weapon.stone_katana": "§7Stone Katana",
"item.minecraft_armor_weapon.dragon_black_armor_helmet": "§8Dragon black helmet",
"item.minecraft_armor_weapon.kurikarakensword": "§5倶利伽羅剣",
"item.minecraft_armor_weapon.kaminari_kurikaraken_sword": "Kaminari Kurikaraken Sword",
"item.minecraft_armor_weapon.kurikarakensword": "§5倶利伽羅剣",
"item.minecraft_armor_weapon.scythe": "Scythe",
"item.minecraft_armor_weapon.wind_step": "§2Windstep",
"item.minecraft_armor_weapon.a": "A",
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/assets/minecraft_armor_weapon/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"itemGroup.tabmagic_books": "Magic Books",
"itemGroup.tabyopkeinamono": "建築とかに",
"effect.minecraft_armor_weapon.syugeki": "aa",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.illusioner_armor_boots": "Illusioner Armor Boots",
"item.minecraft_armor_weapon.das_herz_einer_fee_armor_helmet": "das herz einer fee armor helmet",
"item.minecraft_armor_weapon.ruami_284_spawn_egg": "ruami284 Spawn Egg",
"entity.minecraft_armor_weapon.comet": "Comet",
"entity.minecraft_armor_weapon.comet_kill": "Comet",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"effect.minecraft_armor_weapon.bow_attack": "illusioner_armor_effect",
"item.minecraft_armor_weapon.darkness": "§5Darkness",
"entity.minecraft_armor_weapon.comet_kill": "Comet",
"block.minecraft_armor_weapon.stone_katana_block": "Netherite Katana Block",
"item.minecraft_armor_weapon.blackhole_spawn_egg": "Blackhole Spawn Egg",
"entity.minecraft_armor_weapon.blackhole": "Blackhole",
"advancements.magical_swordsman_achievements.descr": "Magisches feen katanaを得る",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"effect.minecraft_armor_weapon.suityuu": "suityuu",
"entity.minecraft_armor_weapon.ruami_284": "ruami284",
"advancements.you_have_become_a_vampire.descr": "吸血鬼になったよ",
"effect.minecraft_armor_weapon.bakuhatu": "explosion",
"effect.minecraft_armor_weapon.aaaa": "bunnsinn",
Expand All @@ -37,8 +37,8 @@
"block.minecraft_armor_weapon.stone_bricks_trap_door": "Stone Bricks Trap Door",
"item.minecraft_armor_weapon.dragon_black_armor_helmet": "§8Dragon black helmet",
"item.minecraft_armor_weapon.stone_katana": "§7石の刀",
"item.minecraft_armor_weapon.kaminari_kurikaraken_sword": "Kaminari Kurikaraken Sword",
"item.minecraft_armor_weapon.kurikarakensword": "§5倶利伽羅剣",
"item.minecraft_armor_weapon.kaminari_kurikaraken_sword": "Kaminari Kurikaraken Sword",
"item.minecraft_armor_weapon.wind_step": "§2Windstep",
"item.minecraft_armor_weapon.scythe": "Scythe",
"item.minecraft_armor_weapon.a": "A",
Expand Down

0 comments on commit 92ff24b

Please sign in to comment.