mirror of
https://github.com/GTNewHorizons/WanionLib.git
synced 2026-11-21 21:02:17 +00:00
Updated to 1.4
This commit is contained in:
1 parent
0849bb27c2
commit
aebf6bd7f2
8 files changed
+87
-7
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-1.2"
|
||||
version = "1.7.10-1.4"
|
||||
group= "wanion.lib" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "WanionLib"
|
||||
|
||||
|
||||
Binary file not shown.
@@ -12,7 +12,7 @@ public final class Reference
|
||||
{
|
||||
public static final String MOD_ID = "wanionlib";
|
||||
public static final String MOD_NAME = "WanionLib";
|
||||
public static final String VERSION = "1.7.10-1.2";
|
||||
public static final String MOD_VERSION = "1.7.10-1.4";
|
||||
public static final String ACCEPTED_MINECRAFT = "[1.7.10]";
|
||||
|
||||
private Reference() {}
|
||||
|
||||
@@ -17,9 +17,11 @@ import org.apache.logging.log4j.Logger;
|
||||
import wanion.lib.client.ClientTickHandler;
|
||||
import wanion.lib.common.Dependencies;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static wanion.lib.Reference.*;
|
||||
|
||||
@Mod(modid = MOD_ID, name = MOD_NAME, version = VERSION, acceptedMinecraftVersions = ACCEPTED_MINECRAFT)
|
||||
@Mod(modid = MOD_ID, name = MOD_NAME, version = MOD_VERSION, acceptedMinecraftVersions = ACCEPTED_MINECRAFT)
|
||||
public final class WanionLib
|
||||
{
|
||||
@Mod.Instance(MOD_ID)
|
||||
@@ -56,5 +58,10 @@ public final class WanionLib
|
||||
dependencies = null;
|
||||
}
|
||||
|
||||
public boolean matchModVersions(final Map<String, String> remoteVersions, final Side side)
|
||||
{
|
||||
return side == Side.CLIENT ? remoteVersions.containsKey(MOD_ID) : !remoteVersions.containsKey(MOD_ID) || remoteVersions.get(MOD_ID).equals(MOD_VERSION);
|
||||
}
|
||||
|
||||
public interface IDependency {}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package wanion.lib.common;
|
||||
|
||||
/*
|
||||
* Created by WanionCane(https://github.com/WanionCane).
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class MineTweakerHelper
|
||||
{
|
||||
private MineTweakerHelper() {}
|
||||
|
||||
public static ItemStack toStack(final IItemStack item)
|
||||
{
|
||||
if (item == null)
|
||||
return null;
|
||||
final Object internal = item.getInternal();
|
||||
if (internal == null || !(internal instanceof ItemStack))
|
||||
MineTweakerAPI.getLogger().logError("Not a valid item stack: " + item);
|
||||
return internal instanceof ItemStack ? (ItemStack) internal : null;
|
||||
}
|
||||
|
||||
public static Object[] toObjects(final IIngredient[] list)
|
||||
{
|
||||
if (list == null)
|
||||
return null;
|
||||
Object[] ingredients = new Object[list.length];
|
||||
for (int x = 0; x < list.length; x++) {
|
||||
ingredients[x] = toObject(list[x]);
|
||||
}
|
||||
return ingredients;
|
||||
}
|
||||
|
||||
public static Object toActualObject(final IIngredient ingredient)
|
||||
{
|
||||
if (ingredient == null) return null;
|
||||
else {
|
||||
if (ingredient instanceof IOreDictEntry) {
|
||||
return OreDictionary.getOres(toString((IOreDictEntry) ingredient));
|
||||
} else if (ingredient instanceof IItemStack) {
|
||||
return toStack((IItemStack) ingredient);
|
||||
} else return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Object toObject(final IIngredient ingredient)
|
||||
{
|
||||
if (ingredient == null)
|
||||
return null;
|
||||
if (ingredient instanceof IOreDictEntry) {
|
||||
return toString((IOreDictEntry) ingredient);
|
||||
} else if (ingredient instanceof IItemStack) {
|
||||
return toStack((IItemStack) ingredient);
|
||||
} else return null;
|
||||
}
|
||||
|
||||
public static String toString(final IOreDictEntry entry)
|
||||
{
|
||||
return entry.getName();
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,9 @@ public abstract class AbstractRecipeRegistry<R extends IAdvancedRecipe>
|
||||
final int actualY = offSetY + y;
|
||||
if (actualY < root) {
|
||||
final int actualX = offSetX + x++;
|
||||
if (actualX < root && matrix.getStackInSlot(actualY * root + actualX) != null) {
|
||||
if (actualX < root) {
|
||||
if (matrix.getStackInSlot(actualY * root + actualX) == null)
|
||||
continue;
|
||||
final int xDifference = actualX - (offSetX - 1);
|
||||
final int yDifference = actualY - (offSetY - 1);
|
||||
if (xDifference > width)
|
||||
@@ -99,7 +101,7 @@ public abstract class AbstractRecipeRegistry<R extends IAdvancedRecipe>
|
||||
for (int x = 0; x < width; x++) {
|
||||
final int actualX = offSetX + x;
|
||||
if (matrix.getStackInSlot(actualY * root + actualX) != null) {
|
||||
recipeKey |= 1 << (y * root + x);
|
||||
recipeKey |= 1L << (y * root + x);
|
||||
recipeSize++;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@@ -3,13 +3,13 @@
|
||||
"modid": "wanionlib",
|
||||
"name": "WanionLib",
|
||||
"description": "Shared Code Library Used by (not)all WanionCane mods!",
|
||||
"version": "1.2",
|
||||
"version": "1.4",
|
||||
"mcversion": "${mcversion}",
|
||||
"url": "http://minecraft.curseforge.com/projects/wanionlib",
|
||||
"updateUrl": "",
|
||||
"authorList": ["WanionCane"],
|
||||
"credits": "",
|
||||
"logoFile": "",
|
||||
"logoFile": "WanionLib.png",
|
||||
"screenshots": [],
|
||||
"dependencies": []
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user