13
0
geforkt von Mirrors/Paper

Update Commodore modifications (#8542)

* Handle ldc insn for getOriginalOrRewrite in Commodore

* Remove fastutil rewrite

It's no longer relocated upstream
Dieser Commit ist enthalten in:
Jason Penilla 2022-11-04 22:16:57 -07:00
Ursprung 2f0e0c5f2b
Commit d8be0e795b
2 geänderte Dateien mit 16 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -154,8 +154,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// Paper start - Plugin rewrites
+ private static final String CB_PACKAGE = org.bukkit.Bukkit.getServer().getClass().getPackageName().replace('.', '/');
private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap();
private static final java.util.jar.Manifest manifest = io.papermc.paper.util.JarManifests.manifest(Commodore.class);
private static Map<String, String> initReplacementsMap()
{
@@ -0,0 +0,0 @@ public class Commodore
{
desc = getOriginalOrRewrite(desc);

Datei anzeigen

@ -43,13 +43,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Plugin rewrites
+ private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap();
+ private static final java.util.jar.Manifest manifest = io.papermc.paper.util.JarManifests.manifest(Commodore.class);
+ private static Map<String, String> initReplacementsMap()
+ {
+ Map<String, String> getAndRemove = new HashMap<>();
+ // Be wary of maven shade's relocations
+ getAndRemove.put( "org/bukkit/".concat( "craftbukkit/libs/it/unimi/dsi/fastutil/" ), "org/bukkit/".concat( "craftbukkit/libs/" ) ); // Remap fastutil to our location
+
+ final java.util.jar.Manifest manifest = io.papermc.paper.util.JarManifests.manifest(Commodore.class);
+ if ( Boolean.getBoolean( "debug.rewriteForIde" ) && manifest != null)
+ {
+ // unversion incoming calls for pre-relocate debug work
@ -182,3 +181,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if ( modern )
{
if ( owner.equals( "org/bukkit/Material" ) )
@@ -0,0 +0,0 @@ public class Commodore
@Override
public void visitLdcInsn(Object value)
{
+ // Paper start
+ if (value instanceof Type type) {
+ if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) {
+ value = Type.getType(getOriginalOrRewrite(type.getDescriptor()));
+ }
+ }
+ // Paper end
if ( value instanceof String && ( (String) value ).equals( "com.mysql.jdbc.Driver" ) )
{
super.visitLdcInsn( "com.mysql.cj.jdbc.Driver" );