mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-28 15:36:06 +00:00
- Added 1.7.10 Buildcraft support
- Exceptions can now log to the minetweaker log, for easier bug resolution - /mt hand now copies to the clipboard too - /mt hand now outputs ore dictionary entries to which it belongs - Reducing verbosity a bit
This commit is contained in:
1 parent
86a3568e9e
commit
a8aae17d8a
29 files changed
+1289
-24
No files matched your search
@@ -391,6 +391,9 @@ public class MineTweakerMC {
|
||||
* @return MCF fluid stack
|
||||
*/
|
||||
public static FluidStack getLiquidStack(ILiquidStack stack) {
|
||||
if (stack == null)
|
||||
return null;
|
||||
|
||||
return (FluidStack) stack.getInternal();
|
||||
}
|
||||
|
||||
|
||||
@@ -147,10 +147,10 @@ public class MineTweakerMod {
|
||||
for (final FMLInterModComms.IMCMessage imcMessage : event.getMessages()) {
|
||||
if (imcMessage.key.equalsIgnoreCase("addMineTweakerScript")) {
|
||||
if (imcMessage.isStringMessage()) {
|
||||
scriptsIMC.add("imc", imcMessage.getStringValue());
|
||||
scriptsIMC.add(imcMessage.getSender() + "::imc", imcMessage.getStringValue());
|
||||
} else if (imcMessage.isNBTMessage()) {
|
||||
NBTTagCompound message = imcMessage.getNBTValue();
|
||||
scriptsIMC.add(message.getString("name"), message.getString("content"));
|
||||
scriptsIMC.add(imcMessage.getSender() + "::" + message.getString("name"), message.getString("content"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,16 @@
|
||||
|
||||
package minetweaker.mc164.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IItemDefinition;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -38,6 +43,22 @@ public class MCItemDefinition implements IItemDefinition {
|
||||
return MineTweakerMC.getIItemStackWildcardSize(new ItemStack(item, 1, meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IOreDictEntry> getOres() {
|
||||
List<IOreDictEntry> result = new ArrayList<IOreDictEntry>();
|
||||
|
||||
for (String key : OreDictionary.getOreNames()) {
|
||||
for (ItemStack is : OreDictionary.getOres(key)) {
|
||||
if (is.getItem() == item) {
|
||||
result.add(MineTweakerAPI.oreDict.get(key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// #############################
|
||||
// ### Object implementation ###
|
||||
// #############################
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
package minetweaker.mc164.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
@@ -24,6 +25,7 @@ import minetweaker.api.item.IngredientOr;
|
||||
import minetweaker.api.item.WeightedItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import minetweaker.mc164.actions.SetTranslationAction;
|
||||
import minetweaker.mc164.block.MCItemBlock;
|
||||
@@ -265,6 +267,23 @@ public class MCItemStack implements IItemStack {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IOreDictEntry> getOres() {
|
||||
List<IOreDictEntry> result = new ArrayList<IOreDictEntry>();
|
||||
|
||||
for (String key : OreDictionary.getOreNames()) {
|
||||
for (ItemStack is : OreDictionary.getOres(key)) {
|
||||
if (is.getItem() == stack.getItem()
|
||||
&& (is.getItemDamage() == OreDictionary.WILDCARD_VALUE || is.getItemDamage() == stack.getItemDamage())) {
|
||||
result.add(MineTweakerAPI.oreDict.get(key));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// #############################
|
||||
// ### Object implementation ###
|
||||
// #############################
|
||||
|
||||
Reference in new issue
Block a user