Skip to content

Commit

Permalink
EliteMobs 9.1.4:
Browse files Browse the repository at this point in the history
- [New] Players can no longer open doors and trapdoors in elite worlds, as intended by the map design
- [New] Added debug field to scripts to show a debug particle at the target location of scripts
- [New] Landing location is now inherited through scripts
- [New] Elite slimes no longer split when killed, fixing a number of bugs
- [New] Fixed arena farming being too efficient by both tweaking rewards but also applying all limiters that exist in other elitemobs content to arenas (minimum guild rank requirements for looting from certain levels, maximum difference between player level and mob level)
- [Fix] Fixed problem with reinforcement power in arena fights
- [Fix] Language command now switches back to english correctly
- [Fix] Teleporting directly to a dungeon via teleports page no longer risks being sent back via wormhole
- [Fix] Fixed several problems that made FinalTarget script targets not behave the same way as normal targets are supposed to
- [Fix] Elite silverfish can no longer enter blocks
- [Fix] Fixed guild request text for bedrock-compatible menus
- [Fix] Fixed all default wormhole locations
- [Fix] Now using a more appropriate api version of FreeMinecraftModels

Signed-off-by: MagmaGuy <tiagoarnaut@gmail.com>
  • Loading branch information
MagmaGuy committed Aug 22, 2024
1 parent 8843707 commit 3e69cdc
Show file tree
Hide file tree
Showing 317 changed files with 1,220 additions and 973 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ processResources {
}

group 'com.magmaguy'
version '9.1.3'
version '9.1.4'

repositories {
maven {
Expand Down Expand Up @@ -105,7 +105,7 @@ dependencies {
//Model Engine - legacy
compileOnly "com.ticxo.modelengine:api:R3.1.7"
//Free Minecraft Models
compileOnly group: 'com.magmaguy', name: 'FreeMinecraftModels', version: '1.3.0-SNAPSHOT'
compileOnly group: 'com.magmaguy', name: 'FreeMinecraftModels', version: '1.4.2'
// Mythic Mobs integration - currently only for arenas
compileOnly group: 'io.lumine', name: 'Mythic-Dist', version: '5.3.5'

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/magmaguy/elitemobs/EventsRegistrer.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ public static void registerEvents() {
register(new AlternativeDurabilityLoss());
register(new EnderCrystalDamageProtectionBypass());
register(new NPCsBecomeWitches());
register(new PreventEliteSilverfishBlockEnter());


//Antiexploits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import org.bukkit.inventory.meta.ItemMeta;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;

public class GuildRankMenuHandler implements Listener {

private static final HashSet<Inventory> inventories = new HashSet<>();
private static final ArrayList<Integer> rankSlots = new ArrayList<>(Arrays.asList(
4, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 29, 30, 31, 32, 33, 38, 39, 40, 41, 42));
private static final ArrayList<Integer> rankSlots = new ArrayList<>(new ArrayList<>(List.of(
4, 11, 12, 13, 14, 15, 20, 21, 22, 23, 24, 29, 30, 31, 32, 33, 38, 39, 40, 41, 42)));
private static final int prestigeRankSlot = 49;

private static void selectUnlockedRank(Player player, int guildRank) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.bukkit.inventory.meta.Damageable;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class AlternativeDurabilityLoss implements Listener {

Expand All @@ -41,7 +41,7 @@ private static boolean isOnLastDamage(ItemStack itemStack) {

public static void doDurabilityLoss(Player player) {
if (!ItemSettingsConfig.isEliteDurability()) return;
ArrayList<ItemStack> itemsList = new ArrayList<>(Arrays.asList(player.getInventory().getArmorContents()));
ArrayList<ItemStack> itemsList = new ArrayList<>(new ArrayList<>(List.of(player.getInventory().getArmorContents())));
itemsList.add(player.getInventory().getItemInMainHand());
itemsList.add(player.getInventory().getItemInOffHand());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,14 @@
package com.magmaguy.elitemobs.collateralminecraftchanges;

import com.magmaguy.elitemobs.api.EliteMobDeathEvent;
import com.magmaguy.elitemobs.config.powers.PowersConfigFields;
import com.magmaguy.elitemobs.mobconstructor.EliteEntity;
import com.magmaguy.elitemobs.mobconstructor.mobdata.aggressivemobs.EliteMobProperties;
import com.magmaguy.elitemobs.thirdparty.worldguard.WorldGuardSpawnEventBypasser;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.MagmaCube;
import org.bukkit.entity.Slime;
import com.magmaguy.elitemobs.entitytracker.EntityTracker;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;

import java.util.HashSet;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.event.entity.SlimeSplitEvent;

public class EliteSlimeDeathSplit implements Listener {
@EventHandler
public void EliteMobDeathEvent(EliteMobDeathEvent event) {
if (!event.getEntity().getType().equals(EntityType.SLIME) &&
!event.getEntity().getType().equals(EntityType.MAGMA_CUBE)) return;
Slime slime = (Slime) event.getEntity();
int size = slime.getSize() / 2;
if (size < 1) return;
slime.setSize(1);
for (int i = 0; i < ThreadLocalRandom.current().nextInt(2) + 2; i++) {
WorldGuardSpawnEventBypasser.forceSpawn();
Slime newSlime;
if (event.getEntity().getType() == EntityType.SLIME)
newSlime = (Slime) slime.getLocation().getWorld().spawnEntity(slime.getLocation(), EntityType.SLIME);
else
newSlime = (MagmaCube) slime.getLocation().getWorld().spawnEntity(slime.getLocation(), EntityType.MAGMA_CUBE);
newSlime.setSize(size);
EliteEntity eliteEntity = new EliteEntity();
eliteEntity.setLevel(event.getEliteEntity().getLevel());
eliteEntity.setLivingEntity(newSlime, CreatureSpawnEvent.SpawnReason.SLIME_SPLIT);
EliteMobProperties.getPluginData(EntityType.SLIME);
eliteEntity.setDamageMultiplier(eliteEntity.getDamageMultiplier() / 2D);
eliteEntity.setHealthMultiplier(eliteEntity.getHealthMultiplier() / 2D);
eliteEntity.setVanillaLoot(event.getEliteEntity().isVanillaLoot());
eliteEntity.setEliteLoot(event.getEliteEntity().isEliteLoot());
eliteEntity.setRandomLoot(event.getEliteEntity().isRandomLoot());

//refreshes the max health
eliteEntity.setMaxHealth();
HashSet<PowersConfigFields> powersConfigFields = new HashSet<>();
event.getEliteEntity().getElitePowers().forEach(elitePower -> {
if (elitePower.getPowersConfigFields() instanceof PowersConfigFields powersConfigFields1)
powersConfigFields.add(powersConfigFields1);
});
eliteEntity.applyPowers(powersConfigFields);
}
@EventHandler (ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void SlimeSplitEvent(SlimeSplitEvent event){
if (EntityTracker.isEliteMob(event.getEntity())) event.setCancelled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.magmaguy.elitemobs.dungeons.WorldInstancedDungeonPackage;
import com.magmaguy.elitemobs.instanced.MatchInstance;
import com.magmaguy.elitemobs.menus.InstancedDungeonBrowser;
import com.magmaguy.elitemobs.wormhole.Wormhole;
import org.bukkit.entity.Player;

public class DungeonCommands {
Expand All @@ -24,8 +25,10 @@ public static void teleport(Player player, String minidungeonName) {
if (emPackage instanceof WorldInstancedDungeonPackage)
new InstancedDungeonBrowser(player, emPackage.getDungeonPackagerConfigFields().getFilename());
else {
if (emPackage.getDungeonPackagerConfigFields().getTeleportLocation() != null)
if (emPackage.getDungeonPackagerConfigFields().getTeleportLocation() != null) {
PlayerPreTeleportEvent.teleportPlayer(player, emPackage.getDungeonPackagerConfigFields().getTeleportLocation());
Wormhole.addPlayerToCooldowns(player);
}
else
player.sendMessage("[EliteMobs] Can't teleport you to the dungeon because the teleport location isn't set!" +
" Ask an admin to reinstall the dungeon!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
import com.magmaguy.magmacore.command.CommandData;
import com.magmaguy.magmacore.util.Logger;

import java.util.ArrayList;
import java.util.List;

public class LanguageCommand extends AdvancedCommand {
public LanguageCommand() {
super(List.of("language"));
addArgument("language", TranslationsConfig.getTranslationConfigs().keySet().stream().toList());
List<String> suggestions = new ArrayList<>(TranslationsConfig.getTranslationConfigs().keySet().stream().toList());
suggestions.add("english");
addArgument("language", suggestions);
setUsage("/em language <filename>");
setPermission("elitemobs.language");
setDescription("Sets the language that the server will use for EliteMobs, based on a translation file in the translation files.");
Expand All @@ -20,7 +23,7 @@ public LanguageCommand() {
@Override
public void execute(CommandData commandData) {
String language = commandData.getStringArgument("language");
if (!TranslationsConfig.getTranslationConfigs().containsKey(language)) {
if (!TranslationsConfig.getTranslationConfigs().containsKey(language) && !language.equals("english")) {
Logger.sendMessage(commandData.getCommandSender(), "Language not found. Valid languages:");
TranslationsConfig.getTranslationConfigs().keySet().forEach(key -> Logger.sendMessage(commandData.getCommandSender(), key));
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import com.magmaguy.magmacore.command.CommandData;
import com.magmaguy.magmacore.command.SenderType;

import java.util.ArrayList;
import java.util.List;

public class QuestLeaveCommand extends AdvancedCommand {
public QuestLeaveCommand() {
super(List.of("quest"));
addLiteral("leave");
addArgument("questID", new ArrayList<>());
setUsage("/em quest leave");
setPermission("elitemobs.quest.leave");
setSenderType(SenderType.PLAYER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public SpawnBossLevelCommand() {
super(List.of("spawn"));
addLiteral("boss");
addArgument("filename", new ArrayList<>(CustomBossesConfig.getCustomBosses().keySet()));
addArgument("level", List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19));
addArgument("level", List.of("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"));
setUsage("/em spawn boss <filename> <level>");
setPermission("elitemobs.place.admin");
setSenderType(SenderType.PLAYER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public class SetupMenu {
private final int previousIcon = 27;
Inventory inventory;
Player player;
ArrayList<Integer> validSlots = new ArrayList<>(Arrays.asList(10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23,
24, 25, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 41, 42, 43, 46, 47, 48, 49, 50, 51, 52));
ArrayList<Integer> validSlots = new ArrayList<>(new ArrayList<>(List.of(10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23,
24, 25, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 41, 42, 43, 46, 47, 48, 49, 50, 51, 52)));
HashMap<Integer, EMPackage> minidungeonHashMap = new HashMap<>();
@Getter
private int currentPage = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.magmaguy.magmacore.util.ChatColorConverter;
import lombok.Getter;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;

public class ItemSettingsConfig extends ConfigurationFile {
Expand Down Expand Up @@ -156,7 +156,7 @@ public void initializeValues() {
"$potionEffects - shows the potion effects on the item",
"$loreResaleValue - shows the value of the item. Might show the purchase or sell price depending on where it is viewed",
"Important: Several of the placeholders can be further customized by the configuration settings further below"),
file, fileConfiguration, "itemLoreStructureV2", Arrays.asList(
file, fileConfiguration, "itemLoreStructureV2", new ArrayList<>(List.of(
ChatColorConverter.convert("&7&m&l---------&7<&lEquip Info&7>&m&l---------"),
ChatColorConverter.convert("&7Item level: &f$itemLevel &7Prestige &6$prestigeLevel"),
ChatColorConverter.convert("$weaponOrArmorStats"),
Expand All @@ -173,7 +173,7 @@ public void initializeValues() {
ChatColorConverter.convert("$potionEffect"),
ChatColorConverter.convert("&7&l&m-----------------------------"),
ChatColorConverter.convert("$loreResaleValue")
), true);
)), true);
shopItemSource = ConfigurationEngine.setString(
List.of("Sets the shop source lore for store purchased"),
file, fileConfiguration, "shopSourceItemLores", "&7Purchased from a store", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.bukkit.Material;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ProceduralItemGenerationSettingsConfig extends ConfigurationFile {
Expand Down Expand Up @@ -154,17 +153,17 @@ public void initializeValues() {
tridentName = ConfigurationEngine.setString(file, fileConfiguration, "materialNames.trident", "Trident", true);
crossbowName = ConfigurationEngine.setString(file, fileConfiguration, "materialNames.crossbow", "Crossbow", true);

nameFormat = ConfigurationEngine.setList(file, fileConfiguration, "nameFormats", Arrays.asList(
nameFormat = ConfigurationEngine.setList(file, fileConfiguration, "nameFormats", new ArrayList<>(List.of(
"$verb $itemType of the $adjective $noun",
"$itemType of the $adjective $noun",
"$noun's $adjective $verb $itemType",
"$verb $itemType",
"$adjective $verb $itemType",
"The $verb-er",
"The $adjective $verb-er"
), true);
)), true);

nouns = ConfigurationEngine.setList(file, fileConfiguration, "nouns", Arrays.asList(
nouns = ConfigurationEngine.setList(file, fileConfiguration, "nouns", new ArrayList<>(List.of(
"MagmaGuy",
"Dawn",
"Sunset",
Expand Down Expand Up @@ -455,9 +454,9 @@ public void initializeValues() {
"Rakshasa",
"Revenant",
"Cultist"
), true);
)), true);

adjectives = ConfigurationEngine.setList(file, fileConfiguration, "adjectives", Arrays.asList(
adjectives = ConfigurationEngine.setList(file, fileConfiguration, "adjectives", new ArrayList<>(List.of(
"Adorable",
"Beautiful",
"Clean",
Expand Down Expand Up @@ -984,9 +983,9 @@ public void initializeValues() {
"Trusting",
"Unassuming",
"Threatening"
), true);
)), true);

verbs = ConfigurationEngine.setList(file, fileConfiguration, "verbs", Arrays.asList(
verbs = ConfigurationEngine.setList(file, fileConfiguration, "verbs", new ArrayList<>(List.of(
"Slashing",
"Cutting",
"Stabbing",
Expand Down Expand Up @@ -1248,9 +1247,9 @@ public void initializeValues() {
"Spying",
"Avenging",
"Storming"
), true);
)), true);

verbers = ConfigurationEngine.setList(file, fileConfiguration, "verb-ers (noun)", Arrays.asList(
verbers = ConfigurationEngine.setList(file, fileConfiguration, "verb-ers (noun)", new ArrayList<>(List.of(
"World Breaker",
"World Shatterer",
"Avenger",
Expand Down Expand Up @@ -1459,7 +1458,7 @@ public void initializeValues() {
"Snorer",
"Thruster",
"Slapper"
), true);
)), true);

MaterialGenerator.initializeValidProceduralMaterials();
}
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/com/magmaguy/elitemobs/config/QuestsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class QuestsConfig extends ConfigurationFile {
Expand Down Expand Up @@ -110,7 +109,7 @@ public QuestsConfig() {
}

private static List<EntityType> setEntityTypes(FileConfiguration fileConfiguration, File file) {
List<String> entityTypes = new ArrayList<>(Arrays.asList(
List<String> entityTypes = new ArrayList<>(new ArrayList<>(List.of(
EntityType.BLAZE.toString(),
EntityType.CAVE_SPIDER.toString(),
EntityType.DROWNED.toString(),
Expand All @@ -134,14 +133,14 @@ private static List<EntityType> setEntityTypes(FileConfiguration fileConfigurati
EntityType.WITHER_SKELETON.toString(),
EntityType.WOLF.toString(),
EntityType.ZOMBIE.toString()
));
)));

List<String> laterEntities = Arrays.asList(
List<String> laterEntities = new ArrayList<>(List.of(
EntityType.HOGLIN.toString(),
EntityType.ZOGLIN.toString(),
EntityType.PIGLIN_BRUTE.toString(),
EntityType.PIGLIN.toString(),
EntityType.ZOMBIFIED_PIGLIN.toString());
EntityType.ZOMBIFIED_PIGLIN.toString()));
entityTypes.addAll(laterEntities);

ConfigurationEngine.setList(file, fileConfiguration, "questEntityTypes", entityTypes, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class CommandsConfig {

private static final ArrayList<CommandsConfigFields> commandsConfigFields = new ArrayList<>(Arrays.asList(
private static final ArrayList<CommandsConfigFields> commandsConfigFields = new ArrayList<>(new ArrayList<>(List.of(
new CheckTierConfig(),
new CheckTierOthersConfig()
));
)));

private CommandsConfig() {

Expand Down
Loading

0 comments on commit 3e69cdc

Please sign in to comment.