Commits vergleichen
74 Commits
ModularBau
...
master
Autor | SHA1 | Datum | |
---|---|---|---|
|
47d5f29ae6 | ||
|
552a1ea7fc | ||
|
d77e8e829e | ||
|
bd06bce3dc | ||
|
76ecc8e6e4 | ||
|
820e7fcbb2 | ||
|
94958de2da | ||
|
2214b7dc3d | ||
75e6b28e0e | |||
a1dd919afa | |||
|
2b0b2a08d7 | ||
|
7fc76e5e2a | ||
|
5153609776 | ||
593113bbc3 | |||
|
a62c08b097 | ||
442ba6f483 | |||
|
e253e12994 | ||
|
38bb687c5b | ||
|
30ddf671ae | ||
|
2829706d6b | ||
|
ab6c762323 | ||
|
d5acfa3f5c | ||
|
3370e211f9 | ||
|
29c7732166 | ||
ec3a8a1421 | |||
|
f054710a95 | ||
67f6363852 | |||
7182635558 | |||
|
7d01ebf4ed | ||
|
595c45bb54 | ||
45a61e554f | |||
|
a43e141340 | ||
4a334d8693 | |||
|
6a6833a0e0 | ||
daedbb26a7 | |||
|
d5ab11addd | ||
|
aa22ccf5b4 | ||
|
723b86b955 | ||
|
a116f7e4b1 | ||
680f9d8b3f | |||
|
00dcb10451 | ||
c815cd52fb | |||
|
ddb701cbd6 | ||
929400b4d9 | |||
|
e9ff8a7dc5 | ||
|
a36bae3a8d | ||
|
7502270b96 | ||
|
0c91261d55 | ||
|
add259788d | ||
|
4568ceee36 | ||
106a13bd13 | |||
|
2aec97304d | ||
|
7fa31704f4 | ||
|
95132a17d3 | ||
|
e08e53a554 | ||
5ab6b8832b | |||
|
2861a4e19b | ||
|
18430e13fe | ||
|
e8eeeb729a | ||
792b089e4f | |||
|
b602fb06d0 | ||
18769a6931 | |||
|
f1b3b27c14 | ||
|
fd17b8315f | ||
2ed6008aea | |||
|
a5b90be2db | ||
|
c278b1cfe1 | ||
|
486d04dd66 | ||
f1d929e33b | |||
6f6b61b310 | |||
|
f50d887da5 | ||
|
5d2886c0a5 | ||
|
9d96d5a2a8 | ||
|
07cd605d2c |
@ -48,12 +48,17 @@ FLAG_FIRE=Fire
|
|||||||
FLAG_FREEZE=Freeze
|
FLAG_FREEZE=Freeze
|
||||||
FLAG_PROTECT=Protect
|
FLAG_PROTECT=Protect
|
||||||
FLAG_ITEMS=Items
|
FLAG_ITEMS=Items
|
||||||
|
FLAG_NO_GRAVITY = No Gravity
|
||||||
|
FLAG_TESTBLOCK=Testblock
|
||||||
|
FLAG_CHANGED=Changed
|
||||||
FLAG_FIRE_ALLOW=§con
|
FLAG_FIRE_ALLOW=§con
|
||||||
FLAG_FIRE_DENY=§aoff
|
FLAG_FIRE_DENY=§aoff
|
||||||
FLAG_FREEZE_ACTIVE=§aon
|
FLAG_FREEZE_ACTIVE=§aon
|
||||||
FLAG_FREEZE_INACTIVE=§coff
|
FLAG_FREEZE_INACTIVE=§coff
|
||||||
FLAG_PROTECT_ACTIVE=§aon
|
FLAG_PROTECT_ACTIVE=§aon
|
||||||
FLAG_PROTECT_INACTIVE=§coff
|
FLAG_PROTECT_INACTIVE=§coff
|
||||||
|
FLAG_NO_GRAVITY_ACTIVE = §aon
|
||||||
|
FLAG_NO_GRAVITY_INACTIVE = §coff
|
||||||
FLAG_TNT_ALLOW=§aon
|
FLAG_TNT_ALLOW=§aon
|
||||||
FLAG_TNT_DENY=§coff
|
FLAG_TNT_DENY=§coff
|
||||||
FLAG_TNT_ONLY_TB=§7no §ebuild area
|
FLAG_TNT_ONLY_TB=§7no §ebuild area
|
||||||
@ -78,6 +83,11 @@ FLAG_COLOR_BROWN=§eBrown
|
|||||||
FLAG_COLOR_GREEN=§2Green
|
FLAG_COLOR_GREEN=§2Green
|
||||||
FLAG_COLOR_RED=§cRed
|
FLAG_COLOR_RED=§cRed
|
||||||
FLAG_COLOR_BLACK=§0Black
|
FLAG_COLOR_BLACK=§0Black
|
||||||
|
FLAG_TESTBLOCK_NO_VALUE=§eNo Value
|
||||||
|
FLAG_TESTBLOCK_NORTH=§eNorth
|
||||||
|
FLAG_TESTBLOCK_SOUTH=§eSouth
|
||||||
|
FLAG_CHANGED_NO_CHANGE=§cNo
|
||||||
|
FLAG_CHANGED_HAS_CHANGE=§aYes
|
||||||
# Region
|
# Region
|
||||||
REGION_TYPE_NORMAL=Normal
|
REGION_TYPE_NORMAL=Normal
|
||||||
REGION_TYPE_BUILD=Build area
|
REGION_TYPE_BUILD=Build area
|
||||||
@ -126,6 +136,7 @@ BAU_INFO_ITEM_LORE_FIRE=§7Fire§8: §e{0}
|
|||||||
BAU_INFO_ITEM_LORE_COLOR=§7Color§8: §e{0}
|
BAU_INFO_ITEM_LORE_COLOR=§7Color§8: §e{0}
|
||||||
BAU_INFO_ITEM_LORE_PROTECT=§7Protect§8: §e{0}
|
BAU_INFO_ITEM_LORE_PROTECT=§7Protect§8: §e{0}
|
||||||
BAU_INFO_ITEM_LORE_ITEMS=§7Items§8: §e{0}
|
BAU_INFO_ITEM_LORE_ITEMS=§7Items§8: §e{0}
|
||||||
|
BAU_INFO_ITEM_LORE_NO_GRAVITY = §8NoGravity§8: §e{0}
|
||||||
BAU_INFO_COMMAND_HELP=§8/§ebauinfo §8- §7Information regarding this build server
|
BAU_INFO_COMMAND_HELP=§8/§ebauinfo §8- §7Information regarding this build server
|
||||||
BAU_INFO_COMMAND_OWNER=§7Owner§8: §e{0}
|
BAU_INFO_COMMAND_OWNER=§7Owner§8: §e{0}
|
||||||
BAU_INFO_COMMAND_MEMBER=§7{0} §8[§7{1}§8]§8: §e{2}
|
BAU_INFO_COMMAND_MEMBER=§7{0} §8[§7{1}§8]§8: §e{2}
|
||||||
@ -437,8 +448,8 @@ TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions shown from {0} to {1}
|
|||||||
TRACE_MESSAGE_SHOW_TO_SMALLER=§cTo must be bigger then from
|
TRACE_MESSAGE_SHOW_TO_SMALLER=§cTo must be bigger then from
|
||||||
TRACE_MESSAGE_CLICK_ISOLATE=§eClick to §aisolate§8/§cunisolate
|
TRACE_MESSAGE_CLICK_ISOLATE=§eClick to §aisolate§8/§cunisolate
|
||||||
TRACE_MESSAGE_ISOLATE=§eTNT Positions have been isolated
|
TRACE_MESSAGE_ISOLATE=§eTNT Positions have been isolated
|
||||||
TRACE_MESSAGE_SHARE=§e{0} shared his trace show state.
|
TRACE_MESSAGE_BROADCAST=§e{0} shared his trace show state.
|
||||||
TRACE_MESSAGE_SHARE_HOVER=§eClick to view
|
TRACE_MESSAGE_BROADCAST_HOVER=§eClick to view
|
||||||
TRACE_MESSAGE_FOLLOW=§aYou are now following {0} Trace show state
|
TRACE_MESSAGE_FOLLOW=§aYou are now following {0} Trace show state
|
||||||
TRACE_MESSAGE_FOLLOW_SELF=§cYou cannot follow yourself!
|
TRACE_MESSAGE_FOLLOW_SELF=§cYou cannot follow yourself!
|
||||||
TRACE_MESSAGE_UNFOLLOW=§cYou are no longer following a Trace show state
|
TRACE_MESSAGE_UNFOLLOW=§cYou are no longer following a Trace show state
|
||||||
@ -455,7 +466,7 @@ TRACE_COMMAND_HELP_SHOW_FROM_TO_WITH=§8/§etrace show §7from §8<§eFROM§8>
|
|||||||
TRACE_COMMAND_HELP_HIDE=§8/§etrace hide §8- §7Hides all TNT-positions
|
TRACE_COMMAND_HELP_HIDE=§8/§etrace hide §8- §7Hides all TNT-positions
|
||||||
TRACE_COMMAND_HELP_DELETE=§8/§etrace delete §8[§eTrace§8] §8- §7Deletes all TNT-positions or a Trace
|
TRACE_COMMAND_HELP_DELETE=§8/§etrace delete §8[§eTrace§8] §8- §7Deletes all TNT-positions or a Trace
|
||||||
TRACE_COMMAND_HELP_ISOLATE=§8/§etrace isolate §8[§eTrace§8] §8[§eTNT§8] §8- §7Isolates specific TNTs from the Trace
|
TRACE_COMMAND_HELP_ISOLATE=§8/§etrace isolate §8[§eTrace§8] §8[§eTNT§8] §8- §7Isolates specific TNTs from the Trace
|
||||||
TRACE_COMMAND_HELP_SHARE=§8/§etrace share §8- §7Share your current Trace show state with others
|
TRACE_COMMAND_HELP_BROADCAST=§8/§etrace broadcast §8- §7Share your current Trace show state with others
|
||||||
TRACE_COMMAND_HELP_FOLLOW=§8/§etrace follow §8[§ePlayer§8] §8- §7Follow a players Trace show state
|
TRACE_COMMAND_HELP_FOLLOW=§8/§etrace follow §8[§ePlayer§8] §8- §7Follow a players Trace show state
|
||||||
TRACE_COMMAND_HELP_UNFOLLOW=§8/§etrace unfollow §8- §7Unfollow the Trace show state
|
TRACE_COMMAND_HELP_UNFOLLOW=§8/§etrace unfollow §8- §7Unfollow the Trace show state
|
||||||
TRACE_GUI_ITEM_NAME=§eTracer
|
TRACE_GUI_ITEM_NAME=§eTracer
|
||||||
@ -620,9 +631,9 @@ OTHER_NOCLIP_SLOT_HELP_PICK=§8/§eslot pick §8-§7 Take the faced block into y
|
|||||||
OTHER_NOCLIP_SLOT_HELP_DROP=§8/§eslot drop §8-§7 Clears your slot
|
OTHER_NOCLIP_SLOT_HELP_DROP=§8/§eslot drop §8-§7 Clears your slot
|
||||||
OTHER_CLEAR_HELP_SELF=§8/§eclear §8- §7Clears your inventory
|
OTHER_CLEAR_HELP_SELF=§8/§eclear §8- §7Clears your inventory
|
||||||
OTHER_CLEAR_HELP_PLAYER=§8/§eclear §8[§7Player§8] §8- §7Clears a player inventory
|
OTHER_CLEAR_HELP_PLAYER=§8/§eclear §8[§7Player§8] §8- §7Clears a player inventory
|
||||||
OTHER_CLEAR_CLEARED=Your inventory was cleared.
|
OTHER_CLEAR_CLEARED=§7Your inventory was cleared.
|
||||||
OTHER_CLEAR_FROM=Your invetnory was cleared by {0}.
|
OTHER_CLEAR_FROM=§7Your invetnory was cleared by {0}.
|
||||||
OTHER_CLEAR_TO=The inventory of {0} §7was cleared.
|
OTHER_CLEAR_TO=§7The inventory of {0} §7was cleared.
|
||||||
OTHER_DECLUTTER_HELP=§8/§edeclutter §8- §7Organise your inventory
|
OTHER_DECLUTTER_HELP=§8/§edeclutter §8- §7Organise your inventory
|
||||||
OTHER_DECLUTTER_DONE=§aYour inventory was organised.
|
OTHER_DECLUTTER_DONE=§aYour inventory was organised.
|
||||||
OTHER_GAMEMODE_UNKNOWN=§cUnknown gamemode.
|
OTHER_GAMEMODE_UNKNOWN=§cUnknown gamemode.
|
||||||
@ -740,6 +751,9 @@ REGION_PROTECT_HELP=§8/§eprotect §8- §7Protect the region
|
|||||||
REGION_PROTECT_DISABLE=§cProtection disabled
|
REGION_PROTECT_DISABLE=§cProtection disabled
|
||||||
REGION_PROTECT_ENABLE=§aProtection enabled
|
REGION_PROTECT_ENABLE=§aProtection enabled
|
||||||
REGION_PROTECT_FALSE_REGION=§cYou are not currently in a (M)WG-region
|
REGION_PROTECT_FALSE_REGION=§cYou are not currently in a (M)WG-region
|
||||||
|
REGION_NO_GRAVITY_HELP = §8/§enogravity §8- §7Toggle NoGravity
|
||||||
|
REGION_NO_GRAVITY_ENABLED = §aNoGravity enabled in this region
|
||||||
|
REGION_NO_GRAVITY_DISABLED = §cNoGravity disabled in this region
|
||||||
REGION_REGION_HELP_UNDO=§8/§eregion undo §8- §7undo the last 20 /testblock or /reset
|
REGION_REGION_HELP_UNDO=§8/§eregion undo §8- §7undo the last 20 /testblock or /reset
|
||||||
REGION_REGION_HELP_REDO=§8/§eregion redo §8- §7redo the last 20 §8/§7rg undo
|
REGION_REGION_HELP_REDO=§8/§eregion redo §8- §7redo the last 20 §8/§7rg undo
|
||||||
REGION_REGION_HELP_RESTORE=§8/§eregion restore §8- §7Resets the region, without removing your builds
|
REGION_REGION_HELP_RESTORE=§8/§eregion restore §8- §7Resets the region, without removing your builds
|
||||||
@ -971,7 +985,7 @@ WARP_GUI_NAME=Warps
|
|||||||
WARP_GUI_NO=§cNo warps exist
|
WARP_GUI_NO=§cNo warps exist
|
||||||
WARP_GUI_DISTANCE=§7Distance: §e{0} §7blocks
|
WARP_GUI_DISTANCE=§7Distance: §e{0} §7blocks
|
||||||
WARP_GUI_LCLICK=§7Left click to teleport
|
WARP_GUI_LCLICK=§7Left click to teleport
|
||||||
WARP_GUI_RCLICK=§7Rickt click to edit
|
WARP_GUI_RCLICK=§7Right click to edit
|
||||||
WARP_INFO_NAME=§7Name: §e{0}
|
WARP_INFO_NAME=§7Name: §e{0}
|
||||||
WARP_HELP_ADD=§8/§ewarp add §8[§7name§8] §8- §7Create a new warp
|
WARP_HELP_ADD=§8/§ewarp add §8[§7name§8] §8- §7Create a new warp
|
||||||
WARP_HELP_TELEPORT=§8/§ewarp §8[§7name§8] §8- §7Teleport to a warp
|
WARP_HELP_TELEPORT=§8/§ewarp §8[§7name§8] §8- §7Teleport to a warp
|
||||||
@ -995,6 +1009,6 @@ XRAY_ON=§aXray activated
|
|||||||
XRAY_OFF=§cXray deactivated
|
XRAY_OFF=§cXray deactivated
|
||||||
# WorldEdit
|
# WorldEdit
|
||||||
COLORREPLACE_HELP=§8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Replace all blocks of one color with another
|
COLORREPLACE_HELP=§8//§ecolorreplace §8[§7color§8] §8[§7color§8] §8- §7Replace all blocks of one color with another
|
||||||
TYPEREPLACE_HELP=§8//§etyreplace §8[§7type§8] §8[§7type§8] §8- §7Replace all blocks of one type with another
|
TYPEREPLACE_HELP=§8//§etypereplace §8[§7type§8] §8[§7type§8] §8- §7Replace all blocks of one type with another
|
||||||
# Schematic
|
# Schematic
|
||||||
SCHEMATIC_GUI_ITEM=§eSchematics
|
SCHEMATIC_GUI_ITEM=§eSchematics
|
||||||
|
@ -402,14 +402,14 @@ TRACE_MESSAGE_CLICK_ISOLATE=§eKlicken zum §aisolieren§8/§causblenden
|
|||||||
TRACE_MESSAGE_SHOW_AT=§aTNT-positions angezeigt bei {0}
|
TRACE_MESSAGE_SHOW_AT=§aTNT-positions angezeigt bei {0}
|
||||||
TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions angezeigt von {0}
|
TRACE_MESSAGE_SHOW_FROM=§aAll TNT-positions angezeigt von {0}
|
||||||
TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions angezeigt von {0} bis {1}
|
TRACE_MESSAGE_SHOW_FROM_TO=§aAll TNT-positions angezeigt von {0} bis {1}
|
||||||
TRACE_MESSAGE_SHARE=§e{0} teilte seinen Trace-Show-Status.
|
TRACE_MESSAGE_BROADCAST=§e{0} teilte seinen Trace-Show-Status.
|
||||||
TRACE_MESSAGE_SHARE_HOVER=§eZum Ansehen klicken.
|
TRACE_MESSAGE_BROADCAST_HOVER=§eZum Ansehen klicken.
|
||||||
TRACE_MESSAGE_FOLLOW=§aSie folgen nun {0} Trace show state
|
TRACE_MESSAGE_FOLLOW=§aSie folgen nun {0} Trace show state
|
||||||
TRACE_MESSAGE_FOLLOW_SELF=§cSie können sich selbst nicht folgen!
|
TRACE_MESSAGE_FOLLOW_SELF=§cSie können sich selbst nicht folgen!
|
||||||
TRACE_MESSAGE_UNFOLLOW=§cSie folgen nicht mehr dem Status einer Trace-Show
|
TRACE_MESSAGE_UNFOLLOW=§cSie folgen nicht mehr dem Status einer Trace-Show
|
||||||
TRACE_MESSAGE_SHOW_TO_SMALLER=§cBis muss größer als von sein
|
TRACE_MESSAGE_SHOW_TO_SMALLER=§cBis muss größer als von sein
|
||||||
TRACE_MESSAGE_ISOLATE=§eTNT Positionen wurden isoliert
|
TRACE_MESSAGE_ISOLATE=§eTNT Positionen wurden isoliert
|
||||||
TRACE_COMMAND_HELP_SHARE=§8/§etrace share §8- §7Teilt den aktuellen Trace-Show-Status mit anderen
|
TRACE_COMMAND_HELP_BROADCAST=§8/§etrace broadcast §8- §7Teilt den aktuellen Trace-Show-Status mit anderen
|
||||||
TRACE_COMMAND_HELP_FOLLOW=§8/§etrace follow §8[§ePlayer§8] §8- §7Verfolgen eines Spielers Status anzeigen
|
TRACE_COMMAND_HELP_FOLLOW=§8/§etrace follow §8[§ePlayer§8] §8- §7Verfolgen eines Spielers Status anzeigen
|
||||||
TRACE_COMMAND_HELP_UNFOLLOW=§8/§etrace unfollow §8- §7Den Status der Trace-Anzeige aufheben
|
TRACE_COMMAND_HELP_UNFOLLOW=§8/§etrace unfollow §8- §7Den Status der Trace-Anzeige aufheben
|
||||||
TRACE_COMMAND_HELP_START=§8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen
|
TRACE_COMMAND_HELP_START=§8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen
|
||||||
@ -582,9 +582,9 @@ OTHER_NOCLIP_SLOT_HELP_PICK=§8/§eslot pick §8-§7 Lege den angeguckten Block
|
|||||||
OTHER_NOCLIP_SLOT_HELP_DROP=§8/§eslot drop §8-§7 Cleared deinen Slot
|
OTHER_NOCLIP_SLOT_HELP_DROP=§8/§eslot drop §8-§7 Cleared deinen Slot
|
||||||
OTHER_CLEAR_HELP_SELF=§8/§eclear §8- §7Leere dein Inventar
|
OTHER_CLEAR_HELP_SELF=§8/§eclear §8- §7Leere dein Inventar
|
||||||
OTHER_CLEAR_HELP_PLAYER=§8/§eclear §8[§7Player§8] §8- §7Leere ein Spieler Inventar
|
OTHER_CLEAR_HELP_PLAYER=§8/§eclear §8[§7Player§8] §8- §7Leere ein Spieler Inventar
|
||||||
OTHER_CLEAR_CLEARED=Dein Inventar wurde geleert.
|
OTHER_CLEAR_CLEARED=§7Dein Inventar wurde geleert.
|
||||||
OTHER_CLEAR_FROM=Dein Inventar wurde von {0} §7geleert.
|
OTHER_CLEAR_FROM=§7Dein Inventar wurde von {0} §7geleert.
|
||||||
OTHER_CLEAR_TO=Das Inventar von {0} §7wurde geleert.
|
OTHER_CLEAR_TO=§7Das Inventar von {0} §7wurde geleert.
|
||||||
OTHER_DECLUTTER_HELP=§8/§edeclutter §8- §7Räume dein Inventar auf
|
OTHER_DECLUTTER_HELP=§8/§edeclutter §8- §7Räume dein Inventar auf
|
||||||
OTHER_DECLUTTER_DONE=§aDein Inventar wurde aufgeräumt.
|
OTHER_DECLUTTER_DONE=§aDein Inventar wurde aufgeräumt.
|
||||||
OTHER_GAMEMODE_UNKNOWN=§cUnbekannter Spielmodus.
|
OTHER_GAMEMODE_UNKNOWN=§cUnbekannter Spielmodus.
|
||||||
@ -698,6 +698,9 @@ REGION_PROTECT_HELP=§8/§eprotect §8- §7Schütze die Region
|
|||||||
REGION_PROTECT_DISABLE=§cBoden Schutz aufgehoben
|
REGION_PROTECT_DISABLE=§cBoden Schutz aufgehoben
|
||||||
REGION_PROTECT_ENABLE=§aBoden geschützt
|
REGION_PROTECT_ENABLE=§aBoden geschützt
|
||||||
REGION_PROTECT_FALSE_REGION=§cDu befindest dich derzeit in keiner (M)WG-Region
|
REGION_PROTECT_FALSE_REGION=§cDu befindest dich derzeit in keiner (M)WG-Region
|
||||||
|
REGION_NO_GRAVITY_HELP = §8/§enogravity §8- §7Toggle NoGravity
|
||||||
|
REGION_NO_GRAVITY_ENABLED = §aNoGravity aktiviert in dieser Region
|
||||||
|
REGION_NO_GRAVITY_DISABLED = §cNoGravity deaktiviert in dieser Region
|
||||||
REGION_REGION_HELP_UNDO=§8/§eregion undo §8- §7Mache die letzten 20 /testblock oder /reset rückgängig
|
REGION_REGION_HELP_UNDO=§8/§eregion undo §8- §7Mache die letzten 20 /testblock oder /reset rückgängig
|
||||||
REGION_REGION_HELP_REDO=§8/§eregion redo §8- §7Wiederhole die letzten 20 §8/§7rg undo
|
REGION_REGION_HELP_REDO=§8/§eregion redo §8- §7Wiederhole die letzten 20 §8/§7rg undo
|
||||||
REGION_REGION_HELP_RESTORE=§8/§eregion restore §8- §7Setzte die Region zurück, ohne das Gebaute zu löschen
|
REGION_REGION_HELP_RESTORE=§8/§eregion restore §8- §7Setzte die Region zurück, ohne das Gebaute zu löschen
|
||||||
|
@ -52,6 +52,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
// This should be treated as final!
|
// This should be treated as final!
|
||||||
public static Message MESSAGE;
|
public static Message MESSAGE;
|
||||||
|
public static final boolean DEV_SERVER = !System.getProperty("user.home").endsWith("minecraft");
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static BauSystem instance;
|
private static BauSystem instance;
|
||||||
@ -72,6 +73,7 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
} catch (SecurityException e) {
|
} catch (SecurityException e) {
|
||||||
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
Bukkit.shutdown();
|
Bukkit.shutdown();
|
||||||
|
System.exit(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +85,14 @@ public class BauSystem extends JavaPlugin implements Listener {
|
|||||||
SWCommandUtils.addValidator("supervisor", validator(Permission.SUPERVISOR));
|
SWCommandUtils.addValidator("supervisor", validator(Permission.SUPERVISOR));
|
||||||
SWCommandUtils.addValidator("owner", validator(Permission.OWNER));
|
SWCommandUtils.addValidator("owner", validator(Permission.OWNER));
|
||||||
|
|
||||||
LinkageUtils.link();
|
try {
|
||||||
|
LinkageUtils.link();
|
||||||
|
} catch (Exception e) {
|
||||||
|
Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
||||||
|
Bukkit.shutdown();
|
||||||
|
System.exit(1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
TickListener.impl.init();
|
TickListener.impl.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,8 @@ public class DesignEndStone {
|
|||||||
private REntityServer entityServer = new REntityServer();
|
private REntityServer entityServer = new REntityServer();
|
||||||
private List<REntity> entities = new ArrayList<>();
|
private List<REntity> entities = new ArrayList<>();
|
||||||
private Set<Location> locations = new HashSet<>();
|
private Set<Location> locations = new HashSet<>();
|
||||||
|
private boolean wsOrAs;
|
||||||
|
private double maxBlastResistance;
|
||||||
|
|
||||||
public DesignEndStone(Region region) {
|
public DesignEndStone(Region region) {
|
||||||
this.minX = region.getMinPointBuild().getX();
|
this.minX = region.getMinPointBuild().getX();
|
||||||
@ -52,6 +54,17 @@ public class DesignEndStone {
|
|||||||
this.maxX = region.getMaxPointBuild().getX();
|
this.maxX = region.getMaxPointBuild().getX();
|
||||||
this.maxY = region.getMaxPointBuild().getY();
|
this.maxY = region.getMaxPointBuild().getY();
|
||||||
this.maxZ = region.getMaxPointBuild().getZ();
|
this.maxZ = region.getMaxPointBuild().getZ();
|
||||||
|
wsOrAs = region.getName().startsWith("ws") || region.getName().startsWith("as");
|
||||||
|
maxBlastResistance = wsOrAs ? 6.1 : 9.0;
|
||||||
|
|
||||||
|
entityServer.setCallback((player, rEntity, entityAction) -> {
|
||||||
|
if (entityAction != REntityServer.EntityAction.ATTACK) return;
|
||||||
|
Location location = new Location(WORLD, rEntity.getX(), rEntity.getY(), rEntity.getZ());
|
||||||
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
|
location.getBlock().breakNaturally();
|
||||||
|
calc();
|
||||||
|
}, 1);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void calc() {
|
public void calc() {
|
||||||
@ -63,8 +76,24 @@ public class DesignEndStone {
|
|||||||
calc(minX, minY, maxZ, maxX, maxY, maxZ, 0, 0, -1, maxZ - minZ);
|
calc(minX, minY, maxZ, maxX, maxY, maxZ, 0, 0, -1, maxZ - minZ);
|
||||||
calc(minX, minY, minZ, minX, maxY, maxZ, 1, 0, 0, maxX - minX);
|
calc(minX, minY, minZ, minX, maxY, maxZ, 1, 0, 0, maxX - minX);
|
||||||
calc(maxX, minY, minZ, maxX, maxY, maxZ, -1, 0, 0, maxX - minX);
|
calc(maxX, minY, minZ, maxX, maxY, maxZ, -1, 0, 0, maxX - minX);
|
||||||
// calc(minX, minY, minZ, maxX, minY, maxZ, 0, 1, 0, maxY - minY);
|
if (wsOrAs) {
|
||||||
calc(minX, maxY, minZ, maxX, maxY, maxZ, 0, -1, 0, maxY - minY);
|
calc(minX, minY, minZ, maxX, minY, maxZ, 0, 1, 0, maxY - minY + 1);
|
||||||
|
} else {
|
||||||
|
int airBlocks = 0;
|
||||||
|
double minAirBlocks = (maxX - minX) * (maxZ - minZ) * 0.1;
|
||||||
|
for (int x = minX; x < maxX; x++) {
|
||||||
|
for (int z = minZ; z < maxZ; z++) {
|
||||||
|
if (WORLD.getBlockAt(x, minY, z).getType().isAir()) {
|
||||||
|
airBlocks++;
|
||||||
|
if (airBlocks > minAirBlocks) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (airBlocks > minAirBlocks) {
|
||||||
|
calc(minX, minY, minZ, maxX, minY, maxZ, 0, 1, 0, maxY - minY + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
calc(minX, maxY, minZ, maxX, maxY, maxZ, 0, -1, 0, maxY - minY + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void calc(int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int dirX, int dirY, int dirZ, int steps) {
|
private void calc(int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int dirX, int dirY, int dirZ, int steps) {
|
||||||
@ -76,15 +105,16 @@ public class DesignEndStone {
|
|||||||
int cy = y + step * dirY;
|
int cy = y + step * dirY;
|
||||||
int cz = z + step * dirZ;
|
int cz = z + step * dirZ;
|
||||||
Material material = WORLD.getBlockAt(cx, cy, cz).getType();
|
Material material = WORLD.getBlockAt(cx, cy, cz).getType();
|
||||||
if (material == Material.END_STONE || material == Material.END_STONE_BRICKS || material == Material.END_STONE_BRICK_SLAB || material == Material.END_STONE_BRICK_STAIRS || material == Material.END_STONE_BRICK_WALL) {
|
|
||||||
|
if (material != Material.WATER && material != Material.LAVA && material.getBlastResistance() >= maxBlastResistance) {
|
||||||
Location location = new Location(WORLD, cx + 0.5, cy, cz + 0.5);
|
Location location = new Location(WORLD, cx + 0.5, cy, cz + 0.5);
|
||||||
if (locations.contains(location)) break;
|
if (!locations.add(location)) break;
|
||||||
RFallingBlockEntity entity = new RFallingBlockEntity(entityServer, location, Material.RED_STAINED_GLASS);
|
RFallingBlockEntity entity = new RFallingBlockEntity(entityServer, location, Material.RED_STAINED_GLASS);
|
||||||
entity.setNoGravity(true);
|
entity.setNoGravity(true);
|
||||||
entity.setGlowing(true);
|
entity.setGlowing(true);
|
||||||
entities.add(entity);
|
entities.add(entity);
|
||||||
break;
|
break;
|
||||||
} else if (!material.isAir()) {
|
} else if (!material.isAir() && material != Material.WATER && material != Material.LAVA) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2024 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.bausystem.features.region;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.region.Region;
|
||||||
|
import de.steamwar.bausystem.region.RegionUtils;
|
||||||
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
|
import de.steamwar.bausystem.region.flags.flagvalues.NoGravityMode;
|
||||||
|
import de.steamwar.command.SWCommand;
|
||||||
|
import de.steamwar.linkage.Linked;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@Linked
|
||||||
|
public class NoGravityCommand extends SWCommand {
|
||||||
|
|
||||||
|
public NoGravityCommand() {
|
||||||
|
super("nogravity");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Register(description = "REGION_NO_GRAVITY_HELP")
|
||||||
|
public void toggleCommand(@Validator Player p) {
|
||||||
|
Region region = Region.getRegion(p.getLocation());
|
||||||
|
if (toggle(region)) {
|
||||||
|
RegionUtils.actionBar(region, getEnableMessage());
|
||||||
|
} else {
|
||||||
|
RegionUtils.actionBar(region, getDisableMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getEnableMessage() {
|
||||||
|
return "REGION_NO_GRAVITY_ENABLED";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getDisableMessage() {
|
||||||
|
return "REGION_NO_GRAVITY_DISABLED";
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean toggle(Region region) {
|
||||||
|
switch (region.getPlain(Flag.NO_GRAVITY, NoGravityMode.class)) {
|
||||||
|
case ACTIVE:
|
||||||
|
region.set(Flag.NO_GRAVITY, NoGravityMode.INACTIVE);
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
case INACTIVE:
|
||||||
|
region.set(Flag.NO_GRAVITY, NoGravityMode.ACTIVE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2024 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.bausystem.features.region;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
|
import de.steamwar.bausystem.region.Region;
|
||||||
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
|
import de.steamwar.bausystem.region.flags.flagvalues.NoGravityMode;
|
||||||
|
import de.steamwar.bausystem.utils.ScoreboardElement;
|
||||||
|
import de.steamwar.linkage.Linked;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
|
|
||||||
|
@Linked
|
||||||
|
public class NoGravityListener implements Listener, ScoreboardElement {
|
||||||
|
|
||||||
|
private static NoGravityMode getMode(Region region) {
|
||||||
|
return region.getPlain(Flag.NO_GRAVITY, NoGravityMode.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onEntitySpawn(EntitySpawnEvent event) {
|
||||||
|
if (event.getEntityType() == EntityType.PLAYER) return;
|
||||||
|
if (getMode(Region.getRegion(event.getLocation())) == NoGravityMode.ACTIVE) {
|
||||||
|
event.getEntity().setGravity(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ScoreboardGroup getGroup() {
|
||||||
|
return ScoreboardGroup.REGION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int order() {
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String get(Region region, Player p) {
|
||||||
|
if (region.get(Flag.NO_GRAVITY) == Flag.NO_GRAVITY.getDefaultValue()) return null;
|
||||||
|
return "§e" + BauSystem.MESSAGE.parse(Flag.NO_GRAVITY.getChatValue(), p) + "§8: " + BauSystem.MESSAGE.parse(region.get(Flag.NO_GRAVITY).getChatValue(), p);
|
||||||
|
}
|
||||||
|
}
|
@ -20,7 +20,6 @@
|
|||||||
package de.steamwar.bausystem.features.shieldprinting;
|
package de.steamwar.bausystem.features.shieldprinting;
|
||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
|
||||||
import de.steamwar.bausystem.features.shieldprinting.impl.*;
|
import de.steamwar.bausystem.features.shieldprinting.impl.*;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
|
import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
|
||||||
@ -45,12 +44,10 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockCanBuildEvent;
|
|
||||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
@ -90,11 +90,10 @@ public class ProcessingTracesState implements LaufbauState {
|
|||||||
|
|
||||||
Location location = current.getLocation();
|
Location location = current.getLocation();
|
||||||
if (current.getPrevious().isPresent()) {
|
if (current.getPrevious().isPresent()) {
|
||||||
Vector velocity = current.getPrevious().get().getVelocity();
|
|
||||||
Location previousLocation = current.getPrevious().get().getLocation();
|
Location previousLocation = current.getPrevious().get().getLocation();
|
||||||
Location movement = location.clone().subtract(previousLocation);
|
Location movement = location.clone().subtract(previousLocation);
|
||||||
calculateCuboid(new Cuboid(previousLocation.getX() - 0.49, Math.min(previousLocation.getY(), location.getY()), previousLocation.getZ() - 0.49, 0.98, Math.abs(movement.getY()) + 0.98, 0.98));
|
calculateCuboid(new Cuboid(previousLocation.getX() - 0.49, Math.min(previousLocation.getY(), location.getY()), previousLocation.getZ() - 0.49, 0.98, Math.abs(movement.getY()) + 0.98, 0.98));
|
||||||
if (velocity.getX() >= velocity.getZ()) {
|
if (movement.getX() >= movement.getZ()) {
|
||||||
calculateCuboid(new Cuboid(Math.min(previousLocation.getX(), location.getX()) - 0.49, location.getY(), previousLocation.getZ() - 0.49, Math.abs(movement.getX()) + 0.98, 0.98, 0.98));
|
calculateCuboid(new Cuboid(Math.min(previousLocation.getX(), location.getX()) - 0.49, location.getY(), previousLocation.getZ() - 0.49, Math.abs(movement.getX()) + 0.98, 0.98, 0.98));
|
||||||
calculateCuboid(new Cuboid(location.getX() - 0.49, location.getY(), Math.min(previousLocation.getZ(), location.getZ()) - 0.49, 0.98, 0.98, Math.abs(movement.getZ()) + 0.98));
|
calculateCuboid(new Cuboid(location.getX() - 0.49, location.getY(), Math.min(previousLocation.getZ(), location.getZ()) - 0.49, 0.98, 0.98, Math.abs(movement.getZ()) + 0.98));
|
||||||
} else {
|
} else {
|
||||||
|
@ -24,6 +24,7 @@ import com.comphenix.tinyprotocol.TinyProtocol;
|
|||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.configplayer.Config;
|
import de.steamwar.bausystem.configplayer.Config;
|
||||||
|
import de.steamwar.core.Core;
|
||||||
import de.steamwar.inventory.SWItem;
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import de.steamwar.linkage.api.Plain;
|
import de.steamwar.linkage.api.Plain;
|
||||||
@ -41,9 +42,8 @@ import org.bukkit.event.block.Action;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.util.RayTraceResult;
|
||||||
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.PrintStream;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -83,12 +83,6 @@ public class SmartPlaceListener implements Plain, Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final Class<?> useItem = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem");
|
private static final Class<?> useItem = Reflection.getClass("{nms.network.protocol.game}.PacketPlayInUseItem");
|
||||||
private static final Class<?> entityPlayer = Reflection.getClass("{nms.server.level}.EntityPlayer");
|
|
||||||
private static final Class<?> craftPlayer = Reflection.getClass("{obc}.entity.CraftPlayer");
|
|
||||||
private static final Reflection.MethodInvoker getHandle = Reflection.getTypedMethod(craftPlayer, "getHandle", entityPlayer);
|
|
||||||
private static final Class<?> playerConnectionClazz = Reflection.getClass("{nms.server.network}.PlayerConnection");
|
|
||||||
private static final Reflection.FieldAccessor<?> playerConnection = Reflection.getField(entityPlayer, playerConnectionClazz, 0);
|
|
||||||
private static final Reflection.MethodInvoker packetExecutor = Reflection.getMethod(playerConnectionClazz, null, useItem);
|
|
||||||
|
|
||||||
private static final Set<Player> SMART_PLACING = new HashSet<>();
|
private static final Set<Player> SMART_PLACING = new HashSet<>();
|
||||||
private static final Set<Player> WAS_EXECUTED = new HashSet<>();
|
private static final Set<Player> WAS_EXECUTED = new HashSet<>();
|
||||||
@ -97,14 +91,16 @@ public class SmartPlaceListener implements Plain, Listener {
|
|||||||
TinyProtocol.instance.addFilter(useItem, (player, packet) -> {
|
TinyProtocol.instance.addFilter(useItem, (player, packet) -> {
|
||||||
if(!Permission.BUILD.hasPermission(player)) return packet;
|
if(!Permission.BUILD.hasPermission(player)) return packet;
|
||||||
if (!Config.getInstance().get(player).getPlainValueOrDefault("smartPlace", false)) return packet;
|
if (!Config.getInstance().get(player).getPlainValueOrDefault("smartPlace", false)) return packet;
|
||||||
Block block = player.getTargetBlockExact(6);
|
RayTraceResult rayTraceResult = player.rayTraceBlocks(6);
|
||||||
|
Block block = rayTraceResult != null ? rayTraceResult.getHitBlock() : null;
|
||||||
|
BlockFace blockFace = rayTraceResult != null ? rayTraceResult.getHitBlockFace() : null;
|
||||||
boolean shouldSneak = false;
|
boolean shouldSneak = false;
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
|
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
||||||
if (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) {
|
if (block.getType().isInteractable() || block.getType() == Material.NOTE_BLOCK) {
|
||||||
shouldSneak = true;
|
shouldSneak = true;
|
||||||
}
|
}
|
||||||
if (CONTAINERS.contains(block.getType())) {
|
if (CONTAINERS.contains(block.getType())) {
|
||||||
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
|
||||||
if (itemStack.getType() == Material.TNT) {
|
if (itemStack.getType() == Material.TNT) {
|
||||||
if (block.getType() == Material.CHEST || block.getType() == Material.BARREL || block.getType().name().endsWith("SHULKER_BOX")) {
|
if (block.getType() == Material.CHEST || block.getType() == Material.BARREL || block.getType().name().endsWith("SHULKER_BOX")) {
|
||||||
shouldSneak = false;
|
shouldSneak = false;
|
||||||
@ -116,6 +112,9 @@ public class SmartPlaceListener implements Plain, Listener {
|
|||||||
if (IGNORED.contains(block.getType())) {
|
if (IGNORED.contains(block.getType())) {
|
||||||
shouldSneak = false;
|
shouldSneak = false;
|
||||||
}
|
}
|
||||||
|
if (blockFace == BlockFace.DOWN && (block.getType() == Material.REPEATER || block.getType() == Material.COMPARATOR) && itemStack.getType().isSolid()) {
|
||||||
|
shouldSneak = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
boolean sneaking = player.isSneaking();
|
boolean sneaking = player.isSneaking();
|
||||||
if (sneaking) SMART_PLACING.add(player);
|
if (sneaking) SMART_PLACING.add(player);
|
||||||
@ -149,10 +148,10 @@ public class SmartPlaceListener implements Plain, Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockPlace(BlockPlaceEvent event) {
|
public void onBlockPlace(BlockPlaceEvent event) {
|
||||||
if(!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
if (!Permission.BUILD.hasPermission(event.getPlayer())) return;
|
||||||
if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("smartPlace", false)) return;
|
if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("smartPlace", false)) return;
|
||||||
if (!SMART_PLACING.contains(event.getPlayer())) {
|
if (!SMART_PLACING.contains(event.getPlayer())) {
|
||||||
if (CONTAINERS.contains(event.getBlockAgainst().getType())) {
|
if (Core.getVersion() >= 20 && CONTAINERS.contains(event.getBlockAgainst().getType())) {
|
||||||
SoundGroup soundGroup = event.getBlockPlaced().getBlockData().getSoundGroup();
|
SoundGroup soundGroup = event.getBlockPlaced().getBlockData().getSoundGroup();
|
||||||
event.getPlayer().playSound(event.getBlockPlaced().getLocation(), soundGroup.getPlaceSound(), soundGroup.getVolume() * 0.8F, soundGroup.getPitch() * 0.8F);
|
event.getPlayer().playSound(event.getBlockPlaced().getLocation(), soundGroup.getPlaceSound(), soundGroup.getVolume() * 0.8F, soundGroup.getPitch() * 0.8F);
|
||||||
}
|
}
|
||||||
|
@ -219,6 +219,9 @@ public class TNTPoint implements Externalizable {
|
|||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (!(obj instanceof TNTPoint)) return false;
|
if (!(obj instanceof TNTPoint)) return false;
|
||||||
TNTPoint record = (TNTPoint) obj;
|
TNTPoint record = (TNTPoint) obj;
|
||||||
|
if (record.getTntId() != tntId) return false;
|
||||||
|
if (record.getFuse() != fuse) return false;
|
||||||
|
if (record.getTicksSinceStart() != ticksSinceStart) return false;
|
||||||
if (record.isExplosion() != explosion) return false;
|
if (record.isExplosion() != explosion) return false;
|
||||||
if (!record.getLocation().equals(location)) return false;
|
if (!record.getLocation().equals(location)) return false;
|
||||||
if (!record.getVelocity().equals(velocity)) return false;
|
if (!record.getVelocity().equals(velocity)) return false;
|
||||||
|
@ -29,11 +29,14 @@ import de.steamwar.entity.REntityServer;
|
|||||||
import lombok.Cleanup;
|
import lombok.Cleanup;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.ref.SoftReference;
|
import java.lang.ref.SoftReference;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import java.util.zip.GZIPInputStream;
|
import java.util.zip.GZIPInputStream;
|
||||||
@ -188,7 +191,19 @@ public class Trace {
|
|||||||
* @param playerTraceShowData The showData for modifying the rendering
|
* @param playerTraceShowData The showData for modifying the rendering
|
||||||
*/
|
*/
|
||||||
protected void render(List<TNTPoint> records, Player player, PlayerTraceShowData playerTraceShowData) {
|
protected void render(List<TNTPoint> records, Player player, PlayerTraceShowData playerTraceShowData) {
|
||||||
render(records, entityServerMap.get(player), playerTraceShowData);
|
REntityServer entityServer = entityServerMap.computeIfAbsent(player, k -> {
|
||||||
|
REntityServer newEntityServer = new REntityServer();
|
||||||
|
newEntityServer.addPlayer(k);
|
||||||
|
newEntityServer.setCallback((p, rEntity, entityAction) -> {
|
||||||
|
if (entityAction != REntityServer.EntityAction.INTERACT) return;
|
||||||
|
if (rEntity instanceof TraceEntity) {
|
||||||
|
((TraceEntity) rEntity).printIntoChat(p);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return newEntityServer;
|
||||||
|
});
|
||||||
|
|
||||||
|
render(records, entityServer, playerTraceShowData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -296,16 +311,28 @@ public class Trace {
|
|||||||
/**
|
/**
|
||||||
* Loads the records of this trace from storage to memory
|
* Loads the records of this trace from storage to memory
|
||||||
*/
|
*/
|
||||||
@SneakyThrows
|
|
||||||
private void loadRecords() {
|
private void loadRecords() {
|
||||||
List<TNTPoint> records = new ArrayList<>();
|
List<TNTPoint> records = new ArrayList<>();
|
||||||
|
long readBytes = 0;
|
||||||
|
try {
|
||||||
|
FileInputStream fileInputStream = new FileInputStream(recordsSaveFile);
|
||||||
|
|
||||||
FileInputStream fileInputStream = new FileInputStream(recordsSaveFile);
|
@Cleanup
|
||||||
|
ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fileInputStream));
|
||||||
|
long fileLenght = recordsSaveFile.length();
|
||||||
|
while (fileInputStream.getChannel().position() < fileLenght) {
|
||||||
|
records.add((TNTPoint) inputStream.readObject());
|
||||||
|
readBytes = fileInputStream.getChannel().position();
|
||||||
|
}
|
||||||
|
} catch (EOFException e) {
|
||||||
|
Logger logger = Bukkit.getLogger();
|
||||||
|
logger.log(Level.WARNING, "EOF in trace read detected in " + uuid);
|
||||||
|
logger.log(Level.WARNING, "Read " + readBytes + "/" + recordsSaveFile.length() + " Bytes");
|
||||||
|
logger.log(Level.WARNING, "Read so far: " + records);
|
||||||
|
|
||||||
@Cleanup
|
e.printStackTrace();
|
||||||
ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fileInputStream));
|
} catch (IOException | ClassNotFoundException e) {
|
||||||
while (fileInputStream.getChannel().position() < recordsSaveFile.length()) {
|
e.printStackTrace();
|
||||||
records.add((TNTPoint) inputStream.readObject());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<Integer, List<TNTPoint>> histories = new HashMap<>();
|
Map<Integer, List<TNTPoint>> histories = new HashMap<>();
|
||||||
@ -319,7 +346,7 @@ public class Trace {
|
|||||||
this.records = new SoftReference<>(records);
|
this.records = new SoftReference<>(records);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<TNTPoint> getRecords() {
|
public synchronized List<TNTPoint> getRecords() {
|
||||||
if (records.get() == null) {
|
if (records.get() == null) {
|
||||||
loadRecords();
|
loadRecords();
|
||||||
}
|
}
|
||||||
|
@ -57,17 +57,21 @@ public class TraceCommand extends SWCommand {
|
|||||||
public void stop(@Validator Player player) {
|
public void stop(@Validator Player player) {
|
||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
TraceRecorder.instance.stopRecording(region);
|
TraceRecorder.instance.stopRecording(region);
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_STOP", player);
|
|
||||||
|
|
||||||
|
if (TraceRecorder.instance.isAutoTraceEnabledInRegion(region)) {
|
||||||
|
TraceRecorder.instance.removeAutoTraceRegion(region);
|
||||||
|
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_STOP", player);
|
||||||
|
} else {
|
||||||
|
BauSystem.MESSAGE.send("TRACE_MESSAGE_STOP", player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "auto", description = "TRACE_COMMAND_HELP_AUTO")
|
@Register(value = "auto", description = "TRACE_COMMAND_HELP_AUTO")
|
||||||
public void auto(@Validator Player player) {
|
public void auto(@Validator Player player) {
|
||||||
Region region = Region.getRegion(player.getLocation());
|
Region region = Region.getRegion(player.getLocation());
|
||||||
if (TraceRecorder.instance.toggleAutoTrace(region)) {
|
TraceRecorder.instance.addAutoTraceRegion(region);
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_START", player);
|
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_START", player);
|
||||||
} else {
|
|
||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_AUTO_STOP", player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW")
|
@Register(value = "show", description = "TRACE_COMMAND_HELP_SHOW")
|
||||||
@ -134,6 +138,7 @@ public class TraceCommand extends SWCommand {
|
|||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_HIDE", player);
|
BauSystem.MESSAGE.send("TRACE_MESSAGE_HIDE", player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Register(value = "delete")
|
||||||
@Register(value = "clear")
|
@Register(value = "clear")
|
||||||
public void clear(@Validator Player player) {
|
public void clear(@Validator Player player) {
|
||||||
TraceManager.instance.clear(Region.getRegion(player.getLocation()));
|
TraceManager.instance.clear(Region.getRegion(player.getLocation()));
|
||||||
@ -152,9 +157,9 @@ public class TraceCommand extends SWCommand {
|
|||||||
BauSystem.MESSAGE.send("TRACE_MESSAGE_ISOLATE", player);
|
BauSystem.MESSAGE.send("TRACE_MESSAGE_ISOLATE", player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "share", description = "TRACE_COMMAND_HELP_SHARE")
|
@Register(value = "broadcast", description = "TRACE_COMMAND_HELP_BROADCAST")
|
||||||
public void share(@Validator Player player) {
|
public void broadcast(@Validator Player player) {
|
||||||
BauSystem.MESSAGE.broadcast("TRACE_MESSAGE_SHARE", "TRACE_MESSAGE_SHARE_HOVER", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace follow " + player.getName()), player.getName());
|
BauSystem.MESSAGE.broadcast("TRACE_MESSAGE_BROADCAST", "TRACE_MESSAGE_BROADCAST_HOVER", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace follow " + player.getName()), player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register(value = "follow", description = "TRACE_COMMAND_HELP_FOLLOW")
|
@Register(value = "follow", description = "TRACE_COMMAND_HELP_FOLLOW")
|
||||||
@ -247,7 +252,7 @@ public class TraceCommand extends SWCommand {
|
|||||||
@Override
|
@Override
|
||||||
public ViewFlag map(CommandSender commandSender, String[] previousArguments, String s) {
|
public ViewFlag map(CommandSender commandSender, String[] previousArguments, String s) {
|
||||||
for (ViewFlag flag : ViewFlag.flags) {
|
for (ViewFlag flag : ViewFlag.flags) {
|
||||||
if (s.equals("--" + flag.name)) {
|
if (s.equals("-" + flag.name)) {
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +268,7 @@ public class TraceCommand extends SWCommand {
|
|||||||
@Override
|
@Override
|
||||||
public Collection<String> tabCompletes(CommandSender sender, PreviousArguments previousArguments, String s) {
|
public Collection<String> tabCompletes(CommandSender sender, PreviousArguments previousArguments, String s) {
|
||||||
return ViewFlag.flags.stream()
|
return ViewFlag.flags.stream()
|
||||||
.flatMap(viewFlag -> Stream.concat(Stream.of("--" + viewFlag.name),
|
.flatMap(viewFlag -> Stream.concat(Stream.of("-" + viewFlag.name),
|
||||||
Arrays.stream(viewFlag.aliases).map(name -> "-" + name)))
|
Arrays.stream(viewFlag.aliases).map(name -> "-" + name)))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
@ -152,7 +152,7 @@ public class TraceManager implements Listener {
|
|||||||
.keySet()
|
.keySet()
|
||||||
.forEach(player -> {
|
.forEach(player -> {
|
||||||
Set<Player> players = followerMap.getOrDefault(player, Collections.emptySet());
|
Set<Player> players = followerMap.getOrDefault(player, Collections.emptySet());
|
||||||
tracesByRegion.get(region).values().forEach(trace -> {
|
tracesByRegion.getOrDefault(region, new HashMap<>()).values().forEach(trace -> {
|
||||||
trace.hide(player);
|
trace.hide(player);
|
||||||
players.forEach(trace::hide);
|
players.forEach(trace::hide);
|
||||||
});
|
});
|
||||||
|
@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
|
import de.steamwar.bausystem.features.tpslimit.TPSUtils;
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -32,6 +33,8 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
|||||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@Linked
|
@Linked
|
||||||
public class TraceRecorder implements Listener {
|
public class TraceRecorder implements Listener {
|
||||||
@ -74,18 +77,12 @@ public class TraceRecorder implements Listener {
|
|||||||
}, 0, 1);
|
}, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void addAutoTraceRegion(Region region) {
|
||||||
* Toggles auto trace for the given region
|
autoTraceRegions.add(region);
|
||||||
*
|
}
|
||||||
* @param region
|
|
||||||
*/
|
public void removeAutoTraceRegion(Region region) {
|
||||||
public boolean toggleAutoTrace(Region region) {
|
autoTraceRegions.remove(region);
|
||||||
if (!autoTraceRegions.remove(region)) {
|
|
||||||
autoTraceRegions.add(region);
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -104,14 +101,11 @@ public class TraceRecorder implements Listener {
|
|||||||
*
|
*
|
||||||
* @param region region to be recorded
|
* @param region region to be recorded
|
||||||
*/
|
*/
|
||||||
public int startRecording(Region region) {
|
public void startRecording(Region region) {
|
||||||
if (activeTraces.containsKey(region)) {
|
if (activeTraces.containsKey(region)) return;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
TraceRecordingWrapper wrappedTrace = new TraceRecordingWrapper(region);
|
TraceRecordingWrapper wrappedTrace = new TraceRecordingWrapper(region);
|
||||||
activeTraces.put(region, wrappedTrace);
|
activeTraces.put(region, wrappedTrace);
|
||||||
return TraceManager.instance.add(wrappedTrace.getTrace());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,7 +118,6 @@ public class TraceRecorder implements Listener {
|
|||||||
if (wrappedTrace == null) return;
|
if (wrappedTrace == null) return;
|
||||||
|
|
||||||
wrappedTrace.finalizeRecording();
|
wrappedTrace.finalizeRecording();
|
||||||
|
|
||||||
activeTraces.remove(region);
|
activeTraces.remove(region);
|
||||||
for (TNTPrimed tnt : trackedTNT.getOrDefault(region, Collections.emptyList())) {
|
for (TNTPrimed tnt : trackedTNT.getOrDefault(region, Collections.emptyList())) {
|
||||||
historyMap.remove(tnt);
|
historyMap.remove(tnt);
|
||||||
@ -138,9 +131,19 @@ public class TraceRecorder implements Listener {
|
|||||||
private void record() {
|
private void record() {
|
||||||
for (Region region : activeTraces.keySet()) {
|
for (Region region : activeTraces.keySet()) {
|
||||||
TraceRecordingWrapper wrappedTrace = activeTraces.get(region);
|
TraceRecordingWrapper wrappedTrace = activeTraces.get(region);
|
||||||
for (TNTPrimed tnt : trackedTNT.getOrDefault(region, Collections.emptyList())) {
|
Iterator<TNTPrimed> iter = trackedTNT.getOrDefault(region, Collections.emptyList()).iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
TNTPrimed tnt = iter.next();
|
||||||
|
if (tnt.getFuseTicks() == 80) continue;
|
||||||
TNTPoint record = record(tnt, wrappedTrace, Collections.emptyList());
|
TNTPoint record = record(tnt, wrappedTrace, Collections.emptyList());
|
||||||
wrappedTrace.addRecord(record);
|
if (record == null) {
|
||||||
|
iter.remove();
|
||||||
|
tntSpawnRegion.remove(tnt);
|
||||||
|
historyMap.remove(tnt);
|
||||||
|
tntSpawnRegion.remove(tnt);
|
||||||
|
} else {
|
||||||
|
wrappedTrace.addRecord(record);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
wrappedTrace.commitRecorded();
|
wrappedTrace.commitRecorded();
|
||||||
}
|
}
|
||||||
@ -156,10 +159,26 @@ public class TraceRecorder implements Listener {
|
|||||||
*/
|
*/
|
||||||
private TNTPoint record(TNTPrimed tntPrimed, TraceRecordingWrapper wrappedTrace, List<Block> destroyedBlocks) {
|
private TNTPoint record(TNTPrimed tntPrimed, TraceRecordingWrapper wrappedTrace, List<Block> destroyedBlocks) {
|
||||||
List<TNTPoint> history = historyMap.getOrDefault(tntPrimed, new ArrayList<>());
|
List<TNTPoint> history = historyMap.getOrDefault(tntPrimed, new ArrayList<>());
|
||||||
|
|
||||||
|
// Failsave for tnt entering unloaded chunks
|
||||||
|
if (tntPrimed == null || tntPrimed.isDead() || history.size() > 0 && history.get(history.size() - 1).getFuse() == tntPrimed.getFuseTicks()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
int tntID;
|
int tntID;
|
||||||
|
|
||||||
if (history.size() == 0) {
|
if (history.size() == 0) {
|
||||||
historyMap.put(tntPrimed, history);
|
try {
|
||||||
|
historyMap.put(tntPrimed, history);
|
||||||
|
}
|
||||||
|
catch (NullPointerException e) {
|
||||||
|
Logger logger = Bukkit.getLogger();
|
||||||
|
//TODO remove when no longer neccecary
|
||||||
|
logger.log(Level.WARNING, "Nullpointer thrown by historyMap");
|
||||||
|
logger.log(Level.WARNING, "TNT History: " + history);
|
||||||
|
logger.log(Level.WARNING, "History Map: " + historyMap);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
tntID = wrappedTrace.getNextOpenRecordIdAndIncrement();
|
tntID = wrappedTrace.getNextOpenRecordIdAndIncrement();
|
||||||
} else {
|
} else {
|
||||||
tntID = history.get(0).getTntId();
|
tntID = history.get(0).getTntId();
|
||||||
@ -171,7 +190,7 @@ public class TraceRecorder implements Listener {
|
|||||||
}
|
}
|
||||||
boolean afterFirstExplosion = wrappedTrace.isExplosionRecorded();
|
boolean afterFirstExplosion = wrappedTrace.isExplosionRecorded();
|
||||||
|
|
||||||
TNTPoint record = new TNTPoint(tntID, tntPrimed, isExplosion, afterFirstExplosion, TPSUtils.currentTick.get() - wrappedTrace.getStartTick(), history, destroyedBlocks);
|
TNTPoint record = new TNTPoint(tntID, tntPrimed, isExplosion, afterFirstExplosion, TPSUtils.currentRealTick.get() - wrappedTrace.getStartTick(), history, destroyedBlocks);
|
||||||
history.add(record);
|
history.add(record);
|
||||||
|
|
||||||
return record;
|
return record;
|
||||||
@ -185,6 +204,22 @@ public class TraceRecorder implements Listener {
|
|||||||
return activeTraces.containsKey(region);
|
return activeTraces.containsKey(region);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the trace that is currently recorded in the given region
|
||||||
|
*
|
||||||
|
* @param region the region to get the trace for
|
||||||
|
* @return the trace recorded in region or empty if no trace is recorded in region
|
||||||
|
*/
|
||||||
|
public Optional<Trace> getActiveTraceForRegion(Region region) {
|
||||||
|
TraceRecordingWrapper traceWrapper = activeTraces.get(region);
|
||||||
|
|
||||||
|
if (traceWrapper == null) {
|
||||||
|
return Optional.empty();
|
||||||
|
} else {
|
||||||
|
return Optional.of(traceWrapper.getTrace());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public long getStartTimeOfTraceInRegion(Region region) {
|
public long getStartTimeOfTraceInRegion(Region region) {
|
||||||
TraceRecordingWrapper wrapper = activeTraces.get(region);
|
TraceRecordingWrapper wrapper = activeTraces.get(region);
|
||||||
if (wrapper == null) return 0;
|
if (wrapper == null) return 0;
|
||||||
@ -225,15 +260,16 @@ public class TraceRecorder implements Listener {
|
|||||||
*
|
*
|
||||||
* @param event
|
* @param event
|
||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onTNTExplode(EntityExplodeEvent event) {
|
public void onTNTExplode(EntityExplodeEvent event) {
|
||||||
if (!(event.getEntity() instanceof TNTPrimed)) return;
|
if (!(event.getEntity() instanceof TNTPrimed)) return;
|
||||||
|
|
||||||
Region region = tntSpawnRegion.getOrDefault((TNTPrimed) event.getEntity(), null);
|
Region region = tntSpawnRegion.getOrDefault((TNTPrimed) event.getEntity(), null);
|
||||||
if (region == null) return;
|
if (region == null) return;
|
||||||
trackedTNT.get(region).remove((TNTPrimed) event.getEntity());
|
trackedTNT.get(region).remove((TNTPrimed) event.getEntity());
|
||||||
tntSpawnRegion.remove((TNTPrimed) event.getEntity());
|
tntSpawnRegion.remove((TNTPrimed) event.getEntity());
|
||||||
|
|
||||||
activeTraces.get(region).addRecord(record((TNTPrimed) event.getEntity(), activeTraces.get(region), event.blockList()));
|
activeTraces.get(region).addRecord(record((TNTPrimed) event.getEntity(), activeTraces.get(region), event.blockList()));
|
||||||
|
tntSpawnRegion.remove((TNTPrimed) event.getEntity());
|
||||||
|
historyMap.remove((TNTPrimed) event.getEntity());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,6 @@ public class TraceRecordingWrapper {
|
|||||||
recordList = new ArrayList<>();
|
recordList = new ArrayList<>();
|
||||||
|
|
||||||
trace = new Trace(region, recordList);
|
trace = new Trace(region, recordList);
|
||||||
TraceManager.instance.add(trace);
|
|
||||||
File recordsSaveFile = new File(TraceManager.tracesFolder, trace.getUuid() + ".records");
|
File recordsSaveFile = new File(TraceManager.tracesFolder, trace.getUuid() + ".records");
|
||||||
recordsOutputStream = new ObjectOutputStream(new GZIPOutputStream(new FileOutputStream(recordsSaveFile)));
|
recordsOutputStream = new ObjectOutputStream(new GZIPOutputStream(new FileOutputStream(recordsSaveFile)));
|
||||||
}
|
}
|
||||||
@ -90,9 +89,6 @@ public class TraceRecordingWrapper {
|
|||||||
protected void finalizeRecording() {
|
protected void finalizeRecording() {
|
||||||
recordsOutputStream.flush();
|
recordsOutputStream.flush();
|
||||||
recordsOutputStream.close();
|
recordsOutputStream.close();
|
||||||
|
TraceManager.instance.add(trace);
|
||||||
if (trace.getRecords().isEmpty()) {
|
|
||||||
TraceManager.instance.remove(trace);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,20 +19,16 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.tracer.rendering;
|
package de.steamwar.bausystem.features.tracer.rendering;
|
||||||
|
|
||||||
import com.comphenix.tinyprotocol.Reflection;
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.features.tracer.TNTPoint;
|
import de.steamwar.bausystem.features.tracer.TNTPoint;
|
||||||
import de.steamwar.bausystem.features.tracer.Trace;
|
import de.steamwar.bausystem.features.tracer.Trace;
|
||||||
import de.steamwar.bausystem.features.tracer.TraceManager;
|
import de.steamwar.bausystem.features.tracer.TraceManager;
|
||||||
import de.steamwar.core.Core;
|
|
||||||
import de.steamwar.entity.REntity;
|
|
||||||
import de.steamwar.entity.REntityServer;
|
import de.steamwar.entity.REntityServer;
|
||||||
import de.steamwar.techhider.BlockIds;
|
import de.steamwar.entity.RFallingBlockEntity;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
import net.md_5.bungee.api.chat.ClickEvent;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -41,9 +37,7 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* Wrapper for the rendering of a record bundle
|
* Wrapper for the rendering of a record bundle
|
||||||
*/
|
*/
|
||||||
public class TraceEntity extends REntity {
|
public class TraceEntity extends RFallingBlockEntity {
|
||||||
|
|
||||||
private static final Reflection.MethodInvoker addEntityMethod = Reflection.getMethod(REntityServer.class, "addEntity", REntity.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The records represented by this REntity
|
* The records represented by this REntity
|
||||||
@ -59,12 +53,11 @@ public class TraceEntity extends REntity {
|
|||||||
private final Trace trace;
|
private final Trace trace;
|
||||||
|
|
||||||
public TraceEntity(REntityServer server, Location location, boolean isExplosion, List<TNTPoint> records, Trace trace) {
|
public TraceEntity(REntityServer server, Location location, boolean isExplosion, List<TNTPoint> records, Trace trace) {
|
||||||
super(server, EntityType.FALLING_BLOCK, location, BlockIds.impl.materialToId(isExplosion ? Material.RED_STAINED_GLASS : Material.TNT) >> (Core.getVersion() <= 12 ? 4 : 0));
|
super(server, location, isExplosion ? Material.RED_STAINED_GLASS : Material.TNT);
|
||||||
setNoGravity(true);
|
|
||||||
this.records = records;
|
this.records = records;
|
||||||
uniqueTntIdsString = records.stream().map(TNTPoint::getTntId).distinct().map(Object::toString).collect(Collectors.joining(" "));
|
|
||||||
this.trace = trace;
|
this.trace = trace;
|
||||||
addEntityMethod.invoke(server, this);
|
uniqueTntIdsString = records.stream().map(TNTPoint::getTntId).distinct().map(Object::toString).collect(Collectors.joining(" "));
|
||||||
|
setNoGravity(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -85,11 +78,4 @@ public class TraceEntity extends REntity {
|
|||||||
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_Z", player, representative.getVelocity().getZ() + "");
|
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_VELOCITY_Z", player, representative.getVelocity().getZ() + "");
|
||||||
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_ISOLATE", player, BauSystem.MESSAGE.parse("TRACE_MESSAGE_CLICK_ISOLATE", player), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace isolate " + TraceManager.instance.getId(trace) + " " + uniqueTntIdsString));
|
BauSystem.MESSAGE.sendPrefixless("TNT_CLICK_ISOLATE", player, BauSystem.MESSAGE.parse("TRACE_MESSAGE_CLICK_ISOLATE", player), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/trace isolate " + TraceManager.instance.getId(trace) + " " + uniqueTntIdsString));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object object) {
|
|
||||||
if (!(object instanceof TraceEntity)) return false;
|
|
||||||
TraceEntity entity = (TraceEntity) object;
|
|
||||||
return records.get(0).equals(entity.getRecords().get(0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@ -37,6 +34,9 @@ import java.util.stream.Stream;
|
|||||||
* A settable flag that changes how a trace is rendered
|
* A settable flag that changes how a trace is rendered
|
||||||
*/
|
*/
|
||||||
public abstract class ViewFlag {
|
public abstract class ViewFlag {
|
||||||
|
public static final Vector GRAVATY = new Vector(0.0, -0.04, 0.0);
|
||||||
|
public static final Vector DRAG_FACTOR = new Vector(0.98, 0.98, 0.98);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static registry of static flags
|
* Static registry of static flags
|
||||||
*/
|
*/
|
||||||
@ -120,26 +120,29 @@ public abstract class ViewFlag {
|
|||||||
@Override
|
@Override
|
||||||
public void modify(REntityServer server, List<TraceEntity> entities) {
|
public void modify(REntityServer server, List<TraceEntity> entities) {
|
||||||
for (TraceEntity entity : entities) {
|
for (TraceEntity entity : entities) {
|
||||||
TNTPoint current = entity.getRecords().get(0);
|
TNTPoint representative = entity.getRecords().get(0);
|
||||||
if (current.isExplosion()) continue;
|
Optional<TNTPoint> prev = representative.getPrevious();
|
||||||
TNTPoint next = current.getNext().orElse(null);
|
if (prev.isEmpty()) continue;
|
||||||
if (next == null) continue;
|
|
||||||
|
|
||||||
Location pos = current.getLocation().clone();
|
TNTPoint previous = prev.get();
|
||||||
pos.setY(next.getLocation().getY());
|
Location delta = representative.getLocation().clone().subtract(previous.getLocation());
|
||||||
|
Vector previousVelocity = previous.isAfterFirstExplosion() ? previous.getVelocity() : delta.toVector().clone().divide(DRAG_FACTOR).subtract(GRAVATY);
|
||||||
|
|
||||||
if (pos.distanceSquared(current.getLocation()) >= 1.0 / 256.0) {
|
Location yLocation = previous.getLocation().clone().add(0, delta.getY(), 0);
|
||||||
RFallingBlockEntity y = new RFallingBlockEntity(server, pos, Material.WHITE_STAINED_GLASS);
|
if (yLocation.distanceSquared(representative.getLocation()) >= 1.0 / 256.0 && yLocation.distanceSquared(previous.getLocation()) >= 1.0 / 256.0) {
|
||||||
|
RFallingBlockEntity y = new RFallingBlockEntity(server, yLocation, Material.WHITE_STAINED_GLASS);
|
||||||
y.setNoGravity(true);
|
y.setNoGravity(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current.getVelocity().getX() >= current.getVelocity().getZ()) {
|
Location secoundLocation;
|
||||||
pos.setX(next.getLocation().getX());
|
if (previousVelocity.getX() >= previousVelocity.getZ()) {
|
||||||
|
secoundLocation = previous.getLocation().clone().add(delta.getX(), delta.getY(), 0);
|
||||||
} else {
|
} else {
|
||||||
pos.setZ(next.getLocation().getZ());
|
secoundLocation = previous.getLocation().clone().add(0, delta.getY(), delta.getZ());
|
||||||
}
|
}
|
||||||
if (pos.distanceSquared(next.getLocation()) >= 1.0 / 256.0) {
|
|
||||||
RFallingBlockEntity second = new RFallingBlockEntity(server, pos, Material.WHITE_STAINED_GLASS);
|
if (secoundLocation.distanceSquared(representative.getLocation()) >= 1.0 / 256.0 && secoundLocation.distanceSquared(previous.getLocation()) >= 1.0 / 256.0) {
|
||||||
|
RFallingBlockEntity second = new RFallingBlockEntity(server, secoundLocation, Material.WHITE_STAINED_GLASS);
|
||||||
second.setNoGravity(true);
|
second.setNoGravity(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.bausystem.features.warp;
|
package de.steamwar.bausystem.features.warp;
|
||||||
|
|
||||||
import de.steamwar.bausystem.region.Region;
|
import de.steamwar.bausystem.region.Region;
|
||||||
|
import de.steamwar.core.Core;
|
||||||
import de.steamwar.entity.RArmorStand;
|
import de.steamwar.entity.RArmorStand;
|
||||||
import de.steamwar.entity.REntityServer;
|
import de.steamwar.entity.REntityServer;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
@ -107,9 +108,9 @@ public class WarpListener implements Listener {
|
|||||||
vector.setY(0);
|
vector.setY(0);
|
||||||
|
|
||||||
Vector position = p.getLocation().toVector().clone().add(vector.normalize().multiply(5));
|
Vector position = p.getLocation().toVector().clone().add(vector.normalize().multiply(5));
|
||||||
position.setY(p.getLocation().getY() - 1);
|
position.setY(p.getLocation().getY() - (Core.getVersion() >= 20 ? 0 : 1));
|
||||||
|
|
||||||
if (position.distanceSquared(current) < 0.1) {
|
if ((position.getX() - current.getX()) * (position.getX() - current.getX()) + (position.getZ() - current.getZ()) * (position.getZ() - current.getZ()) < 0.1) {
|
||||||
name = "§a§l" + name;
|
name = "§a§l" + name;
|
||||||
selected.computeIfAbsent(p, player -> new ArrayList<>()).add(location);
|
selected.computeIfAbsent(p, player -> new ArrayList<>()).add(location);
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package de.steamwar.bausystem.features.world;
|
package de.steamwar.bausystem.features.world;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.config.BauServer;
|
import de.steamwar.bausystem.config.BauServer;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import de.steamwar.sql.BauweltMember;
|
import de.steamwar.sql.BauweltMember;
|
||||||
@ -34,6 +35,7 @@ public class AntiBauAddMemberFix implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
if (BauSystem.DEV_SERVER) return;
|
||||||
if (event.getPlayer().getUniqueId().equals(BauServer.getInstance().getOwner())) {
|
if (event.getPlayer().getUniqueId().equals(BauServer.getInstance().getOwner())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -36,21 +36,26 @@ public class ClipboardListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLogin(PlayerJoinEvent e) {
|
public void onLogin(PlayerJoinEvent e) {
|
||||||
if(!Permission.SUPERVISOR.hasPermission(e.getPlayer())) return;
|
if (!Permission.SUPERVISOR.hasPermission(e.getPlayer())) return;
|
||||||
|
|
||||||
|
SchematicNode schematic;
|
||||||
try {
|
try {
|
||||||
SchematicNode schematic = SchematicNode.getSchematicNode(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), CLIPBOARD_SCHEMNAME, (Integer) null);
|
schematic = SchematicNode.getSchematicNode(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), CLIPBOARD_SCHEMNAME, (Integer) null);
|
||||||
if (schematic != null) {
|
} catch (Exception ex) {
|
||||||
new SchematicData(schematic).loadToPlayer(e.getPlayer());
|
return;
|
||||||
}
|
}
|
||||||
|
if (schematic == null) return;
|
||||||
|
try {
|
||||||
|
new SchematicData(schematic).loadToPlayer(e.getPlayer());
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// ignore cause players do all kind of stuff with schematics.... like massively oversized schems
|
// ignore cause players do all kind of stuff with schematics.... like massively oversized schems
|
||||||
|
schematic.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onLogout(PlayerQuitEvent e) {
|
public void onLogout(PlayerQuitEvent e) {
|
||||||
if(!Permission.SUPERVISOR.hasPermission(e.getPlayer())) return;
|
if (!Permission.SUPERVISOR.hasPermission(e.getPlayer())) return;
|
||||||
|
|
||||||
SchematicNode schematic = SchematicNode.getSchematicNode(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), CLIPBOARD_SCHEMNAME, (Integer) null);
|
SchematicNode schematic = SchematicNode.getSchematicNode(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), CLIPBOARD_SCHEMNAME, (Integer) null);
|
||||||
boolean newSchem = false;
|
boolean newSchem = false;
|
||||||
|
@ -41,6 +41,7 @@ import org.bukkit.event.block.BlockMultiPlaceEvent;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.entity.EntityPickupItemEvent;
|
import org.bukkit.event.entity.EntityPickupItemEvent;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@ -116,9 +117,11 @@ public class SpectatorListener implements Listener {
|
|||||||
|
|
||||||
private static void resendChunks(Player player) {
|
private static void resendChunks(Player player) {
|
||||||
Location location = player.getLocation().clone();
|
Location location = player.getLocation().clone();
|
||||||
player.teleport(location.clone().add(16.0 * player.getClientViewDistance(), 0, 16.0 * player.getClientViewDistance()));
|
Vector velocity = player.getVelocity().clone();
|
||||||
|
player.teleport(location.clone().add(16.0 * player.getClientViewDistance() + 32, 0, 16.0 * player.getClientViewDistance() + 32));
|
||||||
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskLater(BauSystem.getInstance(), () -> {
|
||||||
player.teleport(location);
|
player.teleport(location);
|
||||||
|
player.setVelocity(velocity);
|
||||||
}, 5);
|
}, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,6 +131,7 @@ public class SpectatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
if (BauSystem.DEV_SERVER) return;
|
||||||
if (event.getPlayer().getUniqueId().equals(BauServer.getInstance().getOwner())) {
|
if (event.getPlayer().getUniqueId().equals(BauServer.getInstance().getOwner())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -148,7 +152,7 @@ public class SpectatorListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBauMemberUpdate(BauMemberUpdateEvent event) {
|
public void onBauMemberUpdate(BauMemberUpdateEvent event) {
|
||||||
if (!anySupervisorOnline(null)) {
|
if (!anySupervisorOnline(null) && !BauSystem.DEV_SERVER) {
|
||||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||||
player.kickPlayer("");
|
player.kickPlayer("");
|
||||||
});
|
});
|
||||||
@ -165,6 +169,7 @@ public class SpectatorListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
NO_TECHHIDER.remove(event.getPlayer());
|
NO_TECHHIDER.remove(event.getPlayer());
|
||||||
|
if (BauSystem.DEV_SERVER) return;
|
||||||
if (!anySupervisorOnline(event.getPlayer())) {
|
if (!anySupervisorOnline(event.getPlayer())) {
|
||||||
Bukkit.getOnlinePlayers().forEach(player -> {
|
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||||
player.kickPlayer("");
|
player.kickPlayer("");
|
||||||
|
@ -35,6 +35,7 @@ public enum Flag implements EnumDisplay {
|
|||||||
FREEZE("FLAG_FREEZE", FreezeMode.class, FreezeMode.INACTIVE),
|
FREEZE("FLAG_FREEZE", FreezeMode.class, FreezeMode.INACTIVE),
|
||||||
PROTECT("FLAG_PROTECT", ProtectMode.class, ProtectMode.ACTIVE),
|
PROTECT("FLAG_PROTECT", ProtectMode.class, ProtectMode.ACTIVE),
|
||||||
ITEMS("FLAG_ITEMS", ItemMode.class, ItemMode.INACTIVE),
|
ITEMS("FLAG_ITEMS", ItemMode.class, ItemMode.INACTIVE),
|
||||||
|
NO_GRAVITY("FLAG_NO_GRAVITY", NoGravityMode.class, NoGravityMode.INACTIVE),
|
||||||
;
|
;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2021 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.bausystem.region.flags.flagvalues;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.region.flags.Flag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum NoGravityMode implements Flag.Value<NoGravityMode> {
|
||||||
|
|
||||||
|
ACTIVE("FLAG_NO_GRAVITY_ACTIVE"),
|
||||||
|
INACTIVE("FLAG_NO_GRAVITY_INACTIVE");
|
||||||
|
|
||||||
|
private static NoGravityMode[] values;
|
||||||
|
private final String chatValue;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NoGravityMode[] getValues() {
|
||||||
|
if (NoGravityMode.values == null) {
|
||||||
|
NoGravityMode.values = NoGravityMode.values(); //NOSONAR
|
||||||
|
}
|
||||||
|
return NoGravityMode.values;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NoGravityMode getValue() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public NoGravityMode getValueOf(final String name) {
|
||||||
|
try {
|
||||||
|
return NoGravityMode.valueOf(name.toUpperCase());
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
if (name.equalsIgnoreCase("false")) {
|
||||||
|
return NoGravityMode.INACTIVE;
|
||||||
|
}
|
||||||
|
return NoGravityMode.ACTIVE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -85,7 +85,7 @@ public class WorldData {
|
|||||||
try {
|
try {
|
||||||
worldData.toYAPION(new FileOutput(optionsFile)).close();
|
worldData.toYAPION(new FileOutput(optionsFile)).close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// Ignored
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: BauSystem
|
name: BauSystem
|
||||||
authors: [Lixfel, YoyoNow, Chaoscaot, Zeanon]
|
authors: [ Lixfel, YoyoNow, Chaoscaot, Zeanon, D4rkr34lm ]
|
||||||
version: "2.0"
|
version: "2.0"
|
||||||
depend: [WorldEdit, SpigotCore]
|
depend: [ WorldEdit, SpigotCore ]
|
||||||
load: POSTWORLD
|
load: POSTWORLD
|
||||||
main: de.steamwar.bausystem.BauSystem
|
main: de.steamwar.bausystem.BauSystem
|
||||||
api-version: "1.13"
|
api-version: "1.13"
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
// Adding the base plugin fixes the following gradle warnings in IntelliJ:
|
// Adding the base plugin fixes the following gradle warnings in IntelliJ:
|
||||||
//
|
//
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren