Telesphoreo 2022-01-03 18:13:43 -06:00
commit cc69218b91
291 changed files with 1995 additions and 425 deletions

204
plugin/pom.xml Normal file
View file

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>LibsDisguises</artifactId>
<groupId>LibsDisguises</groupId>
<version>10.0.27-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>plugin</artifactId>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<defaultGoal>exec:java clean install</defaultGoal>
<finalName>LibsDisguises</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>plugin.yml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>README.md</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>../target</outputDirectory>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>my-execution</id>
<phase>compile</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<includePluginDependencies>true</includePluginDependencies>
<mainClass>me.libraryaddict.disguise.utilities.watchers.CompileMethods</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<minimizeJar>true</minimizeJar>
<filters>
<filter>
<artifact>LibsDisguises:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
<artifactSet>
<includes>
<include>net.kyori:*</include>
<include>LibsDisguises:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>ld-shaded.net.kyori</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.comphenix.protocol</groupId>
<artifactId>ProtocolLib</artifactId>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
</dependency>
<!-- testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>${paper-api.version}</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId>
<version>${bungeecord-chat.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>${adventure-minimessage.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>${adventure-serializer.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>${adventure-api.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<!--NMS Packages-->
<dependency>
<groupId>LibsDisguises</groupId>
<artifactId>shared</artifactId>
<version>10.0.27-SNAPSHOT</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>LibsDisguises</groupId>
<artifactId>v1_18_R1</artifactId>
<version>10.0.27-SNAPSHOT</version>
<classifier>remapped-spigot</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>LibsDisguises</groupId>
<artifactId>v1_17_R1</artifactId>
<version>10.0.27-SNAPSHOT</version>
<classifier>remapped-spigot</classifier>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View file

@ -3,6 +3,7 @@ package me.libraryaddict.disguise;
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import com.comphenix.protocol.wrappers.WrappedWatchableObject;
import java.util.ArrayList;
import me.libraryaddict.disguise.disguisetypes.*;
import me.libraryaddict.disguise.disguisetypes.TargetedDisguise.TargetType;
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
@ -282,7 +283,7 @@ public class DisguiseAPI {
// You called the disguiseToAll method foolish mortal! Prepare to have your custom settings wiped!!!
((TargetedDisguise) disguise).setDisguiseTarget(TargetType.SHOW_TO_EVERYONE_BUT_THESE_PLAYERS);
for (String observer : ((TargetedDisguise) disguise).getObservers()) {
for (String observer : new ArrayList<>(((TargetedDisguise) disguise).getObservers())) {
((TargetedDisguise) disguise).removePlayer(observer);
}

View file

@ -20,6 +20,7 @@ import me.libraryaddict.disguise.utilities.listeners.PaperDisguiseListener;
import me.libraryaddict.disguise.utilities.listeners.PlayerSkinHandler;
import me.libraryaddict.disguise.utilities.metrics.MetricsInitalizer;
import me.libraryaddict.disguise.utilities.packets.PacketsManager;
import me.libraryaddict.disguise.utilities.params.ParamInfoManager;
import me.libraryaddict.disguise.utilities.parser.DisguiseParser;
import me.libraryaddict.disguise.utilities.reflection.NmsVersion;
import me.libraryaddict.disguise.utilities.reflection.ReflectionManager;
@ -79,8 +80,8 @@ public class LibsDisguises extends JavaPlugin {
getLogger().severe("Please restart the server to complete the ProtocolLib update!");
}
} catch (Exception e) {
getLogger()
.severe("Looks like ProtocolLib's site may be down! MythicCraft/MythicMobs has a discord server https://discord.gg/EErRhJ4qgx you" +
getLogger().severe(
"Looks like ProtocolLib's site may be down! MythicCraft/MythicMobs has a discord server https://discord.gg/EErRhJ4qgx you" +
" can " + "join. Check the pins in #libs-support for a ProtocolLib.jar you can download!");
e.printStackTrace();
}
@ -160,8 +161,8 @@ public class LibsDisguises extends JavaPlugin {
LibsPremium.check(getDescription().getVersion(), getFile());
if (!LibsPremium.isPremium()) {
getLogger()
.info("You are running the free version, commands limited to non-players and operators. (Console," + " Command " + "Blocks, Admins)");
getLogger().info(
"You are running the free version, commands limited to non-players and operators. (Console," + " Command " + "Blocks, Admins)");
}
if (ReflectionManager.getVersion() == null) {
@ -171,18 +172,19 @@ public class LibsDisguises extends JavaPlugin {
return;
}
String requiredProtocolLib = StringUtils.join(DisguiseUtilities.getProtocolLibRequiredVersion(), " or build #");
String version = ProtocolLibrary.getPlugin().getDescription().getVersion();
if (DisguiseUtilities.isProtocolLibOutdated()) {
String requiredProtocolLib = StringUtils.join(DisguiseUtilities.getProtocolLibRequiredVersion(), " or build #");
String version = Bukkit.getPluginManager().getPlugin("ProtocolLib").getDescription().getVersion();
BukkitRunnable runnable = new BukkitRunnable() {
private int timesRun;
@Override
public void run() {
getLogger().severe("!! May I have your attention please !!");
getLogger().severe("Update your ProtocolLib! You are running " + version + " but the minimum version you should be on is " +
requiredProtocolLib + "!");
getLogger().severe(
"Update your ProtocolLib! You are running " + version + " but the minimum version you should be on is " + requiredProtocolLib +
"!");
getLogger().severe("https://ci.dmulloy2.net/job/ProtocolLib/lastSuccessfulBuild/artifact/target" + "/ProtocolLib" + ".jar");
getLogger().severe("Or! Use /ld protocollib - To update to the latest development build");
@ -214,9 +216,11 @@ public class LibsDisguises extends JavaPlugin {
PacketsManager.init();
DisguiseUtilities.init();
new SoundManager().load();
ReflectionManager.registerValues();
new SoundManager().load();
ParamInfoManager.getParamInfoSoundGroup().recalculate();
DisguiseConfig.loadConfig();

View file

@ -66,7 +66,7 @@ public abstract class Disguise {
@Getter
private BarStyle bossBarStyle = DisguiseConfig.getBossBarStyle();
@Getter(value = AccessLevel.PRIVATE)
private final NamespacedKey bossBar = new NamespacedKey(LibsDisguises.getInstance(), UUID.randomUUID().toString());
private final NamespacedKey bossBar = new NamespacedKey("libsdisguises", UUID.randomUUID().toString());
private FlagWatcher watcher;
/**
* If set, how long before disguise expires
@ -79,11 +79,11 @@ public abstract class Disguise {
@Getter
private String disguiseName;
/**
* Is the name allowed to be changed by Lib's Disguises if they do some option?
* Is the name specifically set to something by a third party?
*/
@Getter
@Setter
private boolean customDisguiseName = true;
private boolean customDisguiseName = false;
@Getter
@Setter
private boolean tallDisguisesVisible = DisguiseConfig.isTallSelfDisguises();
@ -365,7 +365,7 @@ public abstract class Disguise {
}
public boolean isUpsideDown() {
return getWatcher().isUpsideDown();
return getWatcher() != null && getWatcher().isUpsideDown();
}
public Disguise setUpsideDown(boolean upsideDown) {

View file

@ -273,11 +273,12 @@ public class FlagWatcher {
// Its sending the air metadata. This is the least commonly sent metadata which all entitys still share.
// I send my custom values if I see this!
if (id == MetaIndex.ENTITY_AIR_TICKS.getIndex()) {
if (index == MetaIndex.ENTITY_AIR_TICKS) {
sendAllCustom = true;
}
Object value = null;
boolean usingBackup = false;
if (entityValues.containsKey(id)) {
if (entityValues.get(id) == null) {
@ -286,7 +287,7 @@ public class FlagWatcher {
value = entityValues.get(id);
if (id == MetaIndex.LIVING_HEALTH.getIndex() && (float) watch.getRawValue() <= 0) {
if (index == MetaIndex.LIVING_HEALTH && (float) watch.getRawValue() <= 0) {
value = watch.getRawValue();
}
} else if (backupEntityValues.containsKey(id)) {
@ -295,10 +296,11 @@ public class FlagWatcher {
}
value = backupEntityValues.get(id);
usingBackup = true;
}
if (value != null) {
if (isEntityAnimationsAdded() && (index == MetaIndex.ENTITY_META || index == MetaIndex.LIVING_META)) {
if (isEntityAnimationsAdded() && (index == MetaIndex.ENTITY_META || (index == MetaIndex.LIVING_META && !usingBackup))) {
value = addEntityAnimations(index, (byte) value, (byte) watch.getRawValue());
if (index == MetaIndex.ENTITY_META) {

Some files were not shown because too many files have changed in this diff Show more