forked from SteamWar/SteamWar
Merge remote-tracking branch 'origin/ReflectionReduction' into Refactor/remove-old-dependencies
This commit is contained in:
@@ -98,13 +98,7 @@ public class FightSystem extends JavaPlugin {
|
||||
new StateDependentListener(ArenaMode.All, FightState.All, BountifulWrapper.impl.newDenyArrowPickupListener());
|
||||
new OneShotStateDependent(ArenaMode.All, FightState.PreSchemSetup, () -> Fight.playSound(SWSound.BLOCK_NOTE_PLING.getSound(), 100.0f, 2.0f));
|
||||
new OneShotStateDependent(ArenaMode.Test, FightState.All, WorldEditRendererCUIEditor::new);
|
||||
if (Core.getVersion() >= 19) {
|
||||
try {
|
||||
Bukkit.getWorlds().get(0).setGameRule(GameRule.REDUCED_DEBUG_INFO, ArenaMode.AntiTest.contains(Config.mode));
|
||||
} catch (Exception e) {
|
||||
// Ignore if failed!
|
||||
}
|
||||
}
|
||||
Config.world.setGameRule(GameRule.REDUCED_DEBUG_INFO, ArenaMode.AntiTest.contains(Config.mode));
|
||||
|
||||
techHider = new TechHiderWrapper();
|
||||
hullHider = new HullHider();
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
package de.steamwar.fightsystem.fight;
|
||||
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.record.GlobalRecorder;
|
||||
@@ -84,10 +83,7 @@ public class Fight {
|
||||
public static void playSound(Sound sound, float volume, float pitch) {
|
||||
GlobalRecorder.getInstance().soundAtPlayer(sound.name(), volume, pitch);
|
||||
//volume: max. 100, pitch: max. 2
|
||||
if(Core.getVersion() >= 18)
|
||||
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.playSound(player, sound, volume, pitch));
|
||||
else
|
||||
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.playSound(player.getLocation(), sound, volume, pitch));
|
||||
Bukkit.getServer().getOnlinePlayers().forEach(player -> player.playSound(player, sound, volume, pitch));
|
||||
}
|
||||
|
||||
public static FightTeam getTeamByName(String name) {
|
||||
|
||||
+1
-2
@@ -19,7 +19,6 @@
|
||||
|
||||
package de.steamwar.fightsystem.fight;
|
||||
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.fightsystem.ArenaMode;
|
||||
import de.steamwar.fightsystem.listener.PersonalKitCreator;
|
||||
import de.steamwar.fightsystem.states.FightState;
|
||||
@@ -51,7 +50,7 @@ public class HotbarKitListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void handlePlayerInteract(PlayerInteractEvent event) {
|
||||
if (event.getAction() == Action.PHYSICAL || (Core.getVersion() > 8 && event.getHand() != EquipmentSlot.HAND))
|
||||
if (event.getAction() == Action.PHYSICAL || event.getHand() != EquipmentSlot.HAND)
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
+1
-3
@@ -20,7 +20,6 @@
|
||||
package de.steamwar.fightsystem.listener;
|
||||
|
||||
import com.comphenix.tinyprotocol.TinyProtocol;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.fightsystem.Config;
|
||||
import de.steamwar.fightsystem.utils.CraftbukkitWrapper;
|
||||
import de.steamwar.linkage.Linked;
|
||||
@@ -44,8 +43,7 @@ public class ClickAnalyzer {
|
||||
|
||||
public ClickAnalyzer() {
|
||||
TinyProtocol.instance.addFilter(Recording.blockPlacePacket, this::onBlockPlace);
|
||||
if(Core.getVersion() > 8)
|
||||
TinyProtocol.instance.addFilter(ServerboundUseItemOnPacket.class, this::onBlockPlace);
|
||||
TinyProtocol.instance.addFilter(ServerboundUseItemOnPacket.class, this::onBlockPlace);
|
||||
}
|
||||
|
||||
public Object onBlockPlace(Player player, Object packet) {
|
||||
|
||||
Reference in New Issue
Block a user