mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-13 16:54:03 +00:00
updated a few mods, added a new command... made the entitymappinglogger output entityid as well(not tested)
This commit is contained in:
1 parent
deb7bf4903
commit
a1999c739f
10 files changed
+122
-70
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,7 @@ import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.api.server.ICommandFunction;
|
||||
import modtweaker.commands.EntityMappingLogger;
|
||||
import modtweaker.mods.botania.commands.BotaniaBrewLogger;
|
||||
import modtweaker.mods.botania.commands.BotaniaOrchidLogger;
|
||||
import modtweaker.mods.botania.lexicon.commands.LexiconCategoryLogger;
|
||||
import modtweaker.mods.botania.lexicon.commands.LexiconEntryLogger;
|
||||
import modtweaker.mods.botania.lexicon.commands.LexiconKnowledgeTypesLogger;
|
||||
@@ -26,8 +27,8 @@ public class Commands {
|
||||
}
|
||||
});
|
||||
|
||||
MineTweakerAPI.server.addMineTweakerCommand("entities", new String[] { "/minetweaker entities", " Outputs a list of entities class mapping keys" }, new EntityMappingLogger());
|
||||
|
||||
MineTweakerAPI.server.addMineTweakerCommand("entities", new String[] { "/minetweaker entities", " Outputs a list of entities class mapping keys and the entity IDs" }, new EntityMappingLogger());
|
||||
|
||||
if (TweakerPlugin.isLoaded("Mekanism")) {
|
||||
MineTweakerAPI.server.addMineTweakerCommand("gases", new String[] { "/minetweaker gases", " Outputs a list of all gas names in the game to the minetweaker log" }, new GasLogger());
|
||||
}
|
||||
@@ -47,6 +48,7 @@ public class Commands {
|
||||
MineTweakerAPI.server.addMineTweakerCommand("lexiconPages", new String[] { "/minetweaker lexiconPages", "/minetweaker lexiconPages [ENTRY]", " Outputs a list of lexicon pages for the entry" }, new LexiconPageLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("botaniaBrews", new String[] { "/minetweaker botaniaBrews", " Outputs a list of keys for botania brews" }, new BotaniaBrewLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("lexiconKnowledgeTypes", new String[] { "/minetweaker lexiconKnowledgeTypes", " Outputs a list of keys for lexicon knowledge types" }, new LexiconKnowledgeTypesLogger());
|
||||
MineTweakerAPI.server.addMineTweakerCommand("botaniaOrchids", new String[] { "/minetweaker botaniaOrchids", " Outputs a list of keys for botania orchid weights" }, new BotaniaOrchidLogger());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
package modtweaker.commands;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.entity.EntityList;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconCategory;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.api.server.ICommandFunction;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
|
||||
public class EntityMappingLogger implements ICommandFunction{
|
||||
public class EntityMappingLogger implements ICommandFunction {
|
||||
|
||||
@Override
|
||||
public void execute(String[] arguments, IPlayer player) {
|
||||
Set<String> keys=EntityList.stringToClassMapping.keySet();
|
||||
System.out.println("Mob Keys: " + keys.size());
|
||||
for (String key : keys) {
|
||||
System.out.println("Mob Key " + key);
|
||||
MineTweakerAPI.logCommand(key);
|
||||
}
|
||||
@Override
|
||||
public void execute(String[] arguments, IPlayer player) {
|
||||
|
||||
if (player != null) {
|
||||
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
|
||||
}
|
||||
}
|
||||
Set<Integer> keys = EntityList.stringToIDMapping.keySet();
|
||||
System.out.println("Mob Keys: " + keys.size());
|
||||
for (Integer key : keys) {
|
||||
System.out.println("Mob Key " + EntityList.getStringFromID(key) + " : " + key);
|
||||
MineTweakerAPI.logCommand("Mob Key " + EntityList.getStringFromID(key) + " : " + key);
|
||||
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package modtweaker.mods.botania.commands;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.Botania;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.MineTweakerImplementationAPI;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.api.server.ICommandFunction;
|
||||
import modtweaker.mods.botania.BotaniaHelper;
|
||||
import net.minecraft.entity.EntityList;
|
||||
|
||||
public class BotaniaOrchidLogger implements ICommandFunction {
|
||||
|
||||
@Override
|
||||
public void execute(String[] arguments, IPlayer player) {
|
||||
|
||||
Set<String> keys = BotaniaAPI.oreWeights.keySet();
|
||||
System.out.println("Orchid Keys: " + keys.size());
|
||||
for (String str : BotaniaAPI.oreWeights.keySet()) {
|
||||
System.out.println("Orchid Key: " + str);
|
||||
MineTweakerAPI.logCommand(str + ": " + BotaniaAPI.oreWeights.get(str) + "\n");
|
||||
}
|
||||
|
||||
if (player != null) {
|
||||
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@ public class Orechid {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
|
||||
BotaniaAPI.addOreWeight(oreDict, weight);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,15 @@ package modtweaker.mods.exnihilo.handlers;
|
||||
|
||||
import static modtweaker.helpers.InputHelper.isABlock;
|
||||
import static modtweaker.helpers.InputHelper.toStack;
|
||||
import static modtweaker.helpers.StackHelper.areEqual;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import modtweaker.util.BaseListAddition;
|
||||
import modtweaker.util.BaseListRemoval;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
@@ -16,59 +19,70 @@ import exnihilo.registries.helpers.Smashable;
|
||||
|
||||
@ZenClass("mods.exnihilo.Hammer")
|
||||
public class Hammer {
|
||||
//Adding a Ex Nihilo Hammer recipe
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack input, IItemStack output, double chance, double luck) {
|
||||
if (isABlock(input)) {
|
||||
Block theBlock = Block.getBlockFromItem(toStack(input).getItem());
|
||||
int theMeta = toStack(input).getItemDamage();
|
||||
MineTweakerAPI.apply(new Add(new Smashable(theBlock, theMeta, toStack(output).getItem(), toStack(output).getItemDamage(), (float) chance, (float) luck)));
|
||||
}
|
||||
}
|
||||
// Adding a Ex Nihilo Hammer recipe
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack input, IItemStack output, double chance, double luck) {
|
||||
if (isABlock(input)) {
|
||||
Block theBlock = Block.getBlockFromItem(toStack(input).getItem());
|
||||
int theMeta = toStack(input).getItemDamage();
|
||||
MineTweakerAPI.apply(new Add(new Smashable(theBlock, theMeta, toStack(output).getItem(), toStack(output).getItemDamage(), (float) chance, (float) luck)));
|
||||
}
|
||||
}
|
||||
|
||||
//Passes the list to the base list implementation, and adds the recipe
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(Smashable recipe) {
|
||||
super("ExNihilo Hammer", HammerRegistry.rewards, recipe);
|
||||
}
|
||||
// Passes the list to the base list implementation, and adds the recipe
|
||||
private static class Add extends BaseListAddition {
|
||||
public Add(Smashable recipe) {
|
||||
super("ExNihilo Hammer", HammerRegistry.rewards, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return new ItemStack(((Smashable) recipe).source, 1, ((Smashable) recipe).sourceMeta).getDisplayName();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return new ItemStack(((Smashable) recipe).source, 1, ((Smashable) recipe).sourceMeta).getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//Removing a Ex Nihilo Hammer recipe
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
// Removing a Ex Nihilo Hammer recipe
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(toStack(output)));
|
||||
}
|
||||
|
||||
//Removes a recipe, apply is never the same for anything, so will always need to override it
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("ExNihilo Hammer", HammerRegistry.rewards, stack);
|
||||
}
|
||||
// Removes a recipe, apply is never the same for anything, so will always
|
||||
// need to override it
|
||||
private static class Remove extends BaseListRemoval {
|
||||
public Remove(ItemStack stack) {
|
||||
super("ExNihilo Hammer", HammerRegistry.rewards, stack);
|
||||
}
|
||||
|
||||
//Loops through the registry, to find the item that matches, saves that recipe then removes it
|
||||
@Override
|
||||
public void apply() {
|
||||
for (Smashable r : HammerRegistry.rewards) {
|
||||
ItemStack check = new ItemStack(r.item, 1, r.meta);
|
||||
if (check != null && areEqual(check, stack)) {
|
||||
recipe = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Loops through the registry, to find the item that matches, saves that
|
||||
// recipe then removes it
|
||||
@Override
|
||||
public void apply() {
|
||||
boolean found = false;
|
||||
Iterator<Smashable> smashables = HammerRegistry.rewards.iterator();
|
||||
while (!found && smashables.hasNext()) {
|
||||
Smashable reward = smashables.next();
|
||||
if (reward.source == Block.getBlockFromItem(stack.getItem())) {
|
||||
reward.source = Blocks.air;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
HammerRegistry.rewards.remove(recipe);
|
||||
}
|
||||
// for (Smashable r : HammerRegistry.rewards.) {
|
||||
// ItemStack check = new ItemStack(r.item, 1, r.meta);
|
||||
// if (check != null && areEqual(check, stack)) {
|
||||
// recipe = r;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
return stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,14 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import forestry.Forestry;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.utils.RecipeUtil;
|
||||
import forestry.core.utils.ShapedRecipeCustom;
|
||||
import forestry.factory.gadgets.MachineCarpenter;
|
||||
import forestry.factory.gadgets.MachineCarpenter.Recipe;
|
||||
import forestry.factory.gadgets.MachineCarpenter.RecipeManager;
|
||||
|
||||
import modtweaker.mods.forestry.ForestryHelper;
|
||||
|
||||
@ZenClass("mods.forestry.Carpenter")
|
||||
|
||||
@@ -76,6 +76,11 @@ public class Crucible {
|
||||
super("FSP Crucible Melting", SteamcraftRegistry.smeltThings, key);
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
public void apply(){
|
||||
SteamcraftRegistry.smeltThings.remove(stack);
|
||||
MutablePair<String, Integer> pair;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeInfo() {
|
||||
|
||||
Reference in new issue
Block a user