mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-16 01:54:40 +00:00
Compare commits
3
Commits
4.9.15
..
4.9.13-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
255a71f3a1 | ||
|
|
66019fe027 | ||
|
|
5b2a65d2aa |
No files matched your search
+3
-3
@@ -2,9 +2,9 @@
|
||||
|
||||
dependencies {
|
||||
api('curse.maven:cofh-lib-220333:2388748')
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta4:api')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.33-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.6.2:api')
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta6:api')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.6.35-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:inventory-tweaks:1.7.0:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly('curse.maven:craftguide-75557:2459320')
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.26'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.ModAPIManager;
|
||||
@@ -80,15 +79,11 @@ public class Forestry {
|
||||
|
||||
public static PacketHandler packetHandler;
|
||||
|
||||
public static boolean isDreamcraftLoaded;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
checkForCoFHLib();
|
||||
packetHandler = new PacketHandler();
|
||||
|
||||
isDreamcraftLoaded = Loader.isModLoaded("dreamcraft");
|
||||
|
||||
// Register event handler
|
||||
EventHandlerCore eventHandlerCore = new EventHandlerCore();
|
||||
MinecraftForge.EVENT_BUS.register(eventHandlerCore);
|
||||
|
||||
@@ -65,6 +65,7 @@ import forestry.core.errors.EnumErrorCode;
|
||||
import forestry.core.genetics.Chromosome;
|
||||
import forestry.core.genetics.GenericRatings;
|
||||
import forestry.core.genetics.IndividualLiving;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.GeneticsUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.StringUtil;
|
||||
@@ -456,6 +457,21 @@ public class Bee extends IndividualLiving implements IBee {
|
||||
if (genome.getTolerantFlyer()) {
|
||||
list.add(EnumChatFormatting.WHITE + StringUtil.localize("gui.flyer.tooltip"));
|
||||
}
|
||||
|
||||
// Add lore and discovered by
|
||||
String descTokens[] = primary.getDescription().split("\\|");
|
||||
if (descTokens.length > 0) {
|
||||
String speciesLore = descTokens[0];
|
||||
if (!speciesLore.isEmpty() && Proxies.common.isCtrlDown()) {
|
||||
list.addAll(StringUtil.multilineStrings(speciesLore, 50));
|
||||
}
|
||||
}
|
||||
if (descTokens.length > 2) {
|
||||
String discoveredBy = descTokens[2];
|
||||
if (!discoveredBy.isEmpty()) {
|
||||
list.add("Discovered by " + discoveredBy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.items;
|
||||
|
||||
import static forestry.Forestry.isDreamcraftLoaded;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -89,26 +87,19 @@ public class ItemRegistryCore extends ItemRegistry {
|
||||
fertilizerBio = registerItem(new ItemForestry(), "fertilizerBio");
|
||||
fertilizerCompound = registerItem(new ItemForestryBonemeal(), "fertilizerCompound");
|
||||
|
||||
apatite = registerItem(new ItemForestry(), "apatite");
|
||||
OreDictionary.registerOre("gemApatite", apatite);
|
||||
|
||||
researchNote = registerItem(new ItemResearchNote(), "researchNote");
|
||||
|
||||
if (!isDreamcraftLoaded) {
|
||||
apatite = registerItem(new ItemForestry(), "apatite");
|
||||
OreDictionary.registerOre("gemApatite", apatite);
|
||||
ingotCopper = registerItem(new ItemForestry(), "ingotCopper");
|
||||
OreDictionary.registerOre("ingotCopper", ingotCopper);
|
||||
|
||||
ingotCopper = registerItem(new ItemForestry(), "ingotCopper");
|
||||
OreDictionary.registerOre("ingotCopper", ingotCopper);
|
||||
ingotTin = registerItem(new ItemForestry(), "ingotTin");
|
||||
OreDictionary.registerOre("ingotTin", ingotTin);
|
||||
|
||||
ingotTin = registerItem(new ItemForestry(), "ingotTin");
|
||||
OreDictionary.registerOre("ingotTin", ingotTin);
|
||||
|
||||
ingotBronze = registerItem(new ItemForestry(), "ingotBronze");
|
||||
OreDictionary.registerOre("ingotBronze", ingotBronze);
|
||||
} else {
|
||||
apatite = null;
|
||||
ingotCopper = null;
|
||||
ingotTin = null;
|
||||
ingotBronze = null;
|
||||
}
|
||||
ingotBronze = registerItem(new ItemForestry(), "ingotBronze");
|
||||
OreDictionary.registerOre("ingotBronze", ingotBronze);
|
||||
|
||||
wrench = registerItem(new ItemWrench(), "wrench");
|
||||
pipette = registerItem(new ItemPipette(), "pipette");
|
||||
|
||||
@@ -61,6 +61,10 @@ public class ProxyCommon {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isCtrlDown() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void playSoundFX(World world, int x, int y, int z, Block block) {
|
||||
Proxies.net.sendNetworkPacket(new PacketFXSignal(PacketFXSignal.SoundFXType.LEAF, x, y, z, block, 0), world);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,11 @@ public class ProxyCommonClient extends ProxyCommon {
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCtrlDown() {
|
||||
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisplayName(ItemStack itemstack) {
|
||||
return itemstack.getItem().getItemStackDisplayName(itemstack);
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
******************************************************************************/
|
||||
package forestry.core.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.IllegalFormatException;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -116,4 +118,26 @@ public class StringUtil {
|
||||
|
||||
return lineCount * fontRenderer.FONT_HEIGHT;
|
||||
}
|
||||
|
||||
public static List<String> multilineStrings(String input, int n) {
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
int start = 0;
|
||||
while (start < input.length()) {
|
||||
// Find the end index by starting with n characters ahead
|
||||
int end = Math.min(start + n, input.length());
|
||||
|
||||
// If end is not at the end of the string, backtrack to the last space
|
||||
if (end < input.length() && !Character.isWhitespace(input.charAt(end))) {
|
||||
int lastSpace = input.lastIndexOf(' ', end);
|
||||
if (lastSpace > start) {
|
||||
end = lastSpace;
|
||||
}
|
||||
}
|
||||
|
||||
result.add(input.substring(start, end).trim());
|
||||
start = end;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import static forestry.Forestry.isDreamcraftLoaded;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.command.ICommand;
|
||||
@@ -134,16 +132,14 @@ public class PluginCore extends ForestryPlugin {
|
||||
|
||||
// forestry items
|
||||
crateRegistry.registerCrate(items.peat, "cratedPeat");
|
||||
crateRegistry.registerCrate(items.apatite, "cratedApatite");
|
||||
crateRegistry.registerCrate(items.fertilizerCompound, "cratedFertilizer");
|
||||
crateRegistry.registerCrate(items.mulch, "cratedMulch");
|
||||
crateRegistry.registerCrate(items.phosphor, "cratedPhosphor");
|
||||
crateRegistry.registerCrate(items.ash, "cratedAsh");
|
||||
if (!isDreamcraftLoaded) {
|
||||
crateRegistry.registerCrate(items.apatite, "cratedApatite");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotTin, "cratedTin");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotCopper, "cratedCopper");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotBronze, "cratedBronze");
|
||||
}
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotTin, "cratedTin");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotCopper, "cratedCopper");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotBronze, "cratedBronze");
|
||||
|
||||
// forestry blocks
|
||||
crateRegistry.registerCrate(blocks.soil.get(BlockSoil.SoilType.HUMUS, 1), "cratedHumus");
|
||||
@@ -199,14 +195,9 @@ public class PluginCore extends ForestryPlugin {
|
||||
protected void registerRecipes() {
|
||||
|
||||
/* SMELTING RECIPES */
|
||||
if (!isDreamcraftLoaded) {
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.APATITE, 1), items.apatite, 0.5f);
|
||||
RecipeUtil.addSmelting(
|
||||
blocks.resources.get(BlockResourceOre.ResourceType.COPPER, 1),
|
||||
items.ingotCopper,
|
||||
0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.TIN, 1), items.ingotTin, 0.5f);
|
||||
}
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.APATITE, 1), items.apatite, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.COPPER, 1), items.ingotCopper, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.TIN, 1), items.ingotTin, 0.5f);
|
||||
RecipeUtil.addSmelting(new ItemStack(items.peat), items.ash, 0.0f);
|
||||
|
||||
/* BRONZE INGOTS */
|
||||
@@ -391,43 +382,41 @@ public class PluginCore extends ForestryPlugin {
|
||||
new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
// Storage Blocks
|
||||
if (!isDreamcraftLoaded) {
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.APATITE),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"gemApatite");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.apatite, 9), "blockApatite");
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.APATITE),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"gemApatite");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.apatite, 9), "blockApatite");
|
||||
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.COPPER),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"ingotCopper");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotCopper, 9), "blockCopper");
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.COPPER),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"ingotCopper");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotCopper, 9), "blockCopper");
|
||||
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.TIN),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"ingotTin");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotTin, 9), "blockTin");
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.TIN),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"ingotTin");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotTin, 9), "blockTin");
|
||||
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.BRONZE),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"ingotBronze");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotBronze, 9), "blockBronze");
|
||||
}
|
||||
RecipeUtil.addRecipe(
|
||||
blocks.resourceStorage.get(BlockResourceStorage.ResourceType.BRONZE),
|
||||
"###",
|
||||
"###",
|
||||
"###",
|
||||
'#',
|
||||
"ingotBronze");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotBronze, 9), "blockBronze");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import static forestry.Forestry.isDreamcraftLoaded;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -646,20 +644,18 @@ public class PluginFactory extends ForestryPlugin {
|
||||
new Object[] { " # ", " X ", " X ", '#', "ingotBronze", 'X', "stickWood" });
|
||||
|
||||
// Reclamation
|
||||
if (!isDreamcraftLoaded) {
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
null,
|
||||
PluginCore.items.ingotBronze.getItemStack(2),
|
||||
"#",
|
||||
'#',
|
||||
PluginCore.items.brokenBronzePickaxe);
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
null,
|
||||
PluginCore.items.ingotBronze.getItemStack(),
|
||||
"#",
|
||||
'#',
|
||||
PluginCore.items.brokenBronzeShovel);
|
||||
}
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
null,
|
||||
PluginCore.items.ingotBronze.getItemStack(2),
|
||||
"#",
|
||||
'#',
|
||||
PluginCore.items.brokenBronzePickaxe);
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
null,
|
||||
PluginCore.items.ingotBronze.getItemStack(),
|
||||
"#",
|
||||
'#',
|
||||
PluginCore.items.brokenBronzeShovel);
|
||||
|
||||
// Crating and uncrating
|
||||
if (PluginManager.Module.STORAGE.isEnabled()) {
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import static forestry.Forestry.isDreamcraftLoaded;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -132,13 +130,11 @@ public class PluginFluids extends ForestryPlugin {
|
||||
}
|
||||
|
||||
if (RecipeManagers.squeezerManager != null) {
|
||||
if (!isDreamcraftLoaded) {
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(
|
||||
10,
|
||||
items.canEmpty.getItemStack(),
|
||||
PluginCore.items.ingotTin.getItemStack(),
|
||||
0.05f);
|
||||
}
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(
|
||||
10,
|
||||
items.canEmpty.getItemStack(),
|
||||
PluginCore.items.ingotTin.getItemStack(),
|
||||
0.05f);
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(
|
||||
10,
|
||||
items.waxCapsuleEmpty.getItemStack(),
|
||||
|
||||
Reference in new issue
Block a user