feat: 1.20/1.20.1 update

This commit is contained in:
ineanto 2023-06-28 13:22:48 +02:00
parent c66979133d
commit 50dd4c3adf
5 changed files with 64 additions and 37 deletions

View file

@ -2,13 +2,25 @@
## The feature packed, next generation disguise plugin for Minecraft.
### Download:
---
## Download:
Coming soon! ⏳
---
## Q/A
Q: Players are getting kicked when they send a message on versions above 1.19.2!
A: Install [NoEncryption](https://www.spigotmc.org/resources/noencryption.102902/).
---
#### Version compatibility table
| Version | Supported |
|-----------|----------------------------------------------------------------------------|
| < 1.12.2 | Use [NickReloaded](https://www.spigotmc.org/resources/nickreloaded.46335/) |
| \> 1.12.2 | Supported |
| Version | Plugin |
|----------|----------------------------------------------------------------------------|
| < 1.12.2 | Use [NickReloaded](https://www.spigotmc.org/resources/nickreloaded.46335/) |
| > 1.12.2 | Use Nicko |

View file

@ -6,7 +6,7 @@ services:
db:
image: mariadb
restart: always
restart: no
environment:
MARIADB_ROOT_PASSWORD: 12345
ports:
@ -14,12 +14,12 @@ services:
adminer:
image: adminer
restart: always
restart: no
ports:
- "8080:8080"
redis:
image: redis
restart: always
restart: no
ports:
- "6379:6379"
- "6379:6379"

13
pom.xml
View file

@ -17,12 +17,12 @@
<repositories>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
<id>xenondevs</id>
<url>https://repo.xenondevs.xyz/releases</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>codemc-snapshots</id>
@ -63,12 +63,13 @@
<dependency>
<groupId>xyz.xenondevs.invui</groupId>
<artifactId>invui</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.11</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.6.3-SNAPSHOT</version>
<version>1.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.seeseemelk</groupId>

View file

@ -41,14 +41,17 @@ public class AnvilManager {
.plugin(NickoBukkit.getInstance())
.itemLeft(getLeftItem(false))
.interactableSlots(AnvilGUI.Slot.OUTPUT)
.onComplete((completion) -> {
if (MojangUtils.isUsernameInvalid(completion.getText())) {
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
} else {
appearanceManager.setName(completion.getText());
openSkinAnvil();
return Collections.singletonList(AnvilGUI.ResponseAction.close());
.onClick((slot, snapshot) -> {
if (slot == AnvilGUI.Slot.OUTPUT) {
if (MojangUtils.isUsernameInvalid(snapshot.getText())) {
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
} else {
appearanceManager.setName(snapshot.getText());
openSkinAnvil();
return Collections.singletonList(AnvilGUI.ResponseAction.close());
}
}
return Collections.emptyList();
})
.text("New name...");
}
@ -58,14 +61,17 @@ public class AnvilManager {
.plugin(NickoBukkit.getInstance())
.itemLeft(getLeftItem(false))
.interactableSlots(AnvilGUI.Slot.OUTPUT)
.onComplete((completion) -> {
if (MojangUtils.isUsernameInvalid(completion.getText())) {
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
} else {
appearanceManager.setName(completion.getText());
final ActionResult<Void> actionResult = appearanceManager.updatePlayer(false);
return sendResultAndClose(actionResult);
.onClick((slot, snapshot) -> {
if (slot == AnvilGUI.Slot.OUTPUT) {
if (MojangUtils.isUsernameInvalid(snapshot.getText())) {
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
} else {
appearanceManager.setName(snapshot.getText());
final ActionResult<Void> actionResult = appearanceManager.updatePlayer(false);
return sendResultAndClose(actionResult);
}
}
return Collections.emptyList();
})
.text("New name...");
}
@ -75,14 +81,17 @@ public class AnvilManager {
.plugin(NickoBukkit.getInstance())
.itemLeft(getLeftItem(true))
.interactableSlots(AnvilGUI.Slot.OUTPUT)
.onComplete((completion) -> {
if (MojangUtils.isUsernameInvalid(completion.getText())) {
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
} else {
appearanceManager.setSkin(completion.getText());
final ActionResult<Void> actionResult = appearanceManager.updatePlayer(true);
return sendResultAndClose(actionResult);
.onClick((slot, snapshot) -> {
if (slot == AnvilGUI.Slot.OUTPUT) {
if (MojangUtils.isUsernameInvalid(snapshot.getText())) {
return Collections.singletonList(AnvilGUI.ResponseAction.replaceInputText("Invalid username!"));
} else {
appearanceManager.setSkin(snapshot.getText());
final ActionResult<Void> actionResult = appearanceManager.updatePlayer(true);
return sendResultAndClose(actionResult);
}
}
return Collections.emptyList();
})
.text("New skin...");
}
@ -99,7 +108,7 @@ public class AnvilManager {
private ItemStack getLeftItem(boolean skin) {
final ItemStack item = new ItemStack(Material.PAPER);
final ItemMeta meta = item.getItemMeta();
meta.setDisplayName("§0New " + (skin ? "skin" : "name") + "...");
if (meta != null) meta.setDisplayName("§0New " + (skin ? "skin" : "name") + "...");
item.setItemMeta(meta);
return item;
}

View file

@ -144,6 +144,7 @@ public class AppearanceManager {
private void respawnPlayer() {
final World world = player.getWorld();
final boolean wasFlying = player.isFlying();
final WrapperPlayServerRespawn respawn = new WrapperPlayServerRespawn();
respawn.setDimension(world);
respawn.setSeed(world.getSeed());
@ -152,8 +153,12 @@ public class AppearanceManager {
respawn.setDifficulty(world.getDifficulty());
respawn.setCopyMetadata(true);
respawn.sendPacket(player);
player.setFlying(wasFlying);
player.teleport(player.getLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
player.updateInventory();
}
@SuppressWarnings("deprecation")
private void updateTabList(WrappedGameProfile gameProfile, String displayName) {
final WrapperPlayerServerPlayerInfo add = new WrapperPlayerServerPlayerInfo();
if (MinecraftVersion.FEATURE_PREVIEW_UPDATE.atOrAbove()) {