9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-25 18:09:20 +00:00

2.0-PRE-7-HOTFIX

This commit is contained in:
Xiao-MoMi
2022-09-12 22:50:26 +08:00
parent 871d8c3d64
commit fbb67f8949
12 changed files with 65 additions and 11 deletions

View File

@@ -27,7 +27,10 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class ArmorStandManager {

View File

@@ -17,7 +17,8 @@
package net.momirealms.customnameplates.nameplates;
import net.momirealms.customnameplates.font.*;
import net.momirealms.customnameplates.font.FontOffset;
import net.momirealms.customnameplates.font.FontUtil;
import org.bukkit.ChatColor;
public class NameplateUtil {

View File

@@ -21,7 +21,6 @@ import net.momirealms.customnameplates.ConfigManager;
import net.momirealms.customnameplates.hook.TABTeamHook;
import org.bukkit.entity.Player;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

View File

@@ -20,7 +20,6 @@ package net.momirealms.customnameplates.nameplates.listener;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import net.momirealms.customnameplates.CustomNameplates;
import net.momirealms.customnameplates.nameplates.mode.PacketsHandler;

View File

@@ -1,3 +1,20 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customnameplates.nameplates.mode;
import org.bukkit.event.EventHandler;

View File

@@ -1,3 +1,20 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customnameplates.nameplates.mode;
import org.bukkit.event.EventHandler;

View File

@@ -18,7 +18,6 @@
package net.momirealms.customnameplates.nameplates.mode;
import com.comphenix.protocol.events.PacketContainer;
import net.momirealms.customnameplates.ConfigManager;
import net.momirealms.customnameplates.CustomNameplates;
import net.momirealms.customnameplates.Function;
import net.momirealms.customnameplates.nameplates.listener.BukkitListener;

View File

@@ -1,3 +1,20 @@
/*
* Copyright (C) <2022> <XiaoMoMi>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package net.momirealms.customnameplates.nameplates.mode.bubbles;
import net.momirealms.customnameplates.CustomNameplates;

View File

@@ -21,10 +21,10 @@ import com.comphenix.protocol.events.PacketContainer;
import net.momirealms.customnameplates.ConfigManager;
import net.momirealms.customnameplates.CustomNameplates;
import net.momirealms.customnameplates.nameplates.ArmorStandManager;
import net.momirealms.customnameplates.nameplates.mode.PacketsHandler;
import net.momirealms.customnameplates.nameplates.listener.EntityDestroyListener;
import net.momirealms.customnameplates.nameplates.listener.EntityMountListener;
import net.momirealms.customnameplates.nameplates.listener.EntitySpawnListener;
import net.momirealms.customnameplates.nameplates.mode.PacketsHandler;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
@@ -93,7 +93,9 @@ public class RdPacketsHandler extends PacketsHandler {
@Override
public void onEntityMount(PacketContainer packet) {
int[] ids = ridingTag.getArmorStandManager(super.getPlayerFromMap(packet.getIntegers().read(0))).getArmorStandIDs();
Player player = super.getPlayerFromMap(packet.getIntegers().read(0));
if (player == null) return;
int[] ids = ridingTag.getArmorStandManager(player).getArmorStandIDs();
if (ids != null) {
int[] old = packet.getIntegerArrays().read(0);
int[] idArray = new int[ids.length + old.length];

View File

@@ -106,7 +106,7 @@ public class RidingTag extends EntityTag {
if (target == viewer) return;
if (viewer.getWorld() != target.getWorld()) return;
if (getDistance(target, viewer) < 48 && viewer.canSee(target)) {
ArmorStandManager asm = (ArmorStandManager) getArmorStandManager(target);
ArmorStandManager asm = getArmorStandManager(target);
asm.spawn(viewer);
Bukkit.getScheduler().runTaskAsynchronously(CustomNameplates.instance, () -> {
asm.mount(viewer);

View File

@@ -19,10 +19,10 @@ package net.momirealms.customnameplates.nameplates.mode.tm;
import net.momirealms.customnameplates.ConfigManager;
import net.momirealms.customnameplates.CustomNameplates;
import net.momirealms.customnameplates.nameplates.TeamManager;
import net.momirealms.customnameplates.nameplates.mode.NameplateManager;
import net.momirealms.customnameplates.nameplates.NameplatesTeam;
import net.momirealms.customnameplates.nameplates.TeamManager;
import net.momirealms.customnameplates.nameplates.mode.EventListener;
import net.momirealms.customnameplates.nameplates.mode.NameplateManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;

View File

@@ -24,7 +24,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitTask;
import java.util.*;
import java.util.WeakHashMap;
public class VehicleChecker extends Function {