mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-26 02:19:23 +00:00
队伍名称防呆+修复家具座椅
This commit is contained in:
@@ -38,7 +38,7 @@ public class BukkitTeamManager implements TeamManager {
|
||||
Object scoreboard = FastNMS.INSTANCE.field$MinecraftServer$scoreboard();
|
||||
List<Object> packets = new ObjectArrayList<>();
|
||||
for (LegacyChatFormatter color : LegacyChatFormatter.values()) {
|
||||
String teamName = TEAM_PREFIX + color.name().toLowerCase(Locale.ROOT) + "_" + UUID.randomUUID();
|
||||
String teamName = TeamManager.createTeamName(color);
|
||||
Object team = FastNMS.INSTANCE.constructor$PlayerTeam(scoreboard, teamName);
|
||||
FastNMS.INSTANCE.method$PlayerTeam$setColor(team, color.name());
|
||||
this.teamByColor.put(color, team);
|
||||
|
||||
@@ -117,11 +117,11 @@ public abstract class Furniture implements Cullable {
|
||||
Seat<FurnitureHitBox>[] seats = hitbox.seats();
|
||||
for (int index = 0; index < seats.length; index++) {
|
||||
Map<Vector3f, Seat<FurnitureHitBox>> tempMap = seatMap.get();
|
||||
Vector3f seatPos = seats[i].config().position();
|
||||
Vector3f seatPos = seats[index].config().position();
|
||||
if (tempMap.containsKey(seatPos)) {
|
||||
seats[i] = tempMap.get(seatPos);
|
||||
seats[index] = tempMap.get(seatPos);
|
||||
} else {
|
||||
tempMap.put(seatPos, seats[i]);
|
||||
tempMap.put(seatPos, seats[index]);
|
||||
}
|
||||
}
|
||||
hitbox.collectVirtualEntityId(virtualEntityIds::addLast);
|
||||
|
||||
@@ -3,10 +3,15 @@ package net.momirealms.craftengine.core.world.score;
|
||||
import net.momirealms.craftengine.core.plugin.Manageable;
|
||||
import net.momirealms.craftengine.core.util.LegacyChatFormatter;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public interface TeamManager extends Manageable {
|
||||
String TEAM_PREFIX = "craftengine_";
|
||||
|
||||
Object getTeamByColor(LegacyChatFormatter color);
|
||||
|
||||
Object addTeamsPacket();
|
||||
|
||||
static String createTeamName(LegacyChatFormatter color) {
|
||||
return "\ufeffce_" + color.name().toLowerCase(Locale.ROOT) + "\ufeff";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user