From 42b9ba01f5b906279a2fdc4adf380538789ae1b3 Mon Sep 17 00:00:00 2001 From: Jonius7 Date: Tue, 23 Oct 2018 18:29:12 +1000 Subject: [PATCH] Updated outdated Forestry API causing crashes --- build.gradle | 2 +- gradle.properties | 6 +- .../api/storage/IBackpackDefinition.java | 71 ++++++------------- .../morebackpacks/core/BasicBackpack.java | 3 +- 4 files changed, 26 insertions(+), 56 deletions(-) diff --git a/build.gradle b/build.gradle index 9b23c51..120049a 100644 --- a/build.gradle +++ b/build.gradle @@ -40,7 +40,7 @@ group= mod_group // http://maven.apache.org/guides/mini/guide-naming-conventions archivesBaseName = mod_name minecraft{ - version = "${minecraft_version}-${forge_version}" + version = "${minecraft_version}-${forge_version}-${minecraft_version}" replace "@ModVersion@", project.version } diff --git a/gradle.properties b/gradle.properties index 2aff0ab..db49280 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,13 +5,13 @@ mod_name=More Backpacks minecraft_version=1.7.10 #The Forge version to use. -forge_version=10.13.0.1187 +forge_version=10.13.4.1558 #The version of RedGearCore to download and use. -core_version=2.1.3 +core_version=2.2.2 #The version to be used in the code and for naming the .jar -mod_version=2.2.2 +mod_version=2.2.3 #group means the package that all the classes in this mod are contained in. The root of this source. Example: redgear.geocraft mod_group=redgear.morebackpacks diff --git a/src/main/java/forestry/api/storage/IBackpackDefinition.java b/src/main/java/forestry/api/storage/IBackpackDefinition.java index 87872bc..c99a8cb 100644 --- a/src/main/java/forestry/api/storage/IBackpackDefinition.java +++ b/src/main/java/forestry/api/storage/IBackpackDefinition.java @@ -1,56 +1,27 @@ -/******************************************************************************* - * Copyright 2011-2014 SirSengir - * - * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. - ******************************************************************************/ package forestry.api.storage; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - import java.util.List; +import net.minecraft.item.ItemStack; -public interface IBackpackDefinition { - - /** - * @return A unique string identifier - */ - String getKey(); - - /** - * @param backpack - * @return Human-readable name of the backpack. - */ - String getName(ItemStack backpack); - - @Deprecated - String getName(); - - /** - * @return Primary colour for the backpack icon. - */ - int getPrimaryColour(); - - /** - * @return Secondary colour for backpack icon. - */ - int getSecondaryColour(); - - /** - * Adds an item as valid for this backpack. - * - * @param validItem - */ - void addValidItem(ItemStack validItem); - void addValidItems(List validItems); +public abstract interface IBackpackDefinition +{ + public abstract String getKey(); + + public abstract String getName(ItemStack nameItemStack); + + public abstract int getPrimaryColour(); + + public abstract int getSecondaryColour(); + + public abstract void addValidItem(ItemStack nameItemStack); + + public abstract void addValidItems(List nameList); + + public abstract boolean isValidItem(ItemStack nameItemStack); +} - /** - * Returns true if the itemstack is a valid item for this backpack type. - * - * @param player - * @param itemstack - * @return true if the given itemstack is valid for this backpack, false otherwise. - */ - boolean isValidItem(EntityPlayer player, ItemStack itemstack); -} +/* Location: D:\Program Files\0E Games\Minecraft\Instances\Volentus\mods\forestry_1.7.10-4.2.16.64.jar!\forestry\api\storage\IBackpackDefinition.class + * Java compiler version: 7 (51.0) + * JD-Core Version: 0.7.1 + */ \ No newline at end of file diff --git a/src/main/java/redgear/morebackpacks/core/BasicBackpack.java b/src/main/java/redgear/morebackpacks/core/BasicBackpack.java index 1a96df4..c2bdc61 100644 --- a/src/main/java/redgear/morebackpacks/core/BasicBackpack.java +++ b/src/main/java/redgear/morebackpacks/core/BasicBackpack.java @@ -80,7 +80,7 @@ public void addValidItems(List validItems) { } @Override - public boolean isValidItem(EntityPlayer player, ItemStack check) { + public boolean isValidItem(ItemStack check) { return itemsList.contains(new SimpleItem(check)); } @@ -103,7 +103,6 @@ public final String getKey() { return unlocalname.toLowerCase(); } - @Override public String getName() { return StatCollector.translateToLocal("item.RedGear.MoreBackpacks.Backpack." + unlocalname + ".name"); }