Manually update to adventure snapshots to fix 1.20.6 adventure

This commit is contained in:
fullwall 2024-05-08 21:32:43 +08:00
parent 2dd4a2001b
commit b12732d805
7 changed files with 105 additions and 33 deletions

View File

@ -14,7 +14,7 @@
<craftbukkit.version>1.20.6-R0.1-SNAPSHOT</craftbukkit.version> <craftbukkit.version>1.20.6-R0.1-SNAPSHOT</craftbukkit.version>
<placeholderapi.version>2.11.5</placeholderapi.version> <placeholderapi.version>2.11.5</placeholderapi.version>
<citizensapi.version>${project.version}</citizensapi.version> <citizensapi.version>${project.version}</citizensapi.version>
<worldguard.version>7.1.0-SNAPSHOT</worldguard.version> <worldguard.version>7.1.0-SNAPSHOT</worldguard.version>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>
@ -45,6 +45,10 @@
<id>AlessioDP</id> <id>AlessioDP</id>
<url>https://repo.alessiodp.com/releases/</url> <url>https://repo.alessiodp.com/releases/</url>
</repository> </repository>
<repository>
<id>sonatype-oss-snapshots1</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories> </repositories>
<dependencies> <dependencies>
<dependency> <dependency>
@ -53,7 +57,7 @@
<version>${craftbukkit.version}</version> <version>${craftbukkit.version}</version>
<type>jar</type> <type>jar</type>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.sf.trove4j</groupId> <groupId>net.sf.trove4j</groupId>
<artifactId>trove4j</artifactId> <artifactId>trove4j</artifactId>
@ -111,13 +115,13 @@
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId> <artifactId>adventure-text-minimessage</artifactId>
<version>4.16.0</version> <version>4.17.0</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.kyori</groupId> <groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId> <artifactId>adventure-platform-bukkit</artifactId>
<version>4.3.2</version> <version>4.3.3-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
@ -144,7 +148,7 @@
<include>*.json</include> <include>*.json</include>
<include>LICENSE</include> <include>LICENSE</include>
</includes> </includes>
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin> <plugin>

View File

@ -293,21 +293,27 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
lib.loadLibrary(Library.builder().groupId("net{}sf{}trove4j").artifactId("trove4j").version("3.0.3") lib.loadLibrary(Library.builder().groupId("net{}sf{}trove4j").artifactId("trove4j").version("3.0.3")
.relocate("gnu{}trove", "clib{}trove").build()); .relocate("gnu{}trove", "clib{}trove").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-minimessage") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-minimessage")
.version("4.16.0").relocate("net{}kyori", "clib{}net{}kyori").build()); .version("4.17.0").relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-api").version("4.16.0") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-api").version("4.17.0")
.relocate("net{}kyori", "clib{}net{}kyori").build()); .relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-key").version("4.16.0") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-key").version("4.17.0")
.relocate("net{}kyori", "clib{}net{}kyori").build()); .relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("examination-api").version("1.3.0") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("examination-api").version("1.3.0")
.relocate("net{}kyori", "clib{}net{}kyori").build()); .relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("examination-string").version("1.3.0") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("examination-string").version("1.3.0")
.relocate("net{}kyori", "clib{}net{}kyori").build()); .relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-bukkit").version("4.3.2") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-bukkit")
.version("4.3.3-SNAPSHOT")
.url("https://s01.oss.sonatype.org/content/repositories/snapshots/net/kyori/adventure-platform-bukkit/4.3.3-SNAPSHOT/adventure-platform-bukkit-4.3.3-20240507.021326-6.jar")
.relocate("net{}kyori", "clib{}net{}kyori").build()); .relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-api").version("4.3.2") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-api")
.version("4.3.3-SNAPSHOT")
.url("https://s01.oss.sonatype.org/content/repositories/snapshots/net/kyori/adventure-platform-api/4.3.3-SNAPSHOT/adventure-platform-api-4.3.3-20240507.021326-6.jar")
.relocate("net{}kyori", "clib{}net{}kyori").build()); .relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-serializer-bungeecord") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-serializer-bungeecord")
.version("4.3.2").relocate("net{}kyori", "clib{}net{}kyori").build()); .version("4.3.3-SNAPSHOT")
.url("https://s01.oss.sonatype.org/content/repositories/snapshots/net/kyori/adventure-text-serializer-bungeecord/4.3.3-SNAPSHOT/adventure-text-serializer-bungeecord-4.3.3-20240507.021326-6.jar")
.relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-serializer-legacy") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-serializer-legacy")
.version("4.13.1").relocate("net{}kyori", "clib{}net{}kyori").build()); .version("4.13.1").relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-nbt").version("4.13.1") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-nbt").version("4.13.1")
@ -316,10 +322,12 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
.version("4.13.1").relocate("net{}kyori", "clib{}net{}kyori").build()); .version("4.13.1").relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-serializer-gson-legacy-impl") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-text-serializer-gson-legacy-impl")
.version("4.13.1").relocate("net{}kyori", "clib{}net{}kyori").build()); .version("4.13.1").relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-facet").version("4.3.2") lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-facet").url(
.relocate("net{}kyori", "clib{}net{}kyori").build()); "https://s01.oss.sonatype.org/content/repositories/snapshots/net/kyori/adventure-platform-facet/4.3.3-SNAPSHOT/adventure-platform-facet-4.3.3-20240507.021326-6.jar")
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-viaversion") .version("4.3.3-SNAPSHOT").relocate("net{}kyori", "clib{}net{}kyori").build());
.version("4.3.2").relocate("net{}kyori", "clib{}net{}kyori").build()); lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("adventure-platform-viaversion").url(
"https://s01.oss.sonatype.org/content/repositories/snapshots/net/kyori/adventure-platform-viaversion/4.3.3-SNAPSHOT/adventure-platform-viaversion-4.3.3-20240507.021326-6.jar")
.version("4.3.3-SNAPSHOT").relocate("net{}kyori", "clib{}net{}kyori").build());
try { try {
Class.forName("org.joml.Vector3f"); Class.forName("org.joml.Vector3f");
} catch (Throwable t) { } catch (Throwable t) {

View File

@ -3,6 +3,7 @@ package net.citizensnpcs.trait;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -21,6 +22,7 @@ import org.bukkit.entity.EntityType;
import org.bukkit.entity.ItemDisplay; import org.bukkit.entity.ItemDisplay;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.TextDisplay; import org.bukkit.entity.TextDisplay;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Transformation; import org.bukkit.util.Transformation;
@ -34,6 +36,7 @@ import net.citizensnpcs.Settings.Setting;
import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.command.Arg.CompletionsProvider; import net.citizensnpcs.api.command.Arg.CompletionsProvider;
import net.citizensnpcs.api.command.CommandContext; import net.citizensnpcs.api.command.CommandContext;
import net.citizensnpcs.api.event.NPCEvent;
import net.citizensnpcs.api.npc.MemoryNPCDataStore; import net.citizensnpcs.api.npc.MemoryNPCDataStore;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.api.npc.NPCRegistry; import net.citizensnpcs.api.npc.NPCRegistry;
@ -115,20 +118,37 @@ public class HologramTrait extends Trait {
} }
private HologramRenderer createDefaultHologramRenderer() { private HologramRenderer createDefaultHologramRenderer() {
HologramRenderer renderer;
String hologramSetting = Setting.DEFAULT_HOLOGRAM_RENDERER.asString(); String hologramSetting = Setting.DEFAULT_HOLOGRAM_RENDERER.asString();
if (!SUPPORTS_DISPLAY || hologramSetting.equalsIgnoreCase("armorstand")) if (!SUPPORTS_DISPLAY || hologramSetting.equalsIgnoreCase("armorstand")) {
return new ArmorstandRenderer(); renderer = new ArmorstandRenderer();
return hologramSetting.equalsIgnoreCase("interaction") ? new InteractionVehicleRenderer() } else {
: new TextDisplayRenderer(); renderer = hologramSetting.equalsIgnoreCase("interaction") ? new InteractionVehicleRenderer()
: new TextDisplayRenderer();
}
if (HologramRendererCreateEvent.handlers.getRegisteredListeners().length > 0) {
HologramRendererCreateEvent event = new HologramRendererCreateEvent(npc, renderer, false);
Bukkit.getPluginManager().callEvent(event);
renderer = event.getRenderer();
}
return renderer;
} }
private HologramRenderer createNameRenderer() { private HologramRenderer createNameRenderer() {
HologramRenderer renderer;
if (SpigotUtil.getVersion()[1] >= 20) { if (SpigotUtil.getVersion()[1] >= 20) {
return new TextDisplayVehicleRenderer(); renderer = new TextDisplayVehicleRenderer();
} else if (SpigotUtil.getVersion()[1] == 19) { } else if (SpigotUtil.getVersion()[1] == 19) {
return new InteractionVehicleRenderer(); renderer = new InteractionVehicleRenderer();
} else {
renderer = new ArmorstandVehicleRenderer();
} }
return new ArmorstandVehicleRenderer(); if (HologramRendererCreateEvent.handlers.getRegisteredListeners().length > 0) {
HologramRendererCreateEvent event = new HologramRendererCreateEvent(npc, renderer, true);
Bukkit.getPluginManager().callEvent(event);
renderer = event.getRenderer();
}
return renderer;
} }
private double getHeight(int lineNumber) { private double getHeight(int lineNumber) {
@ -514,6 +534,37 @@ public class HologramTrait extends Trait {
void updateText(NPC parent, String text); void updateText(NPC parent, String text);
} }
public static class HologramRendererCreateEvent extends NPCEvent {
private final boolean nameRenderer;
private HologramRenderer renderer;
protected HologramRendererCreateEvent(NPC npc, HologramRenderer renderer, boolean nameRenderer) {
super(npc);
this.renderer = renderer;
this.nameRenderer = nameRenderer;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public HologramRenderer getRenderer() {
return renderer;
}
public boolean isNameRenderer() {
return nameRenderer;
}
public void setRenderer(HologramRenderer renderer) {
Objects.requireNonNull(renderer);
this.renderer = renderer;
}
private static final HandlerList handlers = new HandlerList();
}
public class InteractionVehicleRenderer extends SingleEntityHologramRenderer { public class InteractionVehicleRenderer extends SingleEntityHologramRenderer {
private Vector3d lastOffset; private Vector3d lastOffset;

View File

@ -38,7 +38,11 @@
"citizens.commands.npc.anchor.invalid-name" : "유효하지 않은 앵커 이름입니다.", "citizens.commands.npc.anchor.invalid-name" : "유효하지 않은 앵커 이름입니다.",
"citizens.commands.npc.anchor.missing" : "앵커 [[{1}]]이(가) 존재하지 않습니다.", "citizens.commands.npc.anchor.missing" : "앵커 [[{1}]]이(가) 존재하지 않습니다.",
"citizens.commands.npc.anchor.removed" : "앵커가 제거되었습니다.", "citizens.commands.npc.anchor.removed" : "앵커가 제거되었습니다.",
"citizens.commands.npc.armadillo.state-set" : "상태가 [[{0}]]로 설정됨",
"citizens.commands.npc.armorstand.description" : "아머스탠드 속성 설정 ", "citizens.commands.npc.armorstand.description" : "아머스탠드 속성 설정 ",
"citizens.commands.npc.attribute.description" : "다양한 NPC 속성 설정",
"citizens.commands.npc.attribute.reset" : "속성 [[{0}]]이 기본값으로 재설정되었습니다.",
"citizens.commands.npc.attribute.set" : "속성 [[{0}]]이(가) 기본 값 [[{1}]]으로 설정되었습니다.",
"citizens.commands.npc.axolotl.description" : "아홀로틀 타입 부여", "citizens.commands.npc.axolotl.description" : "아홀로틀 타입 부여",
"citizens.commands.npc.axolotl.invalid-variant" : "유효하지 않은 변종입니다. 유효한 변종은 [[{0}]]입니다.", "citizens.commands.npc.axolotl.invalid-variant" : "유효하지 않은 변종입니다. 유효한 변종은 [[{0}]]입니다.",
"citizens.commands.npc.axolotl.playing-dead" : "[[{0}]]은(는) 이제 죽은 척을 합니다.", "citizens.commands.npc.axolotl.playing-dead" : "[[{0}]]은(는) 이제 죽은 척을 합니다.",
@ -51,6 +55,8 @@
"citizens.commands.npc.bee.invalid-anger" : "분노는 0보다 커야 합니다.", "citizens.commands.npc.bee.invalid-anger" : "분노는 0보다 커야 합니다.",
"citizens.commands.npc.bee.no-nectar" : "[[{0}]]이(가) 꿀을 가지고 있지 않습니다.", "citizens.commands.npc.bee.no-nectar" : "[[{0}]]이(가) 꿀을 가지고 있지 않습니다.",
"citizens.commands.npc.bee.not-stung" : "[[{0}]]이(가) 더 이상 쏘지 않았습니다.", "citizens.commands.npc.bee.not-stung" : "[[{0}]]이(가) 더 이상 쏘지 않았습니다.",
"citizens.commands.npc.boat.description" : "보트 수정자를 설정합니다.",
"citizens.commands.npc.boat.type-set" : "보트 유형이 [[{0}]](으)로 설정되었습니다.",
"citizens.commands.npc.bossbar.description" : "보스바 속성 설정", "citizens.commands.npc.bossbar.description" : "보스바 속성 설정",
"citizens.commands.npc.camel.description" : "낙타 타입 부여", "citizens.commands.npc.camel.description" : "낙타 타입 부여",
"citizens.commands.npc.camel.pose-set" : "자세가 [{0}]로 설정되었습니다.", "citizens.commands.npc.camel.pose-set" : "자세가 [{0}]로 설정되었습니다.",
@ -140,8 +146,14 @@
"citizens.commands.npc.fox.crouching-set" : "[[{0}]]이(가) 앉았습니다.", "citizens.commands.npc.fox.crouching-set" : "[[{0}]]이(가) 앉았습니다.",
"citizens.commands.npc.fox.crouching-unset" : "[[{0}]]이(가) 더 이상 앉지 않습니다.", "citizens.commands.npc.fox.crouching-unset" : "[[{0}]]이(가) 더 이상 앉지 않습니다.",
"citizens.commands.npc.fox.description" : "여우 타입 부여", "citizens.commands.npc.fox.description" : "여우 타입 부여",
"citizens.commands.npc.fox.faceplanted-set" : "[[{0}]]이(가) 이제 페이스플랜트되었습니다.",
"citizens.commands.npc.fox.faceplanted-unset" : "\n[[{0}]]은(는) 더 이상 페이스플랜트되지 않습니다.",
"citizens.commands.npc.fox.fox-type-set" : "여우 몹 유형이 [{0}]로 설정되었습니다.", "citizens.commands.npc.fox.fox-type-set" : "여우 몹 유형이 [{0}]로 설정되었습니다.",
"citizens.commands.npc.fox.interested-set" : "\n[[{0}]]님이 이제 관심을 갖고 있습니다.",
"citizens.commands.npc.fox.interested-unset" : "[[{0}]]님은 더 이상 관심이 없습니다.",
"citizens.commands.npc.fox.invalid-fox-type" : "유효하지 않은 여우 몹 유형이 지정되었습니다. 유효한 유형은 [[{0}]]입니다.", "citizens.commands.npc.fox.invalid-fox-type" : "유효하지 않은 여우 몹 유형이 지정되었습니다. 유효한 유형은 [[{0}]]입니다.",
"citizens.commands.npc.fox.pouncing-set" : "[[{0}]]이(가) 지금 덤벼들고 있습니다.",
"citizens.commands.npc.fox.pouncing-unset" : "[[{0}]]은(는) 더 이상 덤벼들지 않습니다.",
"citizens.commands.npc.fox.sitting-set" : "[[{0}]]이(가) 앉았습니다.", "citizens.commands.npc.fox.sitting-set" : "[[{0}]]이(가) 앉았습니다.",
"citizens.commands.npc.fox.sitting-unset" : "[[{0}]]이(가) 더 이상 앉지 않습니다.", "citizens.commands.npc.fox.sitting-unset" : "[[{0}]]이(가) 더 이상 앉지 않습니다.",
"citizens.commands.npc.fox.sleeping-set" : "[[{0}]]이(가) 잠자리에 들었습니다.", "citizens.commands.npc.fox.sleeping-set" : "[[{0}]]이(가) 잠자리에 들었습니다.",
@ -203,6 +215,11 @@
"citizens.commands.npc.id.description" : "선택한 NPC의 ID를 발신자에게 전송합니다.", "citizens.commands.npc.id.description" : "선택한 NPC의 ID를 발신자에게 전송합니다.",
"citizens.commands.npc.inventory.description" : "NPC의 인벤토리 보기", "citizens.commands.npc.inventory.description" : "NPC의 인벤토리 보기",
"citizens.commands.npc.item.description" : "NPC의 아이템을 설정합니다.", "citizens.commands.npc.item.description" : "NPC의 아이템을 설정합니다.",
"citizens.commands.npc.itemframe.description" : "아이템프레임 수정자를 설정합니다.",
"citizens.commands.npc.itemframe.fixed-set" : "고정(항목 회전 가능 여부)이 [[{0}]]로 설정되었습니다.",
"citizens.commands.npc.itemframe.item-set" : "\n[[{0}]](으)로 설정된 항목",
"citizens.commands.npc.itemframe.rotation-set" : "회전이 [[{0}]]로 설정됨",
"citizens.commands.npc.itemframe.visible-set" : "표시가 [[{0}]]로 설정됨",
"citizens.commands.npc.item.item-set" : "NPC 아이템이 [{0}]로 설정되었습니다.", "citizens.commands.npc.item.item-set" : "NPC 아이템이 [{0}]로 설정되었습니다.",
"citizens.commands.npc.item.unknown-material" : "알 수 없는 재료가 제공되었습니다.", "citizens.commands.npc.item.unknown-material" : "알 수 없는 재료가 제공되었습니다.",
"citizens.commands.npc.jump.description" : "NPC를 점프하게 만듭니다.", "citizens.commands.npc.jump.description" : "NPC를 점프하게 만듭니다.",

View File

@ -180,14 +180,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
if (dead) if (dead)
return; return;
super.die(damagesource); super.die(damagesource);
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> world.removeEntity(EntityHumanNPC.this), 35); // give Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> world.removeEntity(EntityHumanNPC.this), 35);
// enough // give enough time for death and smoke animation
// time
// for
// death
// and
// smoke
// animation
} }
@Override @Override

View File

@ -9,7 +9,7 @@
<artifactId>citizens-v1_20_R4</artifactId> <artifactId>citizens-v1_20_R4</artifactId>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<craftbukkit.version>1.20.5-R0.1-SNAPSHOT</craftbukkit.version> <craftbukkit.version>1.20.6-R0.1-SNAPSHOT</craftbukkit.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -60,9 +60,7 @@ public class CamelController extends MobEntityController {
public static class EntityCamelNPC extends Camel implements NPCHolder { public static class EntityCamelNPC extends Camel implements NPCHolder {
private double baseMovementSpeed; private double baseMovementSpeed;
private final CitizensNPC npc; private final CitizensNPC npc;
private boolean riding; private boolean riding;
public EntityCamelNPC(EntityType<? extends Camel> types, Level level) { public EntityCamelNPC(EntityType<? extends Camel> types, Level level) {