mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-28 07:35:40 +00:00
updated to 1.9.4
This commit is contained in:
1 parent
f89919bae7
commit
a7e6f13c60
27 files changed
+291
-118
No files matched your search
@@ -1,15 +1,5 @@
|
||||
package minetweaker;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import minetweaker.annotations.BracketHandler;
|
||||
import minetweaker.annotations.ModOnly;
|
||||
import minetweaker.api.client.IClient;
|
||||
@@ -17,15 +7,15 @@ import minetweaker.api.event.IEventManager;
|
||||
import minetweaker.api.formatting.IFormatter;
|
||||
import minetweaker.api.game.IGame;
|
||||
import minetweaker.api.mods.ILoadedMods;
|
||||
import minetweaker.runtime.ITweaker;
|
||||
import minetweaker.runtime.ILogger;
|
||||
import minetweaker.runtime.MTTweaker;
|
||||
import minetweaker.api.recipes.IRecipeManager;
|
||||
import minetweaker.api.oredict.IOreDict;
|
||||
import minetweaker.api.recipes.IFurnaceManager;
|
||||
import minetweaker.api.recipes.IRecipeManager;
|
||||
import minetweaker.api.server.IServer;
|
||||
import minetweaker.api.vanilla.IVanilla;
|
||||
import minetweaker.runtime.GlobalRegistry;
|
||||
import minetweaker.runtime.ILogger;
|
||||
import minetweaker.runtime.ITweaker;
|
||||
import minetweaker.runtime.MTTweaker;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenExpansion;
|
||||
import stanhebben.zenscript.symbols.IZenSymbol;
|
||||
@@ -35,6 +25,16 @@ import stanhebben.zenscript.symbols.SymbolJavaStaticMethod;
|
||||
import stanhebben.zenscript.type.natives.IJavaMethod;
|
||||
import stanhebben.zenscript.type.natives.JavaMethod;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Provides access to the MineTweaker API.
|
||||
*
|
||||
@@ -79,7 +79,8 @@ public class MineTweakerAPI {
|
||||
|
||||
registerGlobalSymbol("logger", getJavaStaticGetterSymbol(MineTweakerAPI.class, "getLogger"));
|
||||
registerGlobalSymbol("recipes", getJavaStaticFieldSymbol(MineTweakerAPI.class, "recipes"));
|
||||
registerGlobalSymbol("furnace", getJavaStaticFieldSymbol(MineTweakerAPI.class, "furnace"));
|
||||
// registerGlobalSymbol("brewing", getJavaStaticFieldSymbol(MineTweakerAPI.class, "brewing"));
|
||||
registerGlobalSymbol("furnace", getJavaStaticFieldSymbol(MineTweakerAPI.class, "furnace"));
|
||||
registerGlobalSymbol("oreDict", getJavaStaticFieldSymbol(MineTweakerAPI.class, "oreDict"));
|
||||
registerGlobalSymbol("events", getJavaStaticFieldSymbol(MineTweakerAPI.class, "events"));
|
||||
registerGlobalSymbol("server", getJavaStaticFieldSymbol(MineTweakerAPI.class, "server"));
|
||||
@@ -91,6 +92,7 @@ public class MineTweakerAPI {
|
||||
}
|
||||
|
||||
private MineTweakerAPI() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,6 +122,11 @@ public class MineTweakerAPI {
|
||||
*/
|
||||
public static IRecipeManager recipes = null;
|
||||
|
||||
// /**
|
||||
// * Access point to the brewing manager.
|
||||
// */
|
||||
// public static IBrewingManager brewing = null;
|
||||
|
||||
/**
|
||||
* Access point to the furnace manager.
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.awt.datatransfer.StringSelection;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import static minetweaker.MineTweakerAPI.furnace;
|
||||
import static minetweaker.MineTweakerAPI.server;
|
||||
|
||||
/**
|
||||
@@ -243,7 +244,7 @@ public class MineTweakerImplementationAPI {
|
||||
}
|
||||
|
||||
MineTweakerAPI.logCommand("Furnace Recipes:");
|
||||
for (IFurnaceRecipe recipe : MineTweakerAPI.furnace.getAll()) {
|
||||
for (IFurnaceRecipe recipe : furnace.getAll()) {
|
||||
try {
|
||||
MineTweakerAPI.logCommand(recipe.toCommandString());
|
||||
} catch (Throwable ex) {
|
||||
@@ -761,6 +762,7 @@ public class MineTweakerImplementationAPI {
|
||||
public String describeUndo() {
|
||||
return "tried to remove command: " + command.name + " failed. THIS IS NOT AN ERROR!";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
|
||||
/**
|
||||
* Created by Jared on 6/3/2016.
|
||||
*/
|
||||
public class BrewingRecipe implements IBrewingRecipe {
|
||||
|
||||
private final IItemStack output;
|
||||
private final IItemStack input;
|
||||
private final IIngredient ingredient;
|
||||
|
||||
public BrewingRecipe(IItemStack output, IItemStack input, IIngredient ingredient) {
|
||||
this.input = input;
|
||||
this.ingredient = ingredient;
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toCommandString() {
|
||||
return String.format("brewing.add(%s, %s, %s", output, input, ingredient);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The BrewingManager adds and removes brewing recipes. The IBrewingManager
|
||||
* instance is available through the recipes global variable.
|
||||
*
|
||||
* @author Jared
|
||||
*/
|
||||
@ZenClass("minetweaker.recipes.IBrewingManager")
|
||||
public interface IBrewingManager {
|
||||
|
||||
/**
|
||||
* Returns all crafting recipes.
|
||||
*
|
||||
* @return all crafting recipes
|
||||
*/
|
||||
@ZenGetter("all")
|
||||
public List<IBrewingRecipe> getAll();
|
||||
|
||||
/**
|
||||
* Removes a brewing recipe from the specified item.
|
||||
*
|
||||
* @param output recipe output pattern
|
||||
* @return number of removed recipes
|
||||
*/
|
||||
@ZenMethod
|
||||
public void remove(IItemStack output);
|
||||
|
||||
/**
|
||||
* Adds a recipe.
|
||||
*
|
||||
* @param output recipe output
|
||||
* @param ingredient recipe ingredient
|
||||
* @param input recipe input
|
||||
*/
|
||||
@ZenMethod
|
||||
public void add(
|
||||
IItemStack output,
|
||||
IItemStack ingredient,
|
||||
IItemStack input);
|
||||
|
||||
/**
|
||||
* Removes recipes.
|
||||
*
|
||||
* @param output recipe output
|
||||
* @param ingredients recipe ingredient
|
||||
* @return number of removed recipes
|
||||
*/
|
||||
@ZenMethod
|
||||
public int remove(
|
||||
IItemStack output,
|
||||
IItemStack ingredients);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package minetweaker.api.recipes;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
|
||||
/**
|
||||
* Created by Jared on 6/2/2016.
|
||||
*/
|
||||
@ZenClass("minetweaker.recipes.IBrewingRecipe")
|
||||
public interface IBrewingRecipe {
|
||||
|
||||
public String toCommandString();
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* The RecipeManager adds and removes crafting recipes. The IRecipeManager
|
||||
* instance is available throug the recipes global variable.
|
||||
* instance is available through the recipes global variable.
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package minetweaker.api.vanilla;
|
||||
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import stanhebben.zenscript.annotations.ZenSetter;
|
||||
|
||||
/**
|
||||
* Created by Jared on 6/3/2016.
|
||||
*/
|
||||
@ZenClass("minetweaker.vanilla.ILootFunction")
|
||||
public interface ILootFunction {
|
||||
|
||||
@ZenMethod
|
||||
String getName();
|
||||
|
||||
@ZenSetter
|
||||
void setName();
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -6,31 +6,30 @@
|
||||
|
||||
package minetweaker.api.vanilla;
|
||||
|
||||
import java.util.List;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.WeightedItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenGetter;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
@ZenClass("vanilla.ILootRegistry")
|
||||
public interface ILootRegistry {
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item);
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item);
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item, int min, int max);
|
||||
|
||||
@ZenMethod
|
||||
public void addChestLoot(String name, WeightedItemStack item, int min, int max);
|
||||
@ZenMethod
|
||||
public void removeChestLoot(String name, IIngredient ingredient);
|
||||
|
||||
@ZenMethod
|
||||
public void removeChestLoot(String name, IIngredient ingredient);
|
||||
@ZenMethod
|
||||
public List<LootEntry> getLoot(String name);
|
||||
|
||||
@ZenMethod
|
||||
public List<LootEntry> getLoot(String name);
|
||||
|
||||
@ZenGetter("lootTypes")
|
||||
public List<String> getLootTypes();
|
||||
@ZenGetter("lootTypes")
|
||||
public List<String> getLootTypes();
|
||||
}
|
||||
@@ -46,7 +46,7 @@ import java.io.File;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@Mod(modid = MineTweakerMod.MODID, version = "3.0.7")
|
||||
@Mod(modid = MineTweakerMod.MODID, version = "3.0.9")
|
||||
public class MineTweakerMod {
|
||||
public static final String MODID = "MineTweaker3";
|
||||
public static final String MCVERSION = "1.7.10";
|
||||
|
||||
@@ -49,7 +49,7 @@ import java.io.File;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@Mod(modid = MineTweakerMod.MODID, version = "3.0.7")
|
||||
@Mod(modid = MineTweakerMod.MODID, version = "3.0.9")
|
||||
public class MineTweakerMod {
|
||||
public static final String MODID = "MineTweaker3";
|
||||
public static final String MCVERSION = "1.8.9";
|
||||
|
||||
@@ -9,7 +9,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
@@ -20,7 +20,7 @@ archivesBaseName = project.projectDir.name
|
||||
minecraft {
|
||||
version = forgeVersion19
|
||||
runDir = "eclipse"
|
||||
mappings = "snapshot_20160312"
|
||||
mappings = "snapshot_20160518"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -48,10 +48,10 @@ public class MineTweakerMC {
|
||||
public static final IBiome[] biomes;
|
||||
|
||||
static {
|
||||
biomes = new IBiome[BiomeGenBase.biomeRegistry.getKeys().size()];
|
||||
for (int i = 0; i <BiomeGenBase.biomeRegistry.getKeys().size(); i++) {
|
||||
if (BiomeGenBase.biomeRegistry.getObjectById(i)!= null)
|
||||
biomes[i] = new MCBiome(BiomeGenBase.biomeRegistry.getObjectById(i));
|
||||
biomes = new IBiome[Biome.REGISTRY.getKeys().size()];
|
||||
for (int i = 0; i <Biome.REGISTRY.getKeys().size(); i++) {
|
||||
if (Biome.REGISTRY.getObjectById(i)!= null)
|
||||
biomes[i] = new MCBiome(Biome.REGISTRY.getObjectById(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public class MCPlatformFunctions implements IPlatformFunctions{
|
||||
Item item = Item.getItemById(id);
|
||||
if(item == null)
|
||||
return null;
|
||||
ResourceLocation res = Item.itemRegistry.getNameForObject(item);
|
||||
ResourceLocation res = Item.REGISTRY.getNameForObject(item);
|
||||
String sid = res.getResourceDomain() + ":" + res.getResourcePath();
|
||||
return new MCItemDefinition(sid, item);
|
||||
}
|
||||
|
||||
@@ -49,10 +49,10 @@ import java.io.File;
|
||||
*
|
||||
* @author Stan Hebben
|
||||
*/
|
||||
@Mod(modid = MineTweakerMod.MODID, version = "3.0.7")
|
||||
@Mod(modid = MineTweakerMod.MODID, version = "3.0.9")
|
||||
public class MineTweakerMod {
|
||||
public static final String MODID = "MineTweaker3";
|
||||
public static final String MCVERSION = "1.9";
|
||||
public static final String MCVERSION = "1.9.4";
|
||||
|
||||
public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
|
||||
|
||||
@@ -81,7 +81,6 @@ public class MineTweakerMod {
|
||||
File globalDir = new File("scripts");
|
||||
if (!globalDir.exists())
|
||||
globalDir.mkdirs();
|
||||
|
||||
scriptsIMC = new ScriptProviderCustom("intermod");
|
||||
scriptsGlobal = new ScriptProviderDirectory(globalDir);
|
||||
MineTweakerImplementationAPI.setScriptProvider(scriptsGlobal);
|
||||
|
||||
+2
-2
@@ -37,8 +37,8 @@ public class SetBlockHardnessAction implements IUndoableAction{
|
||||
}
|
||||
|
||||
public static boolean isBlock(ItemStack stack){
|
||||
ResourceLocation name = Block.blockRegistry.getNameForObject(Block.getBlockFromItem(stack.getItem()));
|
||||
return !name.toString().equals("minecraft:air") && Block.blockRegistry.containsKey(name);
|
||||
ResourceLocation name = Block.REGISTRY.getNameForObject(Block.getBlockFromItem(stack.getItem()));
|
||||
return !name.toString().equals("minecraft:air") && Block.REGISTRY.containsKey(name);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class MCBlockDefinition implements IBlockDefinition{
|
||||
|
||||
@Override
|
||||
public String getId(){
|
||||
return Block.blockRegistry.getNameForObject(block).toString();
|
||||
return Block.REGISTRY.getNameForObject(block).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ public class MCSpecificBlock implements IBlock{
|
||||
}
|
||||
|
||||
private static String getBlockId(Block block){
|
||||
return Block.blockRegistry.getNameForObject(block).toString();
|
||||
return Block.REGISTRY.getNameForObject(block).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-2
@@ -51,9 +51,9 @@ public class ItemBracketHandler implements IBracketHandler{
|
||||
public static void rebuildItemRegistry(){
|
||||
itemNames.clear();
|
||||
|
||||
for(ResourceLocation itemName : (Set<ResourceLocation>) Item.itemRegistry.getKeys()){
|
||||
for(ResourceLocation itemName : (Set<ResourceLocation>) Item.REGISTRY.getKeys()){
|
||||
String domain = itemName.toString().replace(" ", "").replace("'", "");
|
||||
itemNames.put(domain, Item.itemRegistry.getObject(itemName));
|
||||
itemNames.put(domain, Item.REGISTRY.getObject(itemName));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package minetweaker.mc19.brewing;
|
||||
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.item.IngredientItem;
|
||||
import minetweaker.api.item.IngredientOr;
|
||||
import minetweaker.api.recipes.BrewingRecipe;
|
||||
import minetweaker.api.recipes.IBrewingManager;
|
||||
import minetweaker.api.recipes.IBrewingRecipe;
|
||||
import minetweaker.mc19.item.MCItemStack;
|
||||
import minetweaker.util.ArrayUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.brewing.AbstractBrewingRecipe;
|
||||
import net.minecraftforge.common.brewing.BrewingOreRecipe;
|
||||
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Jared on 6/3/2016.
|
||||
*/
|
||||
public class MCBrewingManager implements IBrewingManager {
|
||||
@Override
|
||||
public List<IBrewingRecipe> getAll() {
|
||||
List<IBrewingRecipe> ret = new ArrayList<IBrewingRecipe>();
|
||||
for (net.minecraftforge.common.brewing.IBrewingRecipe rec : BrewingRecipeRegistry.getRecipes()) {
|
||||
if (rec instanceof net.minecraftforge.common.brewing.AbstractBrewingRecipe) {
|
||||
AbstractBrewingRecipe abs = (AbstractBrewingRecipe) rec;
|
||||
if (abs instanceof BrewingOreRecipe) {
|
||||
BrewingOreRecipe brew = (BrewingOreRecipe) abs;
|
||||
ret.add(new BrewingRecipe(new MCItemStack(brew.getOutput()), new MCItemStack(brew.getInput()), convert(brew.getIngredient())));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(IItemStack output) {
|
||||
// if (output == null)
|
||||
// throw new IllegalArgumentException("output cannot be null");
|
||||
//
|
||||
// for(net.minecraftforge.common.brewing.IBrewingRecipe recipe : BrewingRecipeRegistry.getRecipes()){
|
||||
// if(recipe.is)
|
||||
// }
|
||||
// Map<ItemStack, ItemStack> smeltingList = FurnaceRecipes.instance().getSmeltingList();
|
||||
//
|
||||
// List<ItemStack> toRemove = new ArrayList<ItemStack>();
|
||||
// List<ItemStack> toRemoveValues = new ArrayList<ItemStack>();
|
||||
// for (Map.Entry<ItemStack, ItemStack> entry : smeltingList.entrySet()) {
|
||||
// if (output.matches(new MCItemStack(entry.getValue())) && (input == null || input.matches(new MCItemStack(entry.getKey())))) {
|
||||
// toRemove.add(entry.getKey());
|
||||
// toRemoveValues.add(entry.getValue());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (toRemove.isEmpty()) {
|
||||
// MineTweakerAPI.logWarning("No furnace recipes for " + output.toString());
|
||||
// } else {
|
||||
// MineTweakerAPI.apply(new MCFurnaceManager.RemoveAction(toRemove, toRemoveValues));
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(IItemStack output, IItemStack ingredient, IItemStack input) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(IItemStack output, IItemStack ingredients) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private IngredientOr convert(List<ItemStack> ingredients) {
|
||||
IngredientOr ing;
|
||||
List<IngredientItem> stacks = new ArrayList<IngredientItem>();
|
||||
|
||||
for (ItemStack stack : ingredients) {
|
||||
stacks.add(new IngredientItem(new MCItemStack(stack), null, ArrayUtil.EMPTY_CONDITIONS, ArrayUtil.EMPTY_TRANSFORMERS));
|
||||
}
|
||||
ing = new IngredientOr((IngredientItem[]) ingredients.toArray());
|
||||
|
||||
return ing;
|
||||
}
|
||||
}
|
||||
@@ -50,8 +50,8 @@ public class MCGame implements IGame{
|
||||
@Override
|
||||
public List<IItemDefinition> getItems(){
|
||||
List<IItemDefinition> result = new ArrayList<IItemDefinition>();
|
||||
for(ResourceLocation item : (Set<ResourceLocation>) Item.itemRegistry.getKeys()){
|
||||
result.add(new MCItemDefinition(item.toString(), Item.itemRegistry.getObject(item)));
|
||||
for(ResourceLocation item : (Set<ResourceLocation>) Item.REGISTRY.getKeys()){
|
||||
result.add(new MCItemDefinition(item.toString(), Item.REGISTRY.getObject(item)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -59,8 +59,8 @@ public class MCGame implements IGame{
|
||||
@Override
|
||||
public List<IBlockDefinition> getBlocks(){
|
||||
List<IBlockDefinition> result = new ArrayList<IBlockDefinition>();
|
||||
for(ResourceLocation block : (Set<ResourceLocation>) Block.blockRegistry.getKeys()){
|
||||
result.add(MineTweakerMC.getBlockDefinition(Block.blockRegistry.getObject(block)));
|
||||
for(ResourceLocation block : (Set<ResourceLocation>) Block.REGISTRY.getKeys()){
|
||||
result.add(MineTweakerMC.getBlockDefinition(Block.REGISTRY.getObject(block)));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -78,7 +78,7 @@ public class MCItemStack implements IItemStack{
|
||||
|
||||
@Override
|
||||
public IItemDefinition getDefinition(){
|
||||
return new MCItemDefinition(Item.itemRegistry.getNameForObject(stack.getItem()).toString(), stack.getItem());
|
||||
return new MCItemDefinition(Item.REGISTRY.getNameForObject(stack.getItem()).toString(), stack.getItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -316,8 +316,8 @@ public class MCItemStack implements IItemStack{
|
||||
|
||||
@Override
|
||||
public IBlock asBlock(){
|
||||
ResourceLocation name = Block.blockRegistry.getNameForObject(Block.getBlockFromItem(stack.getItem()));
|
||||
if(Block.blockRegistry.containsKey(name)){
|
||||
ResourceLocation name = Block.REGISTRY.getNameForObject(Block.getBlockFromItem(stack.getItem()));
|
||||
if(Block.REGISTRY.containsKey(name)){
|
||||
return new MCItemBlock(stack);
|
||||
}else{
|
||||
throw new ClassCastException("This item is not a block");
|
||||
@@ -379,7 +379,7 @@ public class MCItemStack implements IItemStack{
|
||||
public String toString(){
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.append('<');
|
||||
result.append(Item.itemRegistry.getNameForObject(stack.getItem()));
|
||||
result.append(Item.REGISTRY.getNameForObject(stack.getItem()));
|
||||
|
||||
if(stack.getItemDamage() == OreDictionary.WILDCARD_VALUE){
|
||||
result.append(":*");
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package minetweaker.mc19.recipes;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
|
||||
@@ -14,26 +14,28 @@
|
||||
//import minetweaker.api.vanilla.ILootRegistry;
|
||||
//import minetweaker.api.vanilla.LootEntry;
|
||||
//import minetweaker.mc19.util.MineTweakerHacks;
|
||||
//import net.minecraft.util.WeightedRandomChestContent;
|
||||
//import net.minecraftforge.common.ChestGenHooks;
|
||||
//import net.minecraft.item.ItemStack;
|
||||
//import net.minecraft.world.storage.loot.LootEntryItem;
|
||||
//import net.minecraft.world.storage.loot.functions.LootFunction;
|
||||
//import net.minecraft.world.storage.loot.functions.LootFunctionManager;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//import java.util.Map;
|
||||
//import java.util.Set;
|
||||
//import java.util.*;
|
||||
//
|
||||
///**
|
||||
// * @author Stan
|
||||
// */
|
||||
//public class MCLootRegistry implements ILootRegistry{
|
||||
//// private static final Map<String, ChestGenHooks> LOOT = MineTweakerHacks.getChestLoot();
|
||||
// private static final Map<String, List<ItemStack>> LOOT = new HashMap<String, List<ItemStack>>();
|
||||
//
|
||||
// @Override
|
||||
// public void addChestLoot(String type, WeightedItemStack item){
|
||||
// WeightedRandomChestContent content = new WeightedRandomChestContent(MineTweakerMC.getItemStack(item.getStack()), 1, 1, (int) item.getChance());
|
||||
// LootEntryItem content = new LootEntryItem(MineTweakerMC.getItemStack(item.getStack()).getItem(), 1, 1, (int) item.getChance());
|
||||
// WeightedItemStack sta = new WeightedItemStack();
|
||||
// MineTweakerAPI.apply(new AddLootAction(type, content));
|
||||
// LootFunctionManager.getSerializerFor()
|
||||
// }
|
||||
//
|
||||
// //addEntry(new LootEntryItem(ITEM, WEIGHT, QUALITY, FUNCTIONS, CONDITIONS, NAME));
|
||||
// @Override
|
||||
// public void addChestLoot(String type, WeightedItemStack item, int min, int max){
|
||||
// WeightedRandomChestContent content = new WeightedRandomChestContent(MineTweakerMC.getItemStack(item.getStack()), min, max, (int) item.getChance());
|
||||
|
||||
@@ -7,15 +7,15 @@
|
||||
package minetweaker.mc19.world;
|
||||
|
||||
import minetweaker.api.world.IBiome;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
|
||||
/**
|
||||
* @author Stan
|
||||
*/
|
||||
public class MCBiome implements IBiome{
|
||||
private final BiomeGenBase biome;
|
||||
private final Biome biome;
|
||||
|
||||
public MCBiome(BiomeGenBase biome){
|
||||
public MCBiome(Biome biome){
|
||||
this.biome = biome;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ buildscript {
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
@@ -25,7 +25,7 @@ archivesBaseName = project.projectDir.name
|
||||
minecraft {
|
||||
version = forgeVersion19
|
||||
runDir = "eclipse"
|
||||
mappings = "snapshot_20160312"
|
||||
mappings = "snapshot_20160518"
|
||||
useDepAts = true
|
||||
}
|
||||
repositories {
|
||||
@@ -38,7 +38,7 @@ dependencies {
|
||||
compile project(':ZenScript')
|
||||
compile project(':MineTweaker3-API')
|
||||
compile project(':MineTweaker3-MC19-Main')
|
||||
deobfCompile "mezz.jei:jei_1.9:3.2.10.185"
|
||||
deobfCompile "mezz.jei:jei_1.9.4:3.4.0.204"
|
||||
}
|
||||
|
||||
task makeRegistry(type: RegisterZenClassesTask) {
|
||||
|
||||
+3
-42
@@ -47,7 +47,7 @@ task assembleMC19(type: Jar, dependsOn: [\
|
||||
':ZenScript:build',
|
||||
':MineTweaker3-API:build']
|
||||
+ projects19.collect { ':' + it + ":build" }) {
|
||||
archiveName="CraftTweaker-1.9-${mineTweakerVersion}.jar"
|
||||
archiveName="CraftTweaker-1.9.4-${mineTweakerVersion}.jar"
|
||||
|
||||
from zipTree(project(":ZenScript").jar.archivePath)
|
||||
from zipTree(project(':MineTweaker3-API').jar.archivePath)
|
||||
@@ -83,7 +83,7 @@ task assembleDevBase19(type: Jar, dependsOn: [
|
||||
':ZenScript:build',
|
||||
':MineTweaker3-API:build',
|
||||
':MineTweaker3-MC19-Main:build']) {
|
||||
archiveName="CraftTweaker-Dev-1.9-${mineTweakerVersion}.jar"
|
||||
archiveName="CraftTweaker-Dev-1.9.4-${mineTweakerVersion}.jar"
|
||||
|
||||
from project(':ZenScript').sourceSets.main.output
|
||||
from project(':MineTweaker3-API').sourceSets.main.output
|
||||
@@ -123,7 +123,7 @@ task assembleDevFull19(type: Jar, dependsOn: [
|
||||
':ZenScript:build',
|
||||
':MineTweaker3-API:build']
|
||||
+ projects19.collect { ':' + it + ":build" }) {
|
||||
archiveName="CraftTweaker-Dev-Full-1.9-${mineTweakerVersion}.jar"
|
||||
archiveName="CraftTweaker-Dev-Full-1.9.4-${mineTweakerVersion}.jar"
|
||||
|
||||
from project(':ZenScript').sourceSets.main.output
|
||||
from project(':MineTweaker3-API').sourceSets.main.output
|
||||
@@ -149,44 +149,5 @@ configurations {
|
||||
deployerJars
|
||||
}
|
||||
|
||||
dependencies {
|
||||
deployerJars 'org.apache.maven.wagon:wagon-ftp:2.2'
|
||||
}
|
||||
|
||||
apply plugin: 'maven'
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
configuration = configurations.deployerJars
|
||||
repository(url: "ftp://maven2.aktheknight.co.uk/public_html/maven2") {
|
||||
authentication(userName: mavenUser, password: mavenPass)
|
||||
}
|
||||
pom {
|
||||
groupId = "us.getfluxed.crafttweaker"
|
||||
version = project.version
|
||||
artifactId = project.archivesBaseName
|
||||
project {
|
||||
name project.archivesBaseName
|
||||
packaging 'jar'
|
||||
description 'CraftTweaker'
|
||||
url 'https://github.com/jaredlll08/CraftTweaker'
|
||||
scm {
|
||||
url 'https://github.com/jaredlll08/CraftTweaker'
|
||||
connection 'scm:git:[email protected]:jaredlll08/CraftTweaker.git'
|
||||
developerConnection 'scm:git:[email protected]:jaredlll08/CraftTweaker.git'
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id 'Jaredlll08'
|
||||
name 'Jaredlll08'
|
||||
roles { role 'developer' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@ import javax.tools.ToolProvider
|
||||
// ### Global settings ###
|
||||
// #######################
|
||||
|
||||
ext.mineTweakerVersion = "3.0.7"
|
||||
ext.mineTweakerVersion = "3.0.9"
|
||||
if (System.getenv('BUILD_NUMBER') != null)
|
||||
project.mineTweakerVersion += "."+System.getenv('BUILD_NUMBER')
|
||||
else {
|
||||
try {
|
||||
ext.mineTweakerVersion += "." + "git rev-parse --abbrev-ref HEAD".execute().text.trim();
|
||||
ext.mineTweakerVersion += "." + "git rev-parse --short HEAD".execute().text.trim();
|
||||
//ext.mineTweakerVersion += "." + "git rev-parse --abbrev-ref HEAD".execute().text.trim();
|
||||
//ext.mineTweakerVersion += "." + "git rev-parse --short HEAD".execute().text.trim();
|
||||
} catch (all) {}
|
||||
logger.lifecycle "No build number detected, setting to ${ext.mineTweakerVersion}"
|
||||
}
|
||||
@@ -46,7 +46,7 @@ ext.projects18 = [
|
||||
// ### 1.9 settings ###
|
||||
// ####################
|
||||
|
||||
ext.forgeVersion19 = "1.9-12.16.1.1892"
|
||||
ext.forgeVersion19 = "1.9.4-12.17.0.1910-1.9.4"
|
||||
ext.projects19 = [
|
||||
'MineTweaker3-MC19-Main',
|
||||
'MineTweaker3-MC19-Mod-JEI'
|
||||
|
||||
Reference in new issue
Block a user