Fix using delegated config properties from the Core

This commit is contained in:
Norbi Peti 2023-07-01 20:11:19 +02:00
parent 512a62d75c
commit d1515c2ab2
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
7 changed files with 9 additions and 9 deletions

View file

@ -106,7 +106,7 @@
</repository> </repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency> <dependency> <!-- TODO: Can't update MockBukkit because of a ByteBuddy exception and the old version relies on 1.19.1 -->
<groupId>io.papermc.paper</groupId> <groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId> <artifactId>paper-api</artifactId>
<version>1.19.1-R0.1-SNAPSHOT</version> <version>1.19.1-R0.1-SNAPSHOT</version>

View file

@ -20,7 +20,7 @@ public class VanillaUtils {
if (!isChatOn(p)) // Only send if client allows chat if (!isChatOn(p)) // Only send if client allows chat
return null; return null;
} catch (NoClassDefFoundError ex) { } catch (NoClassDefFoundError ex) {
MainPlugin.instance.getLogger().warning("Compatibility error, can't check if the chat is hidden by the player."); MainPlugin.getInstance().getLogger().warning("Compatibility error, can't check if the chat is hidden by the player.");
} }
return e.getGroupID(ChromaGamerBase.getFromSender(p)); return e.getGroupID(ChromaGamerBase.getFromSender(p));
} }

View file

@ -145,7 +145,7 @@ public class FlairComponent extends Component<PluginMain> {
} catch (Exception e) { } catch (Exception e) {
p.FlairState.set(FlairStates.Commented); // Flair unknown p.FlairState.set(FlairStates.Commented); // Flair unknown
p.SetFlair(ChatPlayer.FlairTimeNone); p.SetFlair(ChatPlayer.FlairTimeNone);
TBMCCoreAPI.SendException("Error while checking join date for player " + p.playerName + "!", e, this); TBMCCoreAPI.SendException("Error while checking join date for player " + p.getPlayerName() + "!", e, this);
} }
return; return;
default: default:

View file

@ -49,7 +49,7 @@ public class SetFlairCommand extends AdminCommandBase {
if (!mp.UserNames.get().contains(username)) if (!mp.UserNames.get().contains(username))
mp.UserNames.get().add(username); mp.UserNames.get().add(username);
} }
sender.sendMessage("§bThe flair has been set. Player: " + mp.playerName + " Flair: " + mp.GetFormattedFlair() + "§r"); sender.sendMessage("§bThe flair has been set. Player: " + mp.getPlayerName() + " Flair: " + mp.GetFormattedFlair() + "§r");
return true; return true;
} }

View file

@ -35,12 +35,12 @@ public class FormatterComponent extends Component<PluginMain> {
@Override @Override
protected void enable() { protected void enable() {
MainPlugin.instance.setChatHandlerEnabled(false); //Disable Core chat handler - if this component is disabled then let it do its job MainPlugin.getInstance().setChatHandlerEnabled(false); //Disable Core chat handler - if this component is disabled then let it do its job
} }
@Override @Override
protected void disable() { protected void disable() {
MainPlugin.instance.setChatHandlerEnabled(true); MainPlugin.getInstance().setChatHandlerEnabled(true);
} }
/** /**

View file

@ -54,8 +54,8 @@ public class FTopCommand extends ICommand2MC {
} }
val ai = new AtomicInteger(); val ai = new AtomicInteger();
sender.sendMessage("§6---- Top Fs ----"); sender.sendMessage("§6---- Top Fs ----");
sender.sendMessage(Arrays.stream(cached).skip((i - 1) * 10).limit(i * 10) sender.sendMessage(Arrays.stream(cached).skip((i - 1) * 10L).limit(i * 10L)
.map(cp -> String.format("%d. %s - %f.2", ai.incrementAndGet(), cp.playerName.get(), cp.getF())) .map(cp -> String.format("%d. %s - %f.2", ai.incrementAndGet(), cp.getPlayerName(), cp.getF()))
.collect(Collectors.joining("\n"))); .collect(Collectors.joining("\n")));
}); });
return true; return true;

View file

@ -57,7 +57,7 @@ public class PlayerListener implements Listener {
ChatPlayer cp = e.getPlayer().getAs(ChatPlayer.class); ChatPlayer cp = e.getPlayer().getAs(ChatPlayer.class);
if (cp == null) if (cp == null)
return; return;
e.addInfo("Minecraft name: " + cp.playerName.get()); e.addInfo("Minecraft name: " + cp.getPlayerName());
if (cp.UserName.get() != null && cp.UserName.get().length() > 0) if (cp.UserName.get() != null && cp.UserName.get().length() > 0)
e.addInfo("Reddit name: " + cp.UserName.get()); e.addInfo("Reddit name: " + cp.UserName.get());
if (ComponentManager.isEnabled(FlairComponent.class)) { if (ComponentManager.isEnabled(FlairComponent.class)) {