Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_RELEASE_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Disabled fake player creator for < 1.16.5 due to a lack of Library Loader support on legacy versions.
6 changes: 1 addition & 5 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${dependency.bytebuddy.version}</version>
<scope>compile</scope>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -408,10 +408,6 @@
<pattern>com.github.Anon8281.universalScheduler</pattern>
<shadedPattern>nl.pim16aap2.bigDoors.lib.universalScheduler</shadedPattern>
</relocation>
<relocation>
<pattern>net.bytebuddy</pattern>
<shadedPattern>nl.pim16aap2.bigDoors.lib.bytebuddy</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import javax.annotation.Nullable;
import java.util.function.BiFunction;
import java.util.logging.Level;

/**
* Class used to create a fake-online player who is actually offline.
Expand Down Expand Up @@ -36,9 +37,30 @@ public FakePlayerCreator(final BigDoors plugin)
return new FakePlayerClassGenerator(plugin).getInstantiator();

}
catch (Exception e)
catch (Exception exception)
{
new RuntimeException("Failed to create fake player constructor!", e).printStackTrace();
BigDoors.get().getMyLogger().log(
"Failed to create fake player constructor! Checks for offline players will not work!",
exception
);
return null;
}
catch (NoClassDefFoundError e)
{
boolean isByteBuddy = e.getMessage().startsWith("net/bytebuddy");
if (isByteBuddy)
{
BigDoors.get().getMyLogger().logMessage(
Level.SEVERE,
"Could not find ByteBuddy classes. Either the Library Loader failed or you are on a legacy version that does not have it (<1.16.5). Checks for offline players will not work!"
);
return null;
}

BigDoors.get().getMyLogger().logMessage(
Level.SEVERE,
"Could not find class '" + e.getMessage() + "'. Checks for offline players will not work!"
);
return null;
}
}
Expand Down