More config changes
This commit is contained in:
parent
0cf3e43992
commit
b7e141e004
13 changed files with 68 additions and 254 deletions
|
@ -53,7 +53,6 @@ import techreborn.config.ConfigTechReborn;
|
|||
import techreborn.dispenser.BehaviorDispenseScrapbox;
|
||||
import techreborn.entities.EntityNukePrimed;
|
||||
import techreborn.events.BlockBreakHandler;
|
||||
import techreborn.events.OreUnifier;
|
||||
import techreborn.events.TRTickHandler;
|
||||
import techreborn.init.*;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
@ -169,10 +168,9 @@ public class Core {
|
|||
MinecraftForge.EVENT_BUS.register(IDSUManager.INSTANCE);
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new TRTickHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new OreUnifier());
|
||||
//MinecraftForge.EVENT_BUS.register(worldGen.retroGen);
|
||||
// Scrapbox
|
||||
if (config.ScrapboxDispenser) {
|
||||
if (BehaviorDispenseScrapbox.dispenseScrapboxes) {
|
||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.SCRAP_BOX, new BehaviorDispenseScrapbox());
|
||||
}
|
||||
logHelper.info("Initialization Complete");
|
||||
|
|
|
@ -42,23 +42,29 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.common.blocks.PropertyString;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.ArrayUtils;
|
||||
import reborncore.common.util.OreDrop;
|
||||
import reborncore.common.util.OreDropSet;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.items.ItemGems;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.world.config.IOreNameProvider;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class BlockOre extends Block implements IOreNameProvider {
|
||||
|
||||
@ConfigRegistry(category = "blocks", key = "secondaryDropChance", comment = "Secondary Gem drop chance")
|
||||
public static double secondaryDropChance = 0.5;
|
||||
|
||||
public static final String[] ores = new String[] {
|
||||
"galena", "iridium", "ruby", "sapphire", "bauxite", "pyrite",
|
||||
"cinnabar", "sphalerite", "tungsten", "sheldonite", "peridot", "sodalite",
|
||||
|
@ -112,7 +118,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
// Ruby
|
||||
if (variant.equalsIgnoreCase("Ruby")) {
|
||||
OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
secondaryDropChance);
|
||||
OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("red_garnet"), 0.02);
|
||||
OreDropSet set = new OreDropSet(ruby);
|
||||
return set.drop(fortune, random);
|
||||
|
@ -121,7 +127,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
// Sapphire
|
||||
if (variant.equalsIgnoreCase("Sapphire")) {
|
||||
OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
secondaryDropChance);
|
||||
OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), 0.03);
|
||||
OreDropSet set = new OreDropSet(sapphire, peridot);
|
||||
return set.drop(fortune, random);
|
||||
|
@ -130,7 +136,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
// Pyrite
|
||||
if (variant.equalsIgnoreCase("Pyrite")) {
|
||||
OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
secondaryDropChance);
|
||||
OreDropSet set = new OreDropSet(pyriteDust);
|
||||
return set.drop(fortune, random);
|
||||
}
|
||||
|
@ -138,7 +144,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
// Sodalite
|
||||
if (variant.equalsIgnoreCase("Sodalite")) {
|
||||
OreDrop sodalite = new OreDrop(ItemDusts.getDustByName("sodalite", 6),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
secondaryDropChance);
|
||||
OreDrop aluminum = new OreDrop(ItemDusts.getDustByName("aluminum"), 0.50);
|
||||
OreDropSet set = new OreDropSet(sodalite, aluminum);
|
||||
return set.drop(fortune, random);
|
||||
|
@ -147,7 +153,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
// Cinnabar
|
||||
if (variant.equalsIgnoreCase("Cinnabar")) {
|
||||
OreDrop cinnabar = new OreDrop(ItemDusts.getDustByName("cinnabar"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
secondaryDropChance);
|
||||
OreDrop redstone = new OreDrop(new ItemStack(Items.REDSTONE), 0.25);
|
||||
OreDropSet set = new OreDropSet(cinnabar, redstone);
|
||||
return set.drop(fortune, random);
|
||||
|
@ -156,7 +162,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
// Sphalerite 1, 1/8 yellow garnet
|
||||
if (variant.equalsIgnoreCase("Sphalerite")) {
|
||||
OreDrop sphalerite = new OreDrop(ItemDusts.getDustByName("sphalerite"),
|
||||
ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
|
||||
secondaryDropChance);
|
||||
OreDrop yellowGarnet = new OreDrop(ItemGems.getGemByName("yellowGarnet"), 0.125);
|
||||
OreDropSet set = new OreDropSet(sphalerite, yellowGarnet);
|
||||
return set.drop(fortune, random);
|
||||
|
|
|
@ -79,7 +79,7 @@ import techreborn.compat.jei.scrapbox.ScrapboxRecipeCategory;
|
|||
import techreborn.compat.jei.scrapbox.ScrapboxRecipeHandler;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeCategory;
|
||||
import techreborn.compat.jei.vacuumFreezer.VacuumFreezerRecipeHandler;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.dispenser.BehaviorDispenseScrapbox;
|
||||
import techreborn.init.IC2Duplicates;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
|
@ -226,7 +226,7 @@ public class TechRebornJeiPlugin extends BlankModPlugin {
|
|||
|
||||
registry.addDescription(ItemParts.getPartByName("rubberSap"),
|
||||
I18n.translateToLocal("techreborn.desc.rubberSap"));
|
||||
if (!ConfigTechReborn.ScrapboxDispenser) {
|
||||
if (!BehaviorDispenseScrapbox.dispenseScrapboxes) {
|
||||
registry.addDescription(new ItemStack(ModItems.SCRAP_BOX),
|
||||
I18n.translateToLocal("techreborn.desc.scrapBoxNoDispenser"));
|
||||
} else {
|
||||
|
|
|
@ -25,9 +25,13 @@
|
|||
package techreborn.config;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class ConfigTechReborn {
|
||||
public static String CATEGORY_WORLD = "world";
|
||||
public static String CATEGORY_POWER = "power";
|
||||
|
@ -37,24 +41,8 @@ public class ConfigTechReborn {
|
|||
public static String CATEGORY_INTEGRATION = "Integration";
|
||||
public static String CATEGORY_FEATURES = "Features";
|
||||
|
||||
public static double FortuneSecondaryOreMultiplierPerLevel;
|
||||
public static boolean RubberSaplingLoot;
|
||||
public static boolean TinIngotsLoot;
|
||||
public static boolean CopperIngotsLoot;
|
||||
public static boolean SteelIngotsLoot;
|
||||
public static boolean UninsulatedElectocutionSound;
|
||||
public static boolean UninsulatedElectocutionParticle;
|
||||
public static boolean UninsulatedElectocutionDamage;
|
||||
public static boolean ScrapboxDispenser;
|
||||
public static boolean disableRailcraftSteelNuggetRecipe;
|
||||
// Power
|
||||
|
||||
public static int LVTransformerMaxInput;
|
||||
public static int LVTransformerMaxOutput;
|
||||
public static int MVTransformerMaxInput;
|
||||
public static int MVTransformerMaxOutput;
|
||||
public static int HVTransformerMaxInput;
|
||||
public static int HVTransformerMaxOutput;
|
||||
@ConfigRegistry(config = "recipes", category = "railcraft", key = "disableRailcraftNugget", comment = "When true TechReborn will remove Railcrafts Iron Nugget to steel nuggert recipe.")
|
||||
public static boolean disableRailcraftSteelNuggetRecipe = false;
|
||||
// Charge
|
||||
public static int IronDrillCharge;
|
||||
public static int DiamondDrillCharge;
|
||||
|
@ -74,20 +62,9 @@ public class ConfigTechReborn {
|
|||
public static int CentrifugeCharge;
|
||||
public static int ThermalGeneratorCharge;
|
||||
|
||||
public static boolean FreqTransmitterChat;
|
||||
public static boolean FreqTransmitterTooltip;
|
||||
public static boolean NanosaberChat;
|
||||
// EU/T
|
||||
public static int CloakingDeviceEUTick;
|
||||
// Crafting
|
||||
public static boolean ExpensiveMacerator;
|
||||
public static boolean ExpensiveDrill;
|
||||
public static boolean ExpensiveDiamondDrill;
|
||||
public static boolean ExpensiveSolar;
|
||||
public static boolean ExpensiveWatermill;
|
||||
public static boolean ExpensiveWindmill;
|
||||
public static boolean REMOVE_DUPLICATES;
|
||||
public static boolean ExpensiveQuarry;
|
||||
@ConfigRegistry(config = "recipes", category = "ic2", key = "deduplicate", comment = "Changes a lot of reipes and hides blocks to intrgrade TechReborn into IC2")
|
||||
public static boolean REMOVE_DUPLICATES = false;
|
||||
// Client
|
||||
public static boolean ShowChargeHud;
|
||||
|
||||
|
@ -125,38 +102,6 @@ public class ConfigTechReborn {
|
|||
}
|
||||
|
||||
public static void Configs() {
|
||||
RubberSaplingLoot = config
|
||||
.get(CATEGORY_WORLD, "Rubber Sapling Loot", true, "Allow Rubber Saplings to generate in loot chests")
|
||||
.getBoolean(true);
|
||||
|
||||
CopperIngotsLoot = config
|
||||
.get(CATEGORY_WORLD, "Copper Ingots Loot", true, "Allow Copper Ingots to generate in loot chests")
|
||||
.getBoolean(true);
|
||||
|
||||
TinIngotsLoot = config
|
||||
.get(CATEGORY_WORLD, "Tin Ingots Loot", true, "Allow Tin Ingots to generate in loot chests")
|
||||
.getBoolean(true);
|
||||
|
||||
SteelIngotsLoot = config
|
||||
.get(CATEGORY_WORLD, "Steel Ingots Loot", true, "Allow Steel Ingots to generate in loot chests")
|
||||
.getBoolean(true);
|
||||
|
||||
FortuneSecondaryOreMultiplierPerLevel = config.get(CATEGORY_WORLD, "FortuneSecondaryOreMultiplierPerLevel", 0.5,
|
||||
"FortuneSecondaryOreMultiplierPerLevel").getDouble();
|
||||
|
||||
//Transformers
|
||||
LVTransformerMaxInput = config.get(CATEGORY_POWER, "LV Transformer Max Input", 128, "Set the max input for the LV Trasnformer")
|
||||
.getInt();
|
||||
LVTransformerMaxOutput = config.get(CATEGORY_POWER, "LV Transformer Max Output", 32, "Set the max output for the LV Trasnformer")
|
||||
.getInt();
|
||||
MVTransformerMaxInput = config.get(CATEGORY_POWER, "MV Transformer Max Input", 512, "Set the max input for the MV Trasnformer")
|
||||
.getInt();
|
||||
MVTransformerMaxOutput = config.get(CATEGORY_POWER, "MV Transformer Max Output", 128, "Set the max output for the MV Trasnformer")
|
||||
.getInt();
|
||||
HVTransformerMaxInput = config.get(CATEGORY_POWER, "HV Transformer Max Input", 2048, "Set the max input for the HV Trasnformer")
|
||||
.getInt();
|
||||
HVTransformerMaxOutput = config.get(CATEGORY_POWER, "HV Transformer Max Output", 512, "Set the max output for the HV Trasnformer")
|
||||
.getInt();
|
||||
|
||||
// Charge
|
||||
IronDrillCharge = config
|
||||
|
@ -219,71 +164,12 @@ public class ConfigTechReborn {
|
|||
ThermalGeneratorCharge = config.get(CATEGORY_POWER, "ThermalGenerator MaxCharge", 1000000,
|
||||
"Set the max charge for the ThermalGenerator").getInt();
|
||||
|
||||
//Features
|
||||
FreqTransmitterChat = config
|
||||
.get(CATEGORY_FEATURES, "Frequency Transmitter Chat messages", true, "Allow Frequency Transmitter chat messages")
|
||||
.getBoolean(true);
|
||||
|
||||
FreqTransmitterTooltip = config
|
||||
.get(CATEGORY_FEATURES, "Frequency Transmitter tooltips", true, "Allow Frequency Transmitter to display tooltip info")
|
||||
.getBoolean(true);
|
||||
|
||||
NanosaberChat = config
|
||||
.get(CATEGORY_FEATURES, "Nanosaber Chat messages", true, "Allow Nanosaber chat messages")
|
||||
.getBoolean(true);
|
||||
|
||||
enableGemArmorAndTools = config.get(CATEGORY_FEATURES, "Gem tools and armor", true, "Should the gem tools and armor be added to the game").getBoolean(true);
|
||||
|
||||
// Crafting
|
||||
ExpensiveMacerator = config
|
||||
.get(CATEGORY_CRAFTING, "Expensive Macerator", true, "Allow TechReborn to change the Macerator recipe")
|
||||
.getBoolean(true);
|
||||
|
||||
ExpensiveDrill = config
|
||||
.get(CATEGORY_CRAFTING, "Expensive Drill", true, "Allow TechReborn to change the Drill recipe")
|
||||
.getBoolean(true);
|
||||
|
||||
ExpensiveDiamondDrill = config.get(CATEGORY_CRAFTING, "Expensive DiamondDrill", true,
|
||||
"Allow TechReborn to change the DiamondDrill recipe").getBoolean(true);
|
||||
|
||||
ExpensiveSolar = config.get(CATEGORY_CRAFTING, "Expensive Solarpanels", true,
|
||||
"Allow TechReborn to change the Solarpanels recipe").getBoolean(true);
|
||||
|
||||
ExpensiveWatermill = config
|
||||
.get(CATEGORY_CRAFTING, "Expensive Watermill", true, "Allow TechReborn to change the Watermill recipe")
|
||||
.getBoolean(true);
|
||||
|
||||
ExpensiveWindmill = config
|
||||
.get(CATEGORY_CRAFTING, "Expensive Windmill", true, "Allow TechReborn to change the Windmill recipe")
|
||||
.getBoolean(true);
|
||||
|
||||
REMOVE_DUPLICATES = config
|
||||
.get(CATEGORY_CRAFTING, "Remove Duplicates when IC2 is installed", false, "This attempts to fully integrate TR with ic2 recipes (Beta)")
|
||||
.getBoolean(false);
|
||||
|
||||
ExpensiveQuarry = config
|
||||
.get(CATEGORY_CRAFTING, "Expensive Buildcraft quarry", true, "Change the buildcraft quarry recipe to require the diamond drill")
|
||||
.getBoolean(true);
|
||||
|
||||
disableRailcraftSteelNuggetRecipe = config.get(CATEGORY_CRAFTING, "Disable Railcraft's Steel nugget recipe", false, "When true TechReborn will remove Railcrafts Iron Nugget to steel nuggert recipe.").getBoolean(false);
|
||||
|
||||
ShowChargeHud = config.get(CATEGORY_POWER, "Show Charge hud", true, "Show Charge hud (ClientSideOnly)")
|
||||
.getBoolean(true);
|
||||
|
||||
UninsulatedElectocutionDamage = config.get(CATEGORY_WORLD, "Uninsulated Electrocution Damage", true,
|
||||
"Damage entities on contact with uninsulated cables").getBoolean(true);
|
||||
UninsulatedElectocutionSound = config.get(CATEGORY_WORLD, "Uninsulated Electrocution Sound", true,
|
||||
"Play sound on contact with uninsulated cables").getBoolean(true);
|
||||
UninsulatedElectocutionParticle = config.get(CATEGORY_WORLD, "Uninsulated Electrocution Particle", true,
|
||||
"Spawn particles on contact with uninsulated cables").getBoolean(true);
|
||||
|
||||
ScrapboxDispenser = config
|
||||
.get(CATEGORY_WORLD, "Scrapboxes in Dispenser", true, "Allow scrapboxes to be opened via dispenser")
|
||||
.getBoolean(true);
|
||||
|
||||
ExpensiveWatermill = config
|
||||
.get(CATEGORY_CRAFTING, "Expensive Watermill", true, "Allow TechReborn to change the Watermill recipe")
|
||||
.getBoolean(true);
|
||||
|
||||
if (config.hasChanged()) {
|
||||
config.save();
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.events;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class OreUnifier {
|
||||
|
||||
@ConfigRegistry(config = "misc", category = "general", key = "OreUnifier", comment = "Convert any ore itemstacks into Tech Reborn ores")
|
||||
public static boolean oreUnifier = false;
|
||||
|
||||
public static HashMap<String, ItemStack> oreHash = new HashMap<>();
|
||||
|
||||
public static void registerOre(String name, ItemStack ore) {
|
||||
oreHash.put(name, ore);
|
||||
OreDictionary.registerOre(name, ore);
|
||||
}
|
||||
|
||||
public static void registerOre(String name, Item ore) {
|
||||
registerOre(name, new ItemStack(ore));
|
||||
}
|
||||
|
||||
public static void registerOre(String name, Block ore) {
|
||||
registerOre(name, new ItemStack(ore));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void itemTick(TickEvent.PlayerTickEvent event) {
|
||||
if (oreUnifier && !event.player.world.isRemote
|
||||
&& event.player.world.getTotalWorldTime() % 10 == 0) {
|
||||
if (event.player.getHeldItem(EnumHand.MAIN_HAND) != ItemStack.EMPTY) {
|
||||
int[] oreIds = OreDictionary.getOreIDs(event.player.getHeldItem(EnumHand.MAIN_HAND));
|
||||
for (int id : oreIds) {
|
||||
String oreName = OreDictionary.getOreName(id);
|
||||
if (oreHash.containsKey(oreName)) {
|
||||
if (ItemUtils.isItemEqual(event.player.getHeldItem(EnumHand.MAIN_HAND), oreHash.get(oreName),
|
||||
true, true, true)
|
||||
&& !ItemUtils.isItemEqual(event.player.getHeldItem(EnumHand.MAIN_HAND),
|
||||
oreHash.get(oreName), true, true, false)) {
|
||||
ItemStack stack = oreHash.get(oreName).copy();
|
||||
stack.setCount(event.player.getHeldItem(EnumHand.MAIN_HAND).getCount());
|
||||
stack.setTagCompound(event.player.getHeldItem(EnumHand.MAIN_HAND).getTagCompound());
|
||||
event.player.inventory.setInventorySlotContents(event.player.inventory.currentItem, stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -34,6 +34,8 @@ import net.minecraftforge.fluids.UniversalBucket;
|
|||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.CraftingHelper;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import reborncore.common.util.OreUtil;
|
||||
|
@ -48,6 +50,7 @@ import techreborn.compat.CompatManager;
|
|||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.recipes.*;
|
||||
import techreborn.items.*;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
@ -57,8 +60,14 @@ import static techreborn.utils.OreDictUtils.getDictOreOrEmpty;
|
|||
import static techreborn.utils.OreDictUtils.isDictPrefixed;
|
||||
import static techreborn.utils.OreDictUtils.joinDictName;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class ModRecipes {
|
||||
public static ConfigTechReborn config;
|
||||
|
||||
@ConfigRegistry(config = "recipes", category = "changes", key = "expesive_macerator", comment = "Enable the expensive macertor recipe")
|
||||
public static boolean expensiveMacerator = false;
|
||||
|
||||
@ConfigRegistry(config = "recipes", category = "changes", key = "expesive_solar", comment = "Enable the expensive solar panel recipe")
|
||||
public static boolean expensiveSolar = false;
|
||||
|
||||
public static void init() {
|
||||
//Gonna rescan to make sure we have an uptodate list
|
||||
|
@ -936,13 +945,13 @@ public class ModRecipes {
|
|||
ItemCells.getCellByName("empty"), ItemCells.getCellByName("nitrogenDioxide", 2), 1240,
|
||||
30));
|
||||
|
||||
if (ConfigTechReborn.ExpensiveMacerator && !IC2Duplicates.deduplicate())
|
||||
if (expensiveMacerator && !IC2Duplicates.deduplicate())
|
||||
CraftingHelper
|
||||
.addShapedOreRecipe(getOre("ic2Macerator"), "FDF", "DMD", "FCF", 'F',
|
||||
Items.FLINT, 'D', Items.DIAMOND, 'M', "machineBlockBasic", 'C',
|
||||
"circuitBasic");
|
||||
|
||||
if (ConfigTechReborn.ExpensiveSolar && !IC2Duplicates.deduplicate())
|
||||
if (expensiveSolar && !IC2Duplicates.deduplicate())
|
||||
CraftingHelper
|
||||
.addShapedOreRecipe(IC2Duplicates.SOLAR_PANEL.getStackBasedOnConfig(), "PPP", "SZS", "CGC", 'P',
|
||||
"paneGlass", 'S', "platelazurite", 'Z',
|
||||
|
|
|
@ -42,7 +42,6 @@ import reborncore.client.hud.StackInfoElement;
|
|||
import reborncore.common.util.ChatUtils;
|
||||
import reborncore.common.util.Color;
|
||||
import techreborn.client.TechRebornCreativeTabMisc;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.lib.MessageIDs;
|
||||
|
||||
|
@ -80,7 +79,7 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
|||
stack.getTagCompound().setInteger("z", pos.getZ());
|
||||
stack.getTagCompound().setInteger("dim", world.provider.getDimension());
|
||||
|
||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
||||
if (!world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " +
|
||||
TextFormatting.GOLD + pos.getX() +
|
||||
|
@ -101,7 +100,7 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
|||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (player.isSneaking()) {
|
||||
stack.setTagCompound(null);
|
||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
||||
if (!world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.coordsHaveBeen") + " "
|
||||
+ TextFormatting.GOLD + I18n.translateToLocal("techreborn.message.cleared")));
|
||||
|
@ -112,21 +111,19 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
|||
}
|
||||
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
|
||||
if (ConfigTechReborn.FreqTransmitterTooltip) {
|
||||
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
int x = stack.getTagCompound().getInteger("x");
|
||||
int y = stack.getTagCompound().getInteger("y");
|
||||
int z = stack.getTagCompound().getInteger("z");
|
||||
int dim = stack.getTagCompound().getInteger("dim");
|
||||
if (stack.hasTagCompound() && stack.getTagCompound() != null && stack.getTagCompound().hasKey("x") && stack.getTagCompound().hasKey("y") && stack.getTagCompound().hasKey("z") && stack.getTagCompound().hasKey("dim")) {
|
||||
int x = stack.getTagCompound().getInteger("x");
|
||||
int y = stack.getTagCompound().getInteger("y");
|
||||
int z = stack.getTagCompound().getInteger("z");
|
||||
int dim = stack.getTagCompound().getInteger("dim");
|
||||
|
||||
list.add(TextFormatting.GRAY + "X: " + TextFormatting.GOLD + x);
|
||||
list.add(TextFormatting.GRAY + "Y: " + TextFormatting.GOLD + y);
|
||||
list.add(TextFormatting.GRAY + "Z: " + TextFormatting.GOLD + z);
|
||||
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||
list.add(TextFormatting.GRAY + "X: " + TextFormatting.GOLD + x);
|
||||
list.add(TextFormatting.GRAY + "Y: " + TextFormatting.GOLD + y);
|
||||
list.add(TextFormatting.GRAY + "Z: " + TextFormatting.GOLD + z);
|
||||
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||
|
||||
} else {
|
||||
list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.noCoordsSet"));
|
||||
}
|
||||
} else {
|
||||
list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.noCoordsSet"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,12 +35,20 @@ import net.minecraftforge.fml.relauncher.Side;
|
|||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.api.power.IEnergyItemInfo;
|
||||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemTRNoDestroy;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class ItemCloakingDevice extends ItemTRNoDestroy implements IEnergyItemInfo {
|
||||
|
||||
@ConfigRegistry(config = "items", category = "cloacking_device", key = "ClockingDeviceEnergyUsage", comment = "Cloacking device energy usesage (Value in EU)")
|
||||
public static int usage = 10;
|
||||
|
||||
public static int MaxCharge = ConfigTechReborn.CloakingDeviceCharge;
|
||||
public static int Limit = 100;
|
||||
public static boolean isActive;
|
||||
|
@ -54,8 +62,8 @@ public class ItemCloakingDevice extends ItemTRNoDestroy implements IEnergyItemIn
|
|||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
if (PoweredItem.canUseEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack)) {
|
||||
PoweredItem.useEnergy(ConfigTechReborn.CloakingDeviceEUTick, itemStack);
|
||||
if (PoweredItem.canUseEnergy(usage, itemStack)) {
|
||||
PoweredItem.useEnergy(usage, itemStack);
|
||||
player.setInvisible(true);
|
||||
} else {
|
||||
if (!player.isPotionActive(MobEffects.INVISIBILITY)) {
|
||||
|
|
|
@ -48,7 +48,6 @@ import reborncore.api.power.IEnergyItemInfo;
|
|||
import reborncore.common.powerSystem.PoweredItem;
|
||||
import reborncore.common.util.ChatUtils;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.lib.MessageIDs;
|
||||
|
||||
|
@ -160,7 +159,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
|
|||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
stack.getTagCompound().setBoolean("isActive", true);
|
||||
if (world.isRemote && ConfigTechReborn.NanosaberChat) {
|
||||
if (world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
||||
+ TextFormatting.GOLD + I18n
|
||||
|
@ -168,7 +167,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
|
|||
}
|
||||
} else {
|
||||
stack.getTagCompound().setBoolean("isActive", false);
|
||||
if (world.isRemote && ConfigTechReborn.NanosaberChat) {
|
||||
if (world.isRemote) {
|
||||
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
||||
+ TextFormatting.GOLD + I18n
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.tiles.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +33,7 @@ import techreborn.init.ModBlocks;
|
|||
public class TileHVTransformer extends TileTransformer {
|
||||
|
||||
public TileHVTransformer() {
|
||||
super("HVTransformer", ModBlocks.HV_TRANSFORMER, EnumPowerTier.EXTREME, ConfigTechReborn.HVTransformerMaxInput, ConfigTechReborn.HVTransformerMaxOutput, ConfigTechReborn.HVTransformerMaxInput * 2);
|
||||
super("HVTransformer", ModBlocks.HV_TRANSFORMER, EnumPowerTier.EXTREME);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.tiles.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +33,7 @@ import techreborn.init.ModBlocks;
|
|||
public class TileLVTransformer extends TileTransformer {
|
||||
|
||||
public TileLVTransformer() {
|
||||
super("LVTransformer", ModBlocks.LV_TRANSFORMER, EnumPowerTier.LOW, ConfigTechReborn.LVTransformerMaxInput, ConfigTechReborn.LVTransformerMaxOutput, ConfigTechReborn.LVTransformerMaxInput * 2);
|
||||
super("LVTransformer", ModBlocks.LV_TRANSFORMER, EnumPowerTier.LOW);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
package techreborn.tiles.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +33,7 @@ import techreborn.init.ModBlocks;
|
|||
public class TileMVTransformer extends TileTransformer {
|
||||
|
||||
public TileMVTransformer() {
|
||||
super("MVTransformer", ModBlocks.MV_TRANSFORMER, EnumPowerTier.HIGH, ConfigTechReborn.MVTransformerMaxInput, ConfigTechReborn.MVTransformerMaxOutput, ConfigTechReborn.LVTransformerMaxInput * 2);
|
||||
super("MVTransformer", ModBlocks.MV_TRANSFORMER, EnumPowerTier.HIGH);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -46,14 +46,14 @@ public class TileTransformer extends TilePowerAcceptor implements IWrenchable, I
|
|||
public int maxOutput;
|
||||
public int maxStorage;
|
||||
|
||||
public TileTransformer(String name, Block wrenchDrop, EnumPowerTier tier, int maxInput, int maxOuput, int maxStorage) {
|
||||
public TileTransformer(String name, Block wrenchDrop, EnumPowerTier tier) {
|
||||
super(1);
|
||||
this.wrenchDrop = wrenchDrop;
|
||||
this.tier = tier;
|
||||
this.name = name;
|
||||
this.maxInput = maxInput;
|
||||
this.maxOutput = maxOuput;
|
||||
this.maxStorage = maxStorage;
|
||||
this.maxInput = tier.getMaxInput();
|
||||
this.maxOutput = tier.getMaxOutput();
|
||||
this.maxStorage = tier.getMaxInput() * 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue