diff --git a/src/main/java/com/nexia/core/commands/staff/dev/ProtectionMapCommand.java b/src/main/java/com/nexia/core/commands/staff/dev/ProtectionMapCommand.java index d8bd4283..05d6d056 100644 --- a/src/main/java/com/nexia/core/commands/staff/dev/ProtectionMapCommand.java +++ b/src/main/java/com/nexia/core/commands/staff/dev/ProtectionMapCommand.java @@ -19,6 +19,7 @@ public static void register(CommandDispatcher dispatcher, bo .then(Commands.literal("bedwars").executes(ProtectionMapCommand::bedwars)) .then(Commands.literal("ffa") .then(Commands.literal("uhc").executes(ProtectionMapCommand::ffa_uhc)) + .then(Commands.literal("sky").executes(ProtectionMapCommand::ffa_sky)) ) ); } @@ -35,4 +36,9 @@ public static int ffa_uhc(CommandContext context) throws Com return 1; } + public static int ffa_sky(CommandContext context) throws CommandSyntaxException { + ServerPlayer player = context.getSource().getPlayerOrException(); + com.nexia.ffa.sky.utilities.FfaAreas.createProtectionMap(player); + return 1; + } } diff --git a/src/main/java/com/nexia/core/config/ModConfig.java b/src/main/java/com/nexia/core/config/ModConfig.java index e0f5f20e..e7049d9f 100644 --- a/src/main/java/com/nexia/core/config/ModConfig.java +++ b/src/main/java/com/nexia/core/config/ModConfig.java @@ -26,5 +26,8 @@ public static class Enhancements { @Comment("Remove Projectiles going through players [EXPERIMENTAL]") public boolean projectilePatch = false; + + @Comment("Fix Tridents doing 8 damage when thrown, instead of 6") + public boolean tridentDamagePatch = false; } } diff --git a/src/main/java/com/nexia/core/mixin/entity/EntityMixin.java b/src/main/java/com/nexia/core/mixin/entity/EntityMixin.java index 8bc27675..19201a87 100644 --- a/src/main/java/com/nexia/core/mixin/entity/EntityMixin.java +++ b/src/main/java/com/nexia/core/mixin/entity/EntityMixin.java @@ -1,6 +1,7 @@ package com.nexia.core.mixin.entity; import com.nexia.core.games.util.LobbyUtil; +import com.nexia.ffa.sky.utilities.FfaAreas; import net.minecraft.commands.CommandSource; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.Nameable; @@ -31,6 +32,13 @@ private void hurt(DamageSource damageSource, CallbackInfoReturnable cir private double modifyVoidY(Entity instance) { double voidY = -32; + if (instance.level instanceof ServerLevel serverLevel) { + + if (FfaAreas.isFfaWorld(serverLevel)) { + voidY = FfaAreas.getVoidY(); + } + } + return instance.getY() + 64 - voidY; } diff --git a/src/main/java/com/nexia/core/mixin/entity/ThrownTridentMixin.java b/src/main/java/com/nexia/core/mixin/entity/ThrownTridentMixin.java index 95b2afb2..f413ff25 100644 --- a/src/main/java/com/nexia/core/mixin/entity/ThrownTridentMixin.java +++ b/src/main/java/com/nexia/core/mixin/entity/ThrownTridentMixin.java @@ -1,6 +1,9 @@ package com.nexia.core.mixin.entity; +import com.nexia.core.Main; +import com.nexia.ffa.sky.utilities.FfaAreas; import com.nexia.minigames.games.bedwars.custom.BwTrident; +import net.minecraft.server.level.ServerLevel; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.projectile.AbstractArrow; @@ -34,9 +37,13 @@ public void tickDespawn(){ private float getDamageBonus(ItemStack itemStack, LivingEntity livingEntity) { float bonus = EnchantmentHelper.getDamageBonus(itemStack, livingEntity); + /* if ((Object)this instanceof BwTrident) { bonus -= 1; } + */ + + if(Main.config.enhancements.tridentDamagePatch) bonus -= 2; return bonus; } diff --git a/src/main/java/com/nexia/core/mixin/item/EnderPearlItemMixin.java b/src/main/java/com/nexia/core/mixin/item/EnderPearlItemMixin.java index 43d43e18..672565f5 100644 --- a/src/main/java/com/nexia/core/mixin/item/EnderPearlItemMixin.java +++ b/src/main/java/com/nexia/core/mixin/item/EnderPearlItemMixin.java @@ -33,7 +33,7 @@ public EnderPearlItemMixin(Item.Properties properties) { super(properties); } - @Inject(method = "use", at = @At(value = "HEAD")) + @Inject(method = "use", at = @At(value = "HEAD"), cancellable = true) private void setPlayer(Level level, Player player, InteractionHand interactionHand, CallbackInfoReturnable> cir) { if (player instanceof ServerPlayer serverPlayer) { thrower = serverPlayer; @@ -46,7 +46,6 @@ private void setPlayer(Level level, Player player, InteractionHand interactionHa } - } @ModifyArg(method = "use", index = 1, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemCooldowns;addCooldown(Lnet/minecraft/world/item/Item;I)V")) diff --git a/src/main/java/com/nexia/core/mixin/player/PlayerMixin.java b/src/main/java/com/nexia/core/mixin/player/PlayerMixin.java index 5f8a200c..cea12e53 100644 --- a/src/main/java/com/nexia/core/mixin/player/PlayerMixin.java +++ b/src/main/java/com/nexia/core/mixin/player/PlayerMixin.java @@ -143,7 +143,7 @@ private void drop1(boolean dropAll, CallbackInfoReturnable cir) { ItemStack dropped = inventory.getItem(inventory.selected); - if (FfaUtil.isFfaPlayer(player) && !FfaUhcUtil.isFfaPlayer(player)) { + if (FfaUtil.isFfaPlayer(player)) { cir.setReturnValue(false); return; } diff --git a/src/main/java/com/nexia/core/utilities/misc/EventUtil.java b/src/main/java/com/nexia/core/utilities/misc/EventUtil.java index 5bd19aa6..f2ec7fa9 100644 --- a/src/main/java/com/nexia/core/utilities/misc/EventUtil.java +++ b/src/main/java/com/nexia/core/utilities/misc/EventUtil.java @@ -22,7 +22,7 @@ public class EventUtil { public static boolean dropItem(Player player, ItemStack itemStack) { - return !(player.getTags().contains("ffa") || player.getTags().contains("ffa_classic") || player.getTags().contains("ffa_kits") || player.getTags().contains("ffa_sky")) || !LobbyUtil.isLobbyWorld(player.level) || !OitcGame.isOITCPlayer(player); + return !FfaUtil.isFfaPlayer(player) || !LobbyUtil.isLobbyWorld(player.level) || !OitcGame.isOITCPlayer(player); } public static void onSignClick(CallbackInfoReturnable ci, BlockPos signPos, Level level, ServerPlayer p) { @@ -38,6 +38,7 @@ public static void onSignClick(CallbackInfoReturnable ci, Blo if(bp.contains(signPos)) { SpawnGUI.openSpawnGUI(p); } + ci.setReturnValue(InteractionResult.PASS); } } diff --git a/src/main/java/com/nexia/ffa/classic/utilities/FfaClassicUtil.java b/src/main/java/com/nexia/ffa/classic/utilities/FfaClassicUtil.java index 0328262e..8395cba7 100644 --- a/src/main/java/com/nexia/ffa/classic/utilities/FfaClassicUtil.java +++ b/src/main/java/com/nexia/ffa/classic/utilities/FfaClassicUtil.java @@ -228,7 +228,7 @@ public static void setDeathMessage(@NotNull ServerPlayer minecraftPlayer, @Nulla } for (Player player : ServerTime.factoryServer.getPlayers()) { - if (player.hasTag("ffa_kits")) player.sendMessage(msg); + if (player.hasTag("ffa_classic")) player.sendMessage(msg); } } @@ -313,7 +313,8 @@ public static void leaveOrDie(@NotNull ServerPlayer player, @Nullable DamageSour static { invItems = new HashMap<>(); - ItemStack sword = new ItemStack(Items.NETHERITE_SWORD); + ItemStack sword = new ItemStack(Items.DIAMOND_SWORD); + sword.enchant(Enchantments.SHARPNESS, 1); sword.getOrCreateTag().putBoolean("Unbreakable", true); invItems.put(0, sword); @@ -321,7 +322,8 @@ public static void leaveOrDie(@NotNull ServerPlayer player, @Nullable DamageSour trident.getOrCreateTag().putBoolean("Unbreakable", true); invItems.put(1, trident); - ItemStack axe = new ItemStack(Items.NETHERITE_AXE); + ItemStack axe = new ItemStack(Items.DIAMOND_AXE); + axe.enchant(Enchantments.CLEAVING, 1); axe.getOrCreateTag().putBoolean("Unbreakable", true); invItems.put(2, axe); diff --git a/src/main/java/com/nexia/ffa/sky/utilities/FfaAreas.java b/src/main/java/com/nexia/ffa/sky/utilities/FfaAreas.java index 09a258ee..5ec277ef 100644 --- a/src/main/java/com/nexia/ffa/sky/utilities/FfaAreas.java +++ b/src/main/java/com/nexia/ffa/sky/utilities/FfaAreas.java @@ -20,11 +20,11 @@ public class FfaAreas { public static ServerLevel ffaWorld = null; public static EntityPos spawn = new EntityPos(Main.sky.spawnCoordinates[0], Main.sky.spawnCoordinates[1], Main.sky.spawnCoordinates[2], 0, 0); - public static BlockPos spawnCorner1 = spawn.toBlockPos().offset(-12, -12, -12); - public static BlockPos spawnCorner2 = spawn.toBlockPos().offset(12, 12, 12); + public static BlockPos spawnCorner1 = spawn.toBlockPos().offset(-6, -5, -6); + public static BlockPos spawnCorner2 = spawn.toBlockPos().offset(6, 5, 6); - public static BlockPos ffaCorner1 = spawn.toBlockPos().offset(99, -spawn.y, 132); - public static BlockPos ffaCorner2 = spawn.toBlockPos().offset(-100, spawn.y + 255, -98); + public static BlockPos ffaCorner1 = spawn.toBlockPos().offset(25, -spawn.y, 25); + public static BlockPos ffaCorner2 = spawn.toBlockPos().offset(-25, spawn.y + 255, -25); public FfaAreas() { } diff --git a/src/main/java/com/nexia/ffa/sky/utilities/FfaSkyUtil.java b/src/main/java/com/nexia/ffa/sky/utilities/FfaSkyUtil.java index 8714fb03..d389d2a5 100644 --- a/src/main/java/com/nexia/ffa/sky/utilities/FfaSkyUtil.java +++ b/src/main/java/com/nexia/ffa/sky/utilities/FfaSkyUtil.java @@ -448,7 +448,7 @@ private static ItemStack gApplePotion() { potion.getOrCreateTag().putInt("CustomPotionColor", 16771584); ArrayList effects = new ArrayList<>(); - effects.add(new MobEffectInstance(MobEffects.REGENERATION, 80, 2)); + effects.add(new MobEffectInstance(MobEffects.REGENERATION, 100, 1)); effects.add(new MobEffectInstance(MobEffects.ABSORPTION, 2400, 0)); PotionUtils.setCustomEffects(potion, effects); diff --git a/src/main/java/com/nexia/ffa/uhc/utilities/FfaUhcUtil.java b/src/main/java/com/nexia/ffa/uhc/utilities/FfaUhcUtil.java index 01b9321a..134caa05 100644 --- a/src/main/java/com/nexia/ffa/uhc/utilities/FfaUhcUtil.java +++ b/src/main/java/com/nexia/ffa/uhc/utilities/FfaUhcUtil.java @@ -239,7 +239,7 @@ public static void leaveOrDie(@NotNull ServerPlayer player, @Nullable DamageSour } public static boolean canGoToSpawn(ServerPlayer player) { - if(!FfaUhcUtil.isFfaPlayer(player) || FfaUhcUtil.wasInSpawn.contains(player.getUUID())) return true; + if(FfaUhcUtil.isFfaPlayer(player) || FfaUhcUtil.wasInSpawn.contains(player.getUUID())) return true; return !(player.getHealth() < 20); }