Skip to content

Commit

Permalink
Merge pull request #44 from Clexus/main
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
Lori3f6 authored Dec 13, 2024
2 parents 64421fc + 3101547 commit 0da829b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Common library used for all NyaaCat plugin.
Provides infrastructures to simplify plugin development.

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

- Annotation based command dispatcher
Expand Down Expand Up @@ -40,5 +40,6 @@ dependencies {
- 6.4.x: Minecraft 1.14.3
- 7.0.x: Minecraft 1.14.4
- 7.1.x: Minecraft 1.15.1 since build 350
- 9.x: Minecraft 1.21+

Older versions can be found in [Github Release Page](https://github.com/NyaaCat/NyaaCore/releases)
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import java.net.URI
plugins {
`java-library`
`maven-publish`
id("io.papermc.paperweight.userdev") version "1.7.1"
id("io.papermc.paperweight.userdev") version "1.7.2"
id("xyz.jpenilla.run-paper") version "2.3.0" // Adds runServer and runMojangMappedServer tasks for testing
}

// = = =

val pluginName = "NyaaCore"
val paperApiName = "1.21.1-R0.1-SNAPSHOT"
val paperApiName = "1.21.3-R0.1-SNAPSHOT"

// = = =

group = "cat.nyaa"
version ="9.4"
version ="9.5"

java {
// Configure the java toolchain. This allows gradle to auto-provision JDK 21 on systems that only have JDK 8 installed for example.
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/cat/nyaa/nyaacore/NyaaCoreLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ public class NyaaCoreLoader extends JavaPlugin {

private boolean isTest = false;

public NyaaCoreLoader() {
super();
}

protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
super(loader, description, dataFolder, file);
}

protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file, Boolean isTest) {
super(loader, description, dataFolder, file);
this.isTest = isTest;
}
// public NyaaCoreLoader() {
// super();
// }
//
// protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
// super(loader, description, dataFolder, file);
// }
//
// protected NyaaCoreLoader(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file, Boolean isTest) {
// super(loader, description, dataFolder, file);
// this.isTest = isTest;
// }

public static NyaaCoreLoader getInstance() {
return instance;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cat/nyaa/nyaacore/utils/LocaleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static String getUnlocalizedName(Material material) {
public static String getUnlocalizedName(ItemStack itemStack) {
if (itemStack == null) throw new IllegalArgumentException();
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack);
return nmsItemStack.getItem().getDescriptionId(nmsItemStack);
return nmsItemStack.getItem().getDescriptionId();
}

public static BaseComponent getNameComponent(ItemStack item) {
Expand All @@ -34,7 +34,7 @@ public static BaseComponent getNameComponent(ItemStack item) {
return new TranslatableComponent(key, ((SkullMeta) item.getItemMeta()).getOwningPlayer().getName());
}
net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(item);
return new TranslatableComponent(nmsItemStack.getItem().getDescriptionId(nmsItemStack));
return new TranslatableComponent(nmsItemStack.getItem().getDescriptionId());
}

public static String getUnlocalizedName(Enchantment ench) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cat/nyaa/nyaacore/utils/NmsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void setEntityTag(Entity e, String tag) {
}

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

/**
Expand Down

0 comments on commit 0da829b

Please sign in to comment.