Skip to content

Commit

Permalink
feat: support of 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
demkom58 committed Dec 12, 2022
1 parent 13e02e3 commit b576c12
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.demkom58.divinedrop.version.V18R1.V18R1;
import com.demkom58.divinedrop.version.V18R2.V18R2;
import com.demkom58.divinedrop.version.V19R1.V19R1;
import com.demkom58.divinedrop.version.V19R2.V19R2;
import com.demkom58.divinedrop.version.V8R3.V8R3;
import com.demkom58.divinedrop.version.V8R3.V8ResourceClient;
import com.demkom58.divinedrop.version.V9R1.V9R1;
Expand Down Expand Up @@ -45,7 +46,8 @@ public enum SupportedVersion {
V17R1(V17R1.class, new V13ResourceClient("1.17"), "v1_17_R1", V17R1::new),
V18R1(V18R1.class, new V13ResourceClient("1.18"), "v1_18_R1", V18R1::new),
V18R2(V18R2.class, new V13ResourceClient("1.18.2"), "v1_18_R2", V18R2::new),
V19R1(V19R1.class, new V13ResourceClient("1.19"), "v1_19_R1", V19R1::new)
V19R1(V19R1.class, new V13ResourceClient("1.19"), "v1_19_R1", V19R1::new),
V19R2(V19R2.class, new V13ResourceClient("1.19.3"), "v1_19_R2", V19R2::new)
;

private static final Map<String, SupportedVersion> NMS_VERSION_MAP = new HashMap<String, SupportedVersion>(){{
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/com/demkom58/divinedrop/version/V19R2/V19R2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.demkom58.divinedrop.version.V19R2;

import com.demkom58.divinedrop.drop.ItemHandler;
import com.demkom58.divinedrop.version.V13R1.V13NmsHandleNameVersion;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;

import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;

public class V19R2 extends V13NmsHandleNameVersion {
public V19R2(@NotNull final ResourceClient client, @NotNull final ItemHandler manager) throws Exception {
super(client, manager,
MethodHandles.lookup()
.findStatic(
Class.forName("org.bukkit.craftbukkit.v1_19_R2.inventory.CraftItemStack"),
"asNMSCopy",
MethodType.methodType(Class.forName("net.minecraft.world.item.ItemStack"), ItemStack.class)
),
MethodHandles.lookup()
.findVirtual(
Class.forName("net.minecraft.world.item.ItemStack"),
"c",
MethodType.methodType(Class.forName("net.minecraft.world.item.Item"))
),
MethodHandles.lookup()
.findVirtual(
Class.forName("net.minecraft.world.item.Item"),
"a",
MethodType.methodType(String.class)
)
);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/cache.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: DivineDrop
main: com.demkom58.divinedrop.DivineDrop
description: Awesome removal of items from the ground
website: https://www.spigotmc.org/members/98068/
version: 2.8
version: 2.9
authors:
- demkom58
- GdemkomG
Expand Down

0 comments on commit b576c12

Please sign in to comment.