Skip to content

Commit

Permalink
fix crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanX committed Jul 29, 2022
1 parent 98a032f commit 4cb2a3b
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 61 deletions.
10 changes: 10 additions & 0 deletions .github/stale.yml
@@ -0,0 +1,10 @@
daysUntilStale: 7
daysUntilClose: 3
onlyLabels:
- needs more info
staleLabel: Stale
markComment: >
The required information were not provided yet. Thus, this was marked as stale.
closeComment: >
None of the required information was ever provided. If this is still an issue, feel free to reopen with
the required information, or create a new issue.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -9,5 +9,5 @@ repositories {
}

dependencies {
// implementation fg.deobf("mezz.jei:jei-1.18.2:9.4.1.116")
implementation fg.deobf("mezz.jei:jei-1.19.1-forge:11.2.0.241")
}
10 changes: 5 additions & 5 deletions gradle.properties
Expand Up @@ -3,18 +3,18 @@ org.gradle.daemon=false

# mod properties
modid=ultimatools
group=de.melanx.ultimatools
base_version=3.0
group=de.melanx
base_version=3.1

# dependencies
forge_version=1.19-41.0.3
forge_version=1.19.1-42.0.1

# Upload properties
upload_versions=1.19
upload_versions=1.19.1
upload_release=release
modrinth_project=fM4ceeVu
curse_project=315068
#curse_optionals=jei
curse_optionals=jei

# misc
local_maven=/var/www/maven
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
84 changes: 42 additions & 42 deletions src/main/java/de/melanx/ultimatools/compat/JeiCompat.java
@@ -1,42 +1,42 @@
//package de.melanx.ultimatools.compat;
//
//import de.melanx.ultimatools.SkyblockUltimaTools;
//import de.melanx.ultimatools.item.Registration;
//import mezz.jei.api.IModPlugin;
//import mezz.jei.api.JeiPlugin;
//import mezz.jei.api.constants.VanillaTypes;
//import mezz.jei.api.registration.IRecipeRegistration;
//import net.minecraft.network.chat.Component;
//import net.minecraft.network.chat.TranslatableComponent;
//import net.minecraft.resources.ResourceLocation;
//import net.minecraft.world.item.Item;
//import net.minecraft.world.item.ItemStack;
//import net.minecraftforge.registries.RegistryObject;
//
//import javax.annotation.Nonnull;
//
//@JeiPlugin
//@SuppressWarnings("ConstantConditions")
//public class JeiCompat implements IModPlugin {
//
// public static final ResourceLocation PLUGIN_UID = new ResourceLocation(SkyblockUltimaTools.MODID, "plugin/main");
//
// @Override
// public @Nonnull
// ResourceLocation getPluginUid() {
// return PLUGIN_UID;
// }
//
// @Nonnull
// private static Component getDescKey(ResourceLocation name) {
// return new TranslatableComponent("jei." + name.getNamespace() + "." + name.getPath() + ".desc");
// }
//
// @Override
// public void registerRecipes(@Nonnull IRecipeRegistration registration) {
// for (RegistryObject<Item> registryObject : Registration.ITEMS.getEntries()) {
// Item item = registryObject.get();
// registration.addIngredientInfo(new ItemStack(item), VanillaTypes.ITEM, getDescKey(item.getRegistryName()));
// }
// }
//}
package de.melanx.ultimatools.compat;

import de.melanx.ultimatools.SkyblockUltimaTools;
import de.melanx.ultimatools.item.Registration;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.registration.IRecipeRegistration;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

import javax.annotation.Nonnull;

@JeiPlugin
@SuppressWarnings("ConstantConditions")
public class JeiCompat implements IModPlugin {

public static final ResourceLocation PLUGIN_UID = new ResourceLocation(SkyblockUltimaTools.MODID, "plugin/main");

@Override
public @Nonnull
ResourceLocation getPluginUid() {
return PLUGIN_UID;
}

@Nonnull
private static Component getDescKey(ResourceLocation name) {
return Component.translatable("jei." + name.getNamespace() + "." + name.getPath() + ".desc");
}

@Override
public void registerRecipes(@Nonnull IRecipeRegistration registration) {
for (RegistryObject<Item> registryObject : Registration.ITEMS.getEntries()) {
Item item = registryObject.get();
registration.addIngredientInfo(new ItemStack(item), VanillaTypes.ITEM_STACK, getDescKey(ForgeRegistries.ITEMS.getKey(item)));
}
}
}
10 changes: 5 additions & 5 deletions src/main/java/de/melanx/ultimatools/data/DataHandler.java
Expand Up @@ -3,19 +3,19 @@
import de.melanx.ultimatools.SkyblockUltimaTools;
import net.minecraft.data.DataGenerator;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.data.event.GatherDataEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;

@Mod.EventBusSubscriber(modid = SkyblockUltimaTools.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class DataHandler {

@SubscribeEvent
public static void gatherData(GatherDataEvent e) {
DataGenerator gen = e.getGenerator();
ExistingFileHelper helper = e.getExistingFileHelper();
public static void gatherData(GatherDataEvent event) {
DataGenerator gen = event.getGenerator();
ExistingFileHelper helper = event.getExistingFileHelper();

if (e.includeClient()) {
if (event.includeClient()) {
gen.addProvider(true, new ItemModels(gen, helper));
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/de/melanx/ultimatools/lib/ListHandlers.java
Expand Up @@ -47,10 +47,10 @@ public static void fillNetherOres() {
public static void fillAnimals() {
ANIMALS.clear();
ServerConfig.ANIMALS.get().forEach(string -> {
EntityType<?> entity = ForgeRegistries.ENTITIES.getValue(ResourceLocation.tryParse(string));
EntityType<?> entity = ForgeRegistries.ENTITY_TYPES.getValue(ResourceLocation.tryParse(string));
if (entity != null) {
if (entity.getCategory() == MobCategory.CREATURE || entity.getCategory() == MobCategory.AMBIENT) {
if (ForgeRegistries.ENTITIES.getKey(entity).toString().equals(string)) {
if (ForgeRegistries.ENTITY_TYPES.getKey(entity).toString().equals(string)) {
ANIMALS.add(entity);
} else {
SkyblockUltimaTools.LOGGER.error("Entity '{}' not found", string);
Expand All @@ -65,10 +65,10 @@ public static void fillAnimals() {
public static void fillWaterAnimals() {
WATER_ANIMALS.clear();
ServerConfig.WATER_ANIMALS.get().forEach(string -> {
EntityType<?> entity = ForgeRegistries.ENTITIES.getValue(ResourceLocation.tryParse(string));
EntityType<?> entity = ForgeRegistries.ENTITY_TYPES.getValue(ResourceLocation.tryParse(string));
if (entity != null) {
if (entity.getCategory() == MobCategory.WATER_CREATURE || entity.getCategory() == MobCategory.WATER_AMBIENT) {
if (ForgeRegistries.ENTITIES.getKey(entity).toString().equals(string)) {
if (ForgeRegistries.ENTITY_TYPES.getKey(entity).toString().equals(string)) {
WATER_ANIMALS.add(entity);
} else {
SkyblockUltimaTools.LOGGER.error("Entity '{}' not found", string);
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/mods.toml
@@ -1,5 +1,5 @@
modLoader="javafml"
loaderVersion="[41,)"
loaderVersion="[42,)"
issueTrackerURL="https://github.com/MelanX/ultimatools/issues/"
license="MIT License"

Expand All @@ -14,13 +14,13 @@ authors="MelanX"
[[dependencies.ultimatools]]
modId="forge"
mandatory=true
versionRange="[41.0.3,)"
versionRange="[42,)"
ordering="NONE"
side="BOTH"

[[dependencies.ultimatools]]
modId="minecraft"
mandatory=true
versionRange="[1.19, 1.20)"
versionRange="[1.19.1, 1.20)"
ordering="NONE"
side="BOTH"

0 comments on commit 4cb2a3b

Please sign in to comment.