Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slime format conversion improvement #908

Merged
merged 93 commits into from
Nov 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
29f488b
Fix sidebar title animation not working #660
tomkeuper Feb 6, 2023
83162e1
Fixed wins placeholder not in lobby sidebar #658
tomkeuper Feb 8, 2023
1db9bd7
Fixed NPE when clicking outside of shop inventory #664
tomkeuper Feb 8, 2023
36b3a70
Fixed command error when lobby location is not set
tomkeuper Feb 8, 2023
f54c201
Added unformatted player name to kill message and bed destroy
tomkeuper Feb 9, 2023
a056d04
Added Netherite armor to 1.16+ (#657)
tomkeuper Feb 11, 2023
b7c75d2
Added missing items in v1_12_R1
tomkeuper Feb 11, 2023
bd5df96
Fixed level just showing numer (#661)
tomkeuper Feb 12, 2023
403f474
Merge pull request #667 from andrei1058/fixes
andrei1058 Feb 12, 2023
ed86ef3
expose sidebar on API
andrei1058 Feb 16, 2023
033ede1
a few updates (#632)
Xxyuri2005xX Feb 16, 2023
2d015f7
add sidebar init event
andrei1058 Feb 17, 2023
e73eab6
Merge remote-tracking branch 'origin/master'
andrei1058 Feb 17, 2023
e244413
fix team identifier length (#682)
andrei1058 Feb 25, 2023
9d2f1ad
Bug fixes and placeholder adjustments (#685)
tomkeuper Feb 26, 2023
3ccb3b9
fix no tab formatting for first player (#692)
tomkeuper Feb 28, 2023
30a393c
fix losing permanent items on rejoin (#385)
tomkeuper Mar 1, 2023
5a0b5be
fix scoreboard getting send twice (#690)
tomkeuper Mar 3, 2023
975e3ed
fix void tp on newer servers
tomkeuper Mar 3, 2023
8b8bd87
fix swords disappearing (#686)
tomkeuper Mar 4, 2023
f511c1b
fix invisibility potion compatibility with 1.8.8
andrei1058 Mar 5, 2023
abb6ba9
fix lobby tablist (#701)
tomkeuper Mar 5, 2023
cccae7a
Merge pull request #704 from andrei1058/issue-688
tomkeuper Mar 5, 2023
ba5e310
Add translation for Simplified Chinese (#628)
skbeh Mar 6, 2023
f7e6257
Remove hand from hideArmor
tomkeuper Mar 7, 2023
07979b0
fix placeholders
tomkeuper Mar 7, 2023
8f08acb
Fix elapsed time always null (#574)
tomkeuper Mar 7, 2023
2c3f7a2
fix header and footer
andrei1058 Mar 11, 2023
7a63f59
clean up
andrei1058 Mar 11, 2023
8ce841d
should fix #699
andrei1058 Mar 11, 2023
5403206
Merge branch 'master' into issue-688
andrei1058 Mar 11, 2023
93ed9d4
Remove Deprecation Warning for Version and Update getServerVersion Me…
JT122406 Mar 11, 2023
bbb6f40
Merge branch 'master' into issue-688
andrei1058 Mar 11, 2023
c86aadf
fix #712
andrei1058 Mar 12, 2023
692ee73
Add user texture to player head (#333)
tomkeuper Mar 16, 2023
4e4e3a7
Merge branch 'bug-fixes' into issue-688
tomkeuper Mar 16, 2023
a99f3ae
Merge pull request #718 from andrei1058/issue-688
tomkeuper Mar 16, 2023
da0a951
Add gamesPlayed placeholder
tomkeuper Mar 16, 2023
efa392c
Fixed placeholder typos
tomkeuper Mar 18, 2023
f9365d5
remove unnecessary teams
tomkeuper Mar 19, 2023
bf0306d
fix placeholder
tomkeuper Mar 20, 2023
52f4e63
Merge remote-tracking branch 'origin/bug-fixes' into bug-fixes
tomkeuper Mar 21, 2023
d30fbbc
fix player name invisible on 1.8
tomkeuper Mar 22, 2023
785386b
removed replace gens with air (#529)
tomkeuper Mar 24, 2023
d7a874a
add check if respawning (#732)
tomkeuper Mar 24, 2023
5dd6a68
Add catch for teleport exceptions
tomkeuper Mar 24, 2023
6856c33
Add global placeholders
tomkeuper Mar 24, 2023
a9d1f7e
Add global placeholders to header and footer (#730)
tomkeuper Mar 24, 2023
f5c75f0
Add invis removed message
tomkeuper Mar 25, 2023
60562a7
Merge remote-tracking branch 'origin/bug-fixes' into bug-fixes
tomkeuper Mar 25, 2023
9f02570
fix papi support
andrei1058 Mar 26, 2023
ecd1abb
keep old placeholder at least for a few updates
andrei1058 Mar 26, 2023
df2a3cd
Bug fixes (#740)
tomkeuper Mar 26, 2023
f150a3e
clean up
andrei1058 Mar 26, 2023
ba7ea3d
Merge remote-tracking branch 'origin/master'
andrei1058 Mar 26, 2023
043bd19
Internal Party Additions (Promote, list/info commands) (#715)
JT122406 Mar 26, 2023
812efc1
Update Russian.java (#696)
werxqq0 Mar 26, 2023
d9a6a21
add missing return
andrei1058 Mar 26, 2023
20d7ecc
Merge branch 'production' into master
andrei1058 Mar 26, 2023
bc6abf5
Merge branch 'production'
andrei1058 Mar 26, 2023
d9a318d
Merge remote-tracking branch 'origin/master'
andrei1058 Mar 26, 2023
6e42383
Fix #760 (#792)
JT122406 Jun 10, 2023
c0bd23d
Added placeholders {team} and {teamColor} to display the player team …
Lsy-291 Jun 10, 2023
83b9c46
Reduce some race conditions with IArena#getStatus (#775)
skbeh Jun 10, 2023
fa986ca
Added support for 1.19_R3 (#761)
Tom18314 Jun 10, 2023
c5eec9b
Fix dropping and picking up items if main lobby is set on shared mode…
andrei1058 Jun 11, 2023
eaab09c
readme update (#811)
andrei1058 Jun 18, 2023
2b81f8d
Fixed bug where Dream Defender and Bed Bug were spawning at player's …
PmzHeroV69 Jun 23, 2023
25dd53f
Add 1.20 support (#814)
andrei1058 Jun 25, 2023
122c023
fix missing dependency on 1.17+ (#817)
andrei1058 Jun 25, 2023
e8f529d
world restore adapters update (#820)
andrei1058 Jun 25, 2023
535b44f
Glass protection barrier rework (#469)
IIHERO4 Jul 16, 2023
50dc80e
Fix default tower item (#831)
ImYenil Jul 16, 2023
11004b5
version string update
andrei1058 Jul 16, 2023
4f301f7
change heal pool work (#832)
ImYenil Jul 16, 2023
63e193f
Fix magic miner upgrade (#830)
ImYenil Jul 16, 2023
2bf475d
Fix heal pool not working (#829)
ImYenil Jul 16, 2023
a5efdf4
Fix sword upgrade (#828)
ImYenil Jul 16, 2023
9a0c438
fix missed implementation
andrei1058 Jul 22, 2023
75c6291
Fix Parties getParty with player UUID (#860)
AlessioDP Aug 26, 2023
22ec7e5
fix not loading (#875)
andrei1058 Oct 14, 2023
6f4433a
Sidebar and Tab improvements, session stats remake (#845)
andrei1058 Oct 28, 2023
61d922e
add 1.20 r2 support (#896)
andrei1058 Oct 30, 2023
34976a6
Fix PAF Null issue (#853)
JT122406 Oct 31, 2023
b50a7eb
fix disablearena command (#839)
ImYenil Oct 31, 2023
edd50a9
correct silverfish name (#840)
ImYenil Oct 31, 2023
d6f167f
Fix block protection (#841)
ImYenil Oct 31, 2023
8e66b27
SpoilPlayerTNTFeature code improvements (#892)
ImYenil Oct 31, 2023
7d837b3
Merge remote-tracking branch 'origin/production'
andrei1058 Nov 10, 2023
6264a2c
Merge remote-tracking branch 'origin/master'
andrei1058 Nov 10, 2023
97d502e
fix #906, clean up (#907)
andrei1058 Nov 18, 2023
b664600
downgrade java version
andrei1058 Nov 18, 2023
13c2ccc
Merge remote-tracking branch 'origin/production'
andrei1058 Nov 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix invisibility potion compatibility with 1.8.8
  • Loading branch information
andrei1058 committed Mar 5, 2023
commit f511c1b1a97e0fba5ec2ae699b3d4b5c0390672f
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
import org.bukkit.ChatColor;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -367,6 +368,7 @@ private void handlePlayerList() {
/**
* Handle given player in sidebar owner tab list.
* Will remove existing tab and give a new one based on game conditions list like spectator, team red, etc.
* Will handle invisibility potion as well.
*/
public void giveUpdateTabFormat(@NotNull Player player, boolean skipStateCheck) {
// if sidebar was not created
@@ -481,9 +483,28 @@ public void giveUpdateTabFormat(@NotNull Player player, boolean skipStateCheck)
throw new RuntimeException("Wtf dude");
}

String tabName = TEAM_PREFIX+Base64.getEncoder().encodeToString((team.getName()).getBytes(StandardCharsets.UTF_8));
if (tabName.length() > 16) {
tabName = tabName.substring(0, 16);
String tabName = this.getTabName(team);
String tabNameInvisible = tabName = tabName.substring(0, tabName.length() >= 16 ? 15 : tabName.length());
tabNameInvisible += "^!";

if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) {
if (!team.isMember(getPlayer())) {
// remove player from its tab group (if team tab group)
PlayerTab teamTab = tabList.getOrDefault(tabName, null);
if (null != teamTab) {
teamTab.remove(player);

// create or get tab group for the invisible players in that team
// set tab group name visibility to false
// identifier for invisibility
tabName = tabNameInvisible;
}
}
} else {
PlayerTab invTab = tabList.getOrDefault(tabNameInvisible, null);
if (null != invTab) {
invTab.remove(player);
}
}

PlayerTab teamTab = tabList.get(tabName);
@@ -500,16 +521,28 @@ public void giveUpdateTabFormat(@NotNull Player player, boolean skipStateCheck)

teamTab = handle.playerTabCreate(tabName, null, prefix, suffix, PlayerTab.PushingRule.PUSH_OTHER_TEAMS);
tabList.put(tabName, teamTab);
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) {
teamTab.setNameTagVisibility(PlayerTab.NameTagVisibility.NEVER);
}
}

teamTab.add(player);

// todo this should be outside. we are basically sending the player header and footer in sidebar holder's language
SidebarManager.getInstance().sendHeaderFooter(
player, lang.m(Messages.FORMATTING_SIDEBAR_TAB_HEADER_PLAYING),
lang.m(Messages.FORMATTING_SIDEBAR_TAB_FOOTER_PLAYING)
);
}

private @NotNull String getTabName(@NotNull ITeam team) {
String tabName = TEAM_PREFIX + Base64.getEncoder().encodeToString((team.getName()).getBytes(StandardCharsets.UTF_8));
if (tabName.length() > 16) {
tabName = tabName.substring(0, 16);
}
return tabName;
}

@NotNull
private SidebarLine getTabText(String path, Player targetPlayer, @Nullable HashMap<String, String> replacements) {
List<String> strings = Language.getList(getPlayer(), path);
@@ -646,17 +679,68 @@ public String getLine() {
/**
* Hide player name tag on head when he drinks an invisibility potion.
* This is required because not all clients hide it automatically.
*
* @param toggle true when applied, false when expired.
*/
public void handleInvisibilityPotion(@NotNull Player player, boolean toggle) {
if (toggle) {
// handle.remove(player);
// handle.playerListHideNameTag(player);
//todo the new sidebar does not provide a solution for invisibility potion?!!
} else {
if (null == arena) {
throw new RuntimeException("This can only be used when the player is in arena");
}
this.giveUpdateTabFormat(player, false);
// if (toggle) {
//
// ITeam playerTeam = arena.getTeam(player);
//
// // foreach enemy sidebar
// for (Player inGame : arena.getPlayers()) {
// if (playerTeam != null && !playerTeam.isMember(inGame)) {
// ISidebar sidebar = SidebarService.getInstance().getSidebar(inGame);
// if (sidebar instanceof BwSidebar) {
//
// // remove player from its tab group (if team tab group)
// PlayerTab teamTab = ((BwSidebar) sidebar).tabList.getOrDefault(getTabName(playerTeam), null);
// if (null != teamTab) {
// teamTab.remove(player);
// // create a new tab group for the invisible player
// // set tab group name visibility to false
// PlayerTab playerTab = sidebar.getHandle().playerTabCreate(player.getName(), null,
// new SidebarLine() {
// @Override
// public @NotNull String getLine() {
// return "";
// }
// },
// new SidebarLine() {
// @Override
// public @NotNull String getLine() {
// return "";
// }
// }, PlayerTab.PushingRule.NEVER
// );
// playerTab.setNameTagVisibility(PlayerTab.NameTagVisibility.NEVER);
// } else {
// // if player has personal tab list
// PlayerTab personalTab = ((BwSidebar) sidebar).tabList.getOrDefault(playerTeam.getName(), null);
// if (null != personalTab) {
// personalTab.setNameTagVisibility(PlayerTab.NameTagVisibility.NEVER);
// }
// }
// }
// }
// }
//
//
//// handle.remove(player);
//// handle.playerListHideNameTag(player);
// //todo the new sidebar does not provide a solution for invisibility potion?!!
// } else {
// foreach enemy sidebar
// get player tab group from enemy sidebar
// add player to tab group

// this.giveUpdateTabFormat(player, false);
// handle.playerListRestoreNameTag(player);
}
// }
}

public Sidebar getHandle() {