Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Intybyte committed Jul 30, 2024
1 parent 6085cc5 commit 8f3036c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void onEnable() {
Settings.DisableNMSCompatibilityCheck = getConfig().getBoolean("IReallyKnowWhatIAmDoing", false);
Settings.DisableSpillProtection = getConfig().getBoolean("DisableSpillProtection", false);
Settings.DisableIceForm = getConfig().getBoolean("DisableIceForm", true);
Settings.ReleaseOnDeath = getConfig().getBoolean("ReleaseOnDeath", false);

String[] localisations = {"en", "cz", "nl", "fr"};
for (String s : localisations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import net.countercraft.movecraft.config.Settings;
import net.countercraft.movecraft.craft.Craft;
import net.countercraft.movecraft.craft.CraftManager;
import net.countercraft.movecraft.craft.PlayerCraft;
import net.countercraft.movecraft.craft.type.CraftType;
import net.countercraft.movecraft.events.CraftReleaseEvent;
import net.countercraft.movecraft.localisation.I18nSupport;
Expand All @@ -32,15 +31,13 @@
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;

import java.util.EnumSet;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.WeakHashMap;

Expand Down Expand Up @@ -102,12 +99,13 @@ public void onPlayerLogout(PlayerQuitEvent e) {
}

@EventHandler
public void onPlayerDeath(EntityDamageByEntityEvent e) {
public void onPlayerDeath(PlayerDeathEvent e) {
// changed to death so when you shoot up an airship and hit the pilot, it still sinks
if (!(e instanceof Player))

if (!Settings.ReleaseOnDeath)
return;

Player p = (Player) e;
Player p = e.getPlayer();
Craft craft = CraftManager.getInstance().getCraftByPlayer(p);
if (craft == null)
return;
Expand Down
1 change: 1 addition & 0 deletions Movecraft/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ExtraFadeTimePerBlock: # List of blocks that will take longer time to fade
DROPPER: 600
FURNACE: 600
CollisionPrimer: 1000
ReleaseOnDeath: false
ForbiddenRemoteSigns: # These strings will be ignored when searching for signs to trigger from a remote sign
- "Mounted"
- "Denied"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@

import org.bukkit.Material;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;

public class Settings {
Expand All @@ -48,4 +46,5 @@ public class Settings {
public static int MaxRemoteSigns = -1;
public static boolean CraftsUseNetherPortals = false;
public static HashSet<String> ForbiddenRemoteSigns;
public static boolean ReleaseOnDeath = false;
}

0 comments on commit 8f3036c

Please sign in to comment.