mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-26 14:53:03 +00:00
Update to 1.8.8 added JEI support
This commit is contained in:
1 parent
31375828c2
commit
ca57528306
19 files changed
+261
-221
No files matched your search
+4
-4
@@ -17,10 +17,10 @@
|
||||
!/MineTweaker3-MC18-Main/src
|
||||
/MineTweaker3-MC18-Main/bin
|
||||
|
||||
!/MineTweaker3-MC18-Mod-NEI
|
||||
/MineTweaker3-MC18-Mod-NEI/*
|
||||
!/MineTweaker3-MC18-Mod-NEI/src
|
||||
!/MineTweaker3-MC18-Mod-NEI/libs
|
||||
!/MineTweaker3-MC18-Mod-JEI
|
||||
/MineTweaker3-MC18-Mod-JEI/*
|
||||
!/MineTweaker3-MC18-Mod-JEI/src
|
||||
!/MineTweaker3-MC18-Mod-JEI/libs
|
||||
|
||||
!/MineTweaker3-MC1710-Main
|
||||
/MineTweaker3-MC1710-Main/*
|
||||
|
||||
@@ -13,11 +13,10 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
version = "1.8-" + ext.mineTweakerVersion
|
||||
archivesBaseName = project.projectDir.name
|
||||
@@ -25,13 +24,7 @@ archivesBaseName = project.projectDir.name
|
||||
minecraft {
|
||||
version = forgeVersion18
|
||||
runDir = "eclipse"
|
||||
|
||||
// the mappings can be changed at any time, and must be in the following format.
|
||||
// snapshot_YYYYMMDD snapshot are built nightly.
|
||||
// stable_# stables are built at the discretion of the MCP team.
|
||||
// Use non-default mappings at your own risk. they may not allways work.
|
||||
// simply re-run your setup task after changing the mappings to update your workspace.
|
||||
mappings = "snapshot_20141130"
|
||||
mappings = "snapshot_20151122"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -59,23 +59,15 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
@Mod(modid = MineTweakerMod.MODID, version = "3.0.10")
|
||||
public class MineTweakerMod {
|
||||
public static final String MODID = "MineTweaker3";
|
||||
public static final String MCVERSION = "1.8";
|
||||
public static final String MCVERSION = "1.8.8";
|
||||
|
||||
public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
|
||||
|
||||
private static final String[] REGISTRIES = {
|
||||
"minetweaker.mods.ic2.ClassRegistry",
|
||||
"minetweaker.mods.nei.ClassRegistry",
|
||||
"minetweaker.mods.mfr.ClassRegistry",
|
||||
"minetweaker.mods.gregtech.ClassRegistry",
|
||||
"minetweaker.mods.buildcraft.ClassRegistry"
|
||||
"minetweaker.mods.jei.ClassRegistry"
|
||||
};
|
||||
private static final String[] REGISTRY_DESCRIPTIONS = {
|
||||
"IC2 mod support",
|
||||
"NEI mod support",
|
||||
"MFR mod support",
|
||||
"GregTech mod support",
|
||||
"Buildcraft mod support"
|
||||
"JEI mod support",
|
||||
};
|
||||
|
||||
static {
|
||||
|
||||
@@ -8,6 +8,7 @@ package minetweaker.mc18.block;
|
||||
|
||||
import minetweaker.api.block.IBlockDefinition;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -26,7 +27,8 @@ public class MCBlockDefinition implements IBlockDefinition {
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return (String) Block.blockRegistry.getNameForObject(block);
|
||||
ResourceLocation res = Block.blockRegistry.getNameForObject(block);
|
||||
return res.getResourceDomain()+ ":"+res.getResourcePath();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,8 @@ package minetweaker.mc18.block;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import minetweaker.api.block.BlockPatternOr;
|
||||
import minetweaker.api.block.IBlock;
|
||||
import minetweaker.api.block.IBlockDefinition;
|
||||
@@ -16,6 +18,7 @@ import minetweaker.api.block.IBlockPattern;
|
||||
import minetweaker.api.data.IData;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
/**
|
||||
@@ -74,6 +77,7 @@ public class MCSpecificBlock implements IBlock {
|
||||
|
||||
private static String getBlockId(Block block)
|
||||
{
|
||||
return (String) Block.blockRegistry.getNameForObject(block);
|
||||
ResourceLocation res = Block.blockRegistry.getNameForObject(block);
|
||||
return res.getResourceDomain() + ":"+res.getResourcePath();
|
||||
}
|
||||
}
|
||||
+3
-2
@@ -48,8 +48,9 @@ public class ItemBracketHandler implements IBracketHandler {
|
||||
itemNames.clear();
|
||||
for (ResourceLocation itemRes : (Set<ResourceLocation>) Item.itemRegistry.getKeys()) {
|
||||
String itemName = itemRes.getResourceDomain() + ":" + itemRes.getResourcePath();
|
||||
itemNames.put(itemName.replace(" ", ""), (Item) Item.itemRegistry.getObject(itemName));
|
||||
System.out.println(itemName + " : " + (Item) Item.itemRegistry.getObject(itemName));
|
||||
ResourceLocation res = new ResourceLocation(itemRes.getResourceDomain(), itemRes.getResourcePath().replace(" ", ""));
|
||||
itemNames.put(itemName.replace(" ", ""), (Item) Item.itemRegistry.getObject(itemRes));
|
||||
System.out.println(itemName + " : " + (Item) Item.itemRegistry.getObject(itemRes));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class MCGame implements IGame {
|
||||
@Override
|
||||
public List<IBlockDefinition> getBlocks() {
|
||||
List<IBlockDefinition> result = new ArrayList<IBlockDefinition>();
|
||||
for (String block : (Set<String>) Block.blockRegistry.getKeys()) {
|
||||
for (ResourceLocation block : (Set<ResourceLocation>) Block.blockRegistry.getKeys()) {
|
||||
result.add(MineTweakerMC.getBlockDefinition((Block) Block.blockRegistry.getObject(block)));
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -15,6 +15,7 @@ import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidDefinition;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -37,7 +38,7 @@ public class MCLiquidDefinition implements ILiquidDefinition {
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return fluid.getLocalizedName();
|
||||
return fluid.getUnlocalizedName() == null ? "" : StatCollector.translateToLocal(fluid.getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,7 +182,7 @@ public class MCLiquidDefinition implements ILiquidDefinition {
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + filled.getDisplayName() + " as liquid container for " + fluid.getLocalizedName();
|
||||
return "Adding " + filled.getDisplayName() + " as liquid container for " + fluid.getUnlocalizedName() == null ? "" : StatCollector.translateToLocal(fluid.getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,7 +51,7 @@ public class MCLiquidStack implements ILiquidStack {
|
||||
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
return stack.getFluid().getLocalizedName();
|
||||
return stack.getFluid().getLocalizedName(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,7 +43,7 @@ public class MCPlayer implements IPlayer {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return player.getName();
|
||||
return player.getCommandSenderName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,7 +61,7 @@ public class MCServer extends AbstractServer {
|
||||
|
||||
UserListOps ops = MinecraftServer.getServer().getConfigurationManager().getOppedPlayers();
|
||||
if (server.isDedicatedServer()) {
|
||||
return ops.hasEntries() || ops.getGameProfileFromName(player.getName()) != null;
|
||||
return ops.getKeys().length>0 || ops.getGameProfileFromName(player.getName()) != null;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@@ -74,17 +74,17 @@ public class MCServer extends AbstractServer {
|
||||
return ServerPlayer.INSTANCE;
|
||||
} else {
|
||||
System.out.println("Unsupported command sender: " + commandSender);
|
||||
System.out.println("player name: " + commandSender.getName());
|
||||
System.out.println("player name: " + commandSender.getCommandSenderName());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void removeCommand(ICommand command) {
|
||||
CommandHandler ch = (CommandHandler) MinecraftServer.getServer().getCommandManager();
|
||||
ch.getCommands().remove(command.getName());
|
||||
ch.getCommands().remove(command.getCommandName());
|
||||
|
||||
if (command.getAliases() != null) {
|
||||
for (String alias : (List<String>) command.getAliases()) {
|
||||
if (command.getCommandAliases() != null) {
|
||||
for (String alias : (List<String>) command.getCommandAliases()) {
|
||||
ch.getCommands().remove(alias);
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class MCServer extends AbstractServer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String getCommandName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -118,12 +118,12 @@ public class MCServer extends AbstractServer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getAliases() {
|
||||
public List getCommandAliases() {
|
||||
return aliases;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCommandSenderUse(ICommandSender var1) {
|
||||
public boolean canCommandSenderUseCommand(ICommandSender var1) {
|
||||
if (validator == null) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -138,12 +138,12 @@ public class MCServer extends AbstractServer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object o) {
|
||||
public int compareTo(ICommand o) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(ICommandSender sender, String[] args) throws CommandException {
|
||||
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
|
||||
function.execute(args, getPlayer(sender));
|
||||
}
|
||||
|
||||
@@ -155,6 +155,7 @@ public class MCServer extends AbstractServer {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private class AddCommandAction implements IUndoableAction {
|
||||
@@ -182,12 +183,12 @@ public class MCServer extends AbstractServer {
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding command " + command.getName();
|
||||
return "Adding command " + command.getCommandName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing command " + command.getName();
|
||||
return "Removing command " + command.getCommandName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -221,12 +222,12 @@ public class MCServer extends AbstractServer {
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding command " + command.getName();
|
||||
return "Adding command " + command.getCommandName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing command " + command.getName();
|
||||
return "Removing command " + command.getCommandName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,8 +64,8 @@ public class MCLootRegistry implements ILootRegistry {
|
||||
results.add(new LootEntry(new WeightedItemStack(
|
||||
MineTweakerMC.getIItemStack(content.theItemId),
|
||||
content.itemWeight),
|
||||
content.theMinimumChanceToGenerateItem,
|
||||
content.theMaximumChanceToGenerateItem));
|
||||
content.minStackSize,
|
||||
content.maxStackSize));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
package minetweaker.mods.jei;
|
||||
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.NotNull;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
/**
|
||||
* MineTweaker NEI support.
|
||||
*
|
||||
* Enables hiding NEI items as well as adding new item stacks. These item stacks
|
||||
* can then show a custom message or contain NBT data. Can be used to show a
|
||||
* custom message or lore with certain items, or to provide spawnable items with
|
||||
* specific NBT tags.
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("mods.jei.JEI")
|
||||
public class JEI {
|
||||
/**
|
||||
* Hides a specific item in NEI. Will take into account metadata values, if
|
||||
* any.
|
||||
*
|
||||
* @param item
|
||||
* item to be hidden
|
||||
*/
|
||||
@ZenMethod
|
||||
public static void hide(@NotNull IItemStack item) {
|
||||
MineTweakerAPI.apply(new JEIHideItemAction(item));
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * Adds a NEI entry. The item stack can contain damage values and NBT
|
||||
// tags.
|
||||
// *
|
||||
// * @param stack
|
||||
// * item stack to be added
|
||||
// */
|
||||
// @ZenMethod
|
||||
// public static void addEntry(@NotNull IItemStack stack) {
|
||||
// MineTweakerAPI.apply(new NEIAddEntryAction(getItemStack(stack)));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * Overrides a name in NEI. Note that this will not change the original
|
||||
// * display name, but it will change the way it is displayed in NEI.
|
||||
// *
|
||||
// * @param item
|
||||
// * item
|
||||
// * @param name
|
||||
// * item name
|
||||
// */
|
||||
// @ZenMethod
|
||||
// public static void overrideName(@NotNull IItemStack item, @NotNull String
|
||||
// name) {
|
||||
// MineTweakerAPI.apply(new NEIOverrideNameAction(getItemStack(item),
|
||||
// name));
|
||||
// }
|
||||
|
||||
// #############################
|
||||
// ### Private inner classes ###
|
||||
// #############################
|
||||
|
||||
// private static class NEIAddEntryAction implements IUndoableAction {
|
||||
// private final ItemStack item;
|
||||
//
|
||||
// public NEIAddEntryAction(ItemStack item) {
|
||||
// this.item = item;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void apply() {
|
||||
// JEIAddonPlugin.jeiHelpers.getItemBlacklist().addItemToBlacklist(item);
|
||||
// // API.addItemListEntry(item);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean canUndo() {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void undo() {
|
||||
// API.hideItem(item);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String describe() {
|
||||
// return "Adding " + item.getDisplayName() + " as NEI entry";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String describeUndo() {
|
||||
// return "Removing " + item.getDisplayName() + " as NEI entry";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Object getOverrideKey() {
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
|
||||
private static class JEIHideItemAction implements IUndoableAction {
|
||||
private final IItemStack stack;
|
||||
|
||||
public JEIHideItemAction(IItemStack stack) {
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
JEIAddonPlugin.jeiHelpers.getItemBlacklist().addItemToBlacklist(getItemStack(stack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
JEIAddonPlugin.jeiHelpers.getItemBlacklist().removeItemFromBlacklist(getItemStack(stack));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Hiding " + stack + " in JEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Displaying " + stack + " in JEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// private static class NEIOverrideNameAction extends OneWayAction {
|
||||
// private final ItemStack item;
|
||||
// private final String name;
|
||||
//
|
||||
// public NEIOverrideNameAction(ItemStack item, String name) {
|
||||
// this.item = item;
|
||||
// this.name = name;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void apply() {
|
||||
// API.setOverrideName(item, name);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String describe() {
|
||||
// return "Overriding NEI item name of " + item.getUnlocalizedName() + " to
|
||||
// " + name;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Object getOverrideKey() {
|
||||
// return item;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package minetweaker.mods.jei;
|
||||
|
||||
import mezz.jei.api.IItemRegistry;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.IRecipeRegistry;
|
||||
|
||||
@mezz.jei.api.JEIPlugin
|
||||
public class JEIAddonPlugin implements IModPlugin{
|
||||
|
||||
public static IJeiHelpers jeiHelpers;
|
||||
public static IItemRegistry itemRegistry;
|
||||
public static IRecipeRegistry recipeRegistry;
|
||||
|
||||
@Override
|
||||
public boolean isModLoaded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJeiHelpersAvailable(IJeiHelpers jeiHelpers) {
|
||||
this.jeiHelpers = jeiHelpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRegistryAvailable(IItemRegistry itemRegistry) {
|
||||
this.itemRegistry = itemRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecipeRegistryAvailable(IRecipeRegistry recipeRegistry) {
|
||||
this.recipeRegistry = recipeRegistry;
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
@@ -1,165 +0,0 @@
|
||||
package minetweaker.mods.nei;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import stanhebben.zenscript.annotations.NotNull;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.OneWayAction;
|
||||
import minetweaker.annotations.ModOnly;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* MineTweaker NEI support.
|
||||
*
|
||||
* Enables hiding NEI items as well as adding new item stacks. These item stacks
|
||||
* can then show a custom message or contain NBT data. Can be used to show
|
||||
* a custom message or lore with certain items, or to provide spawnable items
|
||||
* with specific NBT tags.
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@ZenClass("mods.nei.NEI")
|
||||
@ModOnly("NotEnoughItems")
|
||||
public class NEI {
|
||||
/**
|
||||
* Hides a specific item in NEI. Will take into account metadata values, if
|
||||
* any.
|
||||
*
|
||||
* @param item item to be hidden
|
||||
*/
|
||||
@ZenMethod
|
||||
public static void hide(@NotNull IItemStack item) {
|
||||
MineTweakerAPI.apply(new NEIHideItemAction(getItemStack(item)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a NEI entry. The item stack can contain damage values and NBT tags.
|
||||
*
|
||||
* @param stack item stack to be added
|
||||
*/
|
||||
@ZenMethod
|
||||
public static void addEntry(@NotNull IItemStack stack) {
|
||||
MineTweakerAPI.apply(new NEIAddEntryAction(getItemStack(stack)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides a name in NEI. Note that this will not change the original
|
||||
* display name, but it will change the way it is displayed in NEI.
|
||||
*
|
||||
* @param item item
|
||||
* @param name item name
|
||||
*/
|
||||
@ZenMethod
|
||||
public static void overrideName(@NotNull IItemStack item, @NotNull String name) {
|
||||
MineTweakerAPI.apply(new NEIOverrideNameAction(getItemStack(item), name));
|
||||
}
|
||||
|
||||
// #############################
|
||||
// ### Private inner classes ###
|
||||
// #############################
|
||||
|
||||
private static class NEIAddEntryAction implements IUndoableAction {
|
||||
private final ItemStack item;
|
||||
|
||||
public NEIAddEntryAction(ItemStack item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
API.addItemListEntry(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
API.hideItem(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + item.getDisplayName() + " as NEI entry";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing " + item.getDisplayName() + " as NEI entry";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static class NEIHideItemAction implements IUndoableAction {
|
||||
private final ItemStack stack;
|
||||
|
||||
public NEIHideItemAction(ItemStack stack) {
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
API.hideItem(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
API.addItemListEntry(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Hiding " + stack.getUnlocalizedName() + " in NEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Displaying " + stack.getUnlocalizedName() + " in NEI";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static class NEIOverrideNameAction extends OneWayAction {
|
||||
private final ItemStack item;
|
||||
private final String name;
|
||||
|
||||
public NEIOverrideNameAction(ItemStack item, String name) {
|
||||
this.item = item;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
API.setOverrideName(item, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Overriding NEI item name of " + item.getUnlocalizedName() + " to " + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import javax.tools.ToolProvider
|
||||
|
||||
// #######################
|
||||
// ### Global settings ###
|
||||
@@ -6,7 +5,7 @@ import javax.tools.ToolProvider
|
||||
|
||||
ext.mineTweakerVersion = "3.0.10"
|
||||
ext.mineTweakerDebug = "false"
|
||||
ext.javaToolsJar = ((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs()
|
||||
ext.javaToolsJar = new File("C:/Program Files/Java/jdk1.8.0_66/lib/tools.jar")
|
||||
|
||||
// #######################
|
||||
// ### 1.7.10 settings ###
|
||||
@@ -25,8 +24,8 @@ ext.projects1710 = [
|
||||
// ### 1.8 settings ###
|
||||
// ####################
|
||||
|
||||
ext.forgeVersion18 = "1.8-11.14.3.1450"
|
||||
ext.forgeVersion18 = "1.8.8-11.15.0.1641-1.8.8"
|
||||
ext.projects18 = [
|
||||
'MineTweaker3-MC18-Main',
|
||||
'MineTweaker3-MC18-Mod-NEI'
|
||||
'MineTweaker3-MC18-Mod-JEI'
|
||||
]
|
||||
Vendored
BIN
Binary file not shown.
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Sat Sep 05 17:00:16 CEST 2015
|
||||
#Mon Sep 14 12:28:28 PDT 2015
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
Reference in new issue
Block a user