-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- [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
Showing
317 changed files
with
1,220 additions
and
973 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 6 additions & 47 deletions
53
src/main/java/com/magmaguy/elitemobs/collateralminecraftchanges/EliteSlimeDeathSplit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.