Skip to content

Commit 0da829b

Browse files
authored
Merge pull request #44 from Clexus/main
fix bugs
2 parents 64421fc + 3101547 commit 0da829b

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Common library used for all NyaaCat plugin.
33
Provides infrastructures to simplify plugin development.
44

5-
[![Build Status](https://ci.nyaacat.com/job/NyaaCore/job/1.18/badge/icon)](https://ci.nyaacat.com/job/NyaaCore/job/1.18/)
5+
[![Build Status](https://ci.nyaacat.com/job/NyaaCore/job/main/badge/icon)](https://ci.nyaacat.com/job/NyaaCore/job/main/)
66
## Component List
77

88
- Annotation based command dispatcher
@@ -40,5 +40,6 @@ dependencies {
4040
- 6.4.x: Minecraft 1.14.3
4141
- 7.0.x: Minecraft 1.14.4
4242
- 7.1.x: Minecraft 1.15.1 since build 350
43+
- 9.x: Minecraft 1.21+
4344

4445
Older versions can be found in [Github Release Page](https://github.com/NyaaCat/NyaaCore/releases)

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import java.net.URI
33
plugins {
44
`java-library`
55
`maven-publish`
6-
id("io.papermc.paperweight.userdev") version "1.7.1"
6+
id("io.papermc.paperweight.userdev") version "1.7.2"
77
id("xyz.jpenilla.run-paper") version "2.3.0" // Adds runServer and runMojangMappedServer tasks for testing
88
}
99

1010
// = = =
1111

1212
val pluginName = "NyaaCore"
13-
val paperApiName = "1.21.1-R0.1-SNAPSHOT"
13+
val paperApiName = "1.21.3-R0.1-SNAPSHOT"
1414

1515
// = = =
1616

1717
group = "cat.nyaa"
18-
version ="9.4"
18+
version ="9.5"
1919

2020
java {
2121
// Configure the java toolchain. This allows gradle to auto-provision JDK 21 on systems that only have JDK 8 installed for example.

src/main/java/cat/nyaa/nyaacore/NyaaCoreLoader.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ public class NyaaCoreLoader extends JavaPlugin {
2424

2525
private boolean isTest = false;
2626

27-
public NyaaCoreLoader() {
28-
super();
29-
}
30-
31-
protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
32-
super(loader, description, dataFolder, file);
33-
}
34-
35-
protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file, Boolean isTest) {
36-
super(loader, description, dataFolder, file);
37-
this.isTest = isTest;
38-
}
27+
// public NyaaCoreLoader() {
28+
// super();
29+
// }
30+
//
31+
// protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
32+
// super(loader, description, dataFolder, file);
33+
// }
34+
//
35+
// protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file, Boolean isTest) {
36+
// super(loader, description, dataFolder, file);
37+
// this.isTest = isTest;
38+
// }
3939

4040
public static NyaaCoreLoader getInstance() {
4141
return instance;

src/main/java/cat/nyaa/nyaacore/utils/LocaleUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static String getUnlocalizedName(Material material) {
2222
public static String getUnlocalizedName(ItemStack itemStack) {
2323
if (itemStack == null) throw new IllegalArgumentException();
2424
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
25-
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
25+
return nmsItemStack.getItem().getDescriptionId();
2626
}
2727

2828
public static BaseComponent getNameComponent(ItemStack item) {
@@ -34,7 +34,7 @@ public static BaseComponent getNameComponent(ItemStack item) {
3434
return new TranslatableComponent(key, ((SkullMeta) item.getItemMeta()).getOwningPlayer().getName());
3535
}
3636
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
37-
return new TranslatableComponent(nmsItemStack.getItem().getDescriptionId(nmsItemStack));
37+
return new TranslatableComponent(nmsItemStack.getItem().getDescriptionId());
3838
}
3939

4040
public static String getUnlocalizedName(Enchantment ench) {

src/main/java/cat/nyaa/nyaacore/utils/NmsUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static void setEntityTag(Entity e, String tag) {
5858
}
5959

6060
public static boolean createExplosion(World world, Entity entity, double x, double y, double z, float power, boolean setFire, boolean breakBlocks) {
61-
return !((CraftWorld) world).getHandle().explode(((CraftEntity) entity).getHandle(), x, y, z, power, setFire, breakBlocks ? Level.ExplosionInteraction.MOB : Level.ExplosionInteraction.NONE).wasCanceled;
61+
return world.createExplosion(x, y, z, power, setFire, breakBlocks, entity);
6262
}
6363

6464
/**

0 commit comments

Comments
 (0)