Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Jul 16, 2023
1 parent 8ef7b9a commit fa9d50a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/flectone/custom/FPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ public void addChatBubble(String message){
listChatBubbles.add(message);
}

public void removeChatBubble(int number){
if (listChatBubbles.size() > number) listChatBubbles.remove(number);
public void removeChatBubble(){
if (!listChatBubbles.isEmpty()) listChatBubbles.remove(0);
}

public List<Entity> getChatBubbleEntities() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ public void createMessage(Set<Player> recipients, Player player, String message,
.replace("<player>", FPlayerManager.getPlayer(player).getName());

fCommands.sendGlobalMessage(recipients, configMessage, message, itemStack, true);

fCommands.getFPlayer().addChatBubble(message);
}

@EventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import org.bukkit.entity.EntityType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.spigotmc.event.entity.EntityDismountEvent;

public class EntityDismountListener implements Listener {

@EventHandler
public void checkAreaEffectCloudDismount(EntityDismountEvent event){
Entity entity = event.getEntity();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/flectone/tickers/ChatBubbleTicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void run() {
String message = fPlayer.getListChatBubbles().get(0);
spawnMessageBubble(fPlayer.getPlayer(), message);

fPlayer.removeChatBubble(0);
fPlayer.removeChatBubble();
});
}

Expand Down

0 comments on commit fa9d50a

Please sign in to comment.