#1414: Convert InventoryView to interface
By: Miles Holder <mwholder2005@gmail.com>
This commit is contained in:
@@ -67,6 +67,10 @@ public class Commodore {
|
||||
"org/spigotmc/event/entity/EntityDismountEvent", "org/bukkit/event/entity/EntityDismountEvent"
|
||||
);
|
||||
|
||||
private static final Set<String> CLASS_TO_INTERFACE = Set.of(
|
||||
"org/bukkit/inventory/InventoryView"
|
||||
);
|
||||
|
||||
private static Map<String, RerouteMethodData> createReroutes(Class<?> clazz) {
|
||||
Map<String, RerouteMethodData> reroutes = RerouteBuilder.buildFromClass(clazz);
|
||||
REROUTES.add(reroutes);
|
||||
@@ -288,6 +292,17 @@ public class Commodore {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CLASS_TO_INTERFACE.contains(owner)) {
|
||||
if (opcode == Opcodes.INVOKEVIRTUAL) {
|
||||
opcode = Opcodes.INVOKEINTERFACE;
|
||||
}
|
||||
|
||||
if (opcode == Opcodes.H_INVOKEVIRTUAL) {
|
||||
opcode = Opcodes.H_INVOKEINTERFACE;
|
||||
}
|
||||
itf = true;
|
||||
}
|
||||
|
||||
// SPIGOT-4496
|
||||
if (owner.equals("org/bukkit/map/MapView") && name.equals("getId") && desc.equals("()S")) {
|
||||
// Should be same size on stack so just call other method
|
||||
|
||||
Reference in New Issue
Block a user