mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-20 12:09:39 +00:00
Merge remote-tracking branch 'origin/mc-1.12' into mc-1.12
This commit is contained in:
commit
32933ce90b
13 files changed
+67
-100
No files matched your search
@@ -60,7 +60,7 @@ import forestry.plugins.compat.PluginIC2;
|
||||
version = Constants.VERSION,
|
||||
guiFactory = "forestry.core.config.ForestryGuiConfigFactory",
|
||||
acceptedMinecraftVersions = "[1.12]",
|
||||
dependencies = "required-after:forge@[14.21.0.2363,);"
|
||||
dependencies = "required-after:forge@[14.21.1.2395,);"
|
||||
+ "after:JEI@[4.7.0,);"
|
||||
+ "after:" + PluginIC2.modId + ";")
|
||||
public class Forestry {
|
||||
|
||||
@@ -43,7 +43,6 @@ import net.minecraftforge.common.capabilities.CapabilityManager;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -72,7 +71,6 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.arboriculture.blocks.BlockArbLog;
|
||||
import forestry.arboriculture.blocks.BlockArbSlab;
|
||||
import forestry.arboriculture.blocks.BlockDefaultLeaves;
|
||||
import forestry.arboriculture.blocks.BlockForestryLeaves;
|
||||
import forestry.arboriculture.blocks.BlockRegistryArboriculture;
|
||||
@@ -87,7 +85,6 @@ import forestry.arboriculture.genetics.TreeRoot;
|
||||
import forestry.arboriculture.genetics.TreekeepingMode;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleFruits;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleLeafEffects;
|
||||
import forestry.arboriculture.items.ItemGermlingGE;
|
||||
import forestry.arboriculture.items.ItemGrafter;
|
||||
import forestry.arboriculture.items.ItemRegistryArboriculture;
|
||||
import forestry.arboriculture.models.TextureLeaves;
|
||||
@@ -544,11 +541,6 @@ public class PluginArboriculture extends BlankForestryPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFuelHandler getFuelHandler() {
|
||||
return new FuelHandler(getItems().sapling);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacketRegistry getPacketRegistry() {
|
||||
return new PacketRegistryArboriculture();
|
||||
@@ -575,44 +567,6 @@ public class PluginArboriculture extends BlankForestryPlugin {
|
||||
hiddenItems.add(new ItemStack(getBlocks().saplingGE));
|
||||
}
|
||||
|
||||
private static class FuelHandler implements IFuelHandler {
|
||||
private final ItemGermlingGE sapling;
|
||||
|
||||
public FuelHandler(ItemGermlingGE sapling) {
|
||||
this.sapling = sapling;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
Item item = fuel.getItem();
|
||||
if (sapling == item) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
if(Item.getItemFromBlock(blocks.charcoal) == item){
|
||||
return 16000;
|
||||
}
|
||||
if(Item.getItemFromBlock(blocks.woodPile) == item){
|
||||
return 1200;
|
||||
}
|
||||
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block instanceof IWoodTyped) {
|
||||
IWoodTyped woodTypedBlock = (IWoodTyped) block;
|
||||
if (woodTypedBlock.isFireproof()) {
|
||||
return 0;
|
||||
} else if (block instanceof BlockArbSlab) {
|
||||
return 150;
|
||||
} else {
|
||||
return 300;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerSprites(TextureStitchEvent.Pre event) {
|
||||
|
||||
@@ -271,10 +271,22 @@ public class BlockRegistryArboriculture extends BlockRegistry {
|
||||
}
|
||||
|
||||
charcoal = new BlockCharcoal();
|
||||
registerBlock(charcoal, new ItemBlockForestry(charcoal), "charcoal");
|
||||
ItemBlockForestry itemBlockCharcoal = new ItemBlockForestry(charcoal) {
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
return 16000;
|
||||
}
|
||||
};
|
||||
registerBlock(charcoal, itemBlockCharcoal, "charcoal");
|
||||
|
||||
woodPile = new BlockWoodPile();
|
||||
registerBlock(woodPile, new ItemBlockForestry(woodPile), "wood_pile");
|
||||
ItemBlockForestry itemBlockWoodPile = new ItemBlockForestry(woodPile) {
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
return 1200;
|
||||
}
|
||||
};
|
||||
registerBlock(woodPile, itemBlockWoodPile, "wood_pile");
|
||||
|
||||
loam = new BlockLoam();
|
||||
registerBlock(loam, new ItemBlockForestry(loam), "loam");
|
||||
|
||||
@@ -13,6 +13,7 @@ package forestry.arboriculture.items;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.BlockArbSlab;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -29,5 +30,14 @@ public class ItemBlockWood<B extends Block & IWoodTyped> extends ItemBlockForest
|
||||
IWoodType woodType = wood.getWoodType(meta);
|
||||
return WoodHelper.getDisplayName(wood, woodType);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
B block = getBlock();
|
||||
if (block.isFireproof()) {
|
||||
return 0;
|
||||
} else {
|
||||
return 300;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,4 +52,13 @@ public class ItemBlockWoodDoor extends ItemBlockWood<BlockArbDoor> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
if (getBlock().isFireproof()) {
|
||||
return 0;
|
||||
} else {
|
||||
return 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package forestry.arboriculture.items;
|
||||
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
import forestry.arboriculture.WoodHelper;
|
||||
import forestry.arboriculture.blocks.BlockArbSlab;
|
||||
import forestry.arboriculture.blocks.BlockForestrySlab;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -18,4 +19,14 @@ public class ItemBlockWoodSlab extends ItemSlab {
|
||||
IWoodType woodType = wood.getWoodType(meta);
|
||||
return WoodHelper.getDisplayName(wood, woodType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
BlockForestrySlab forestrySlab = (BlockForestrySlab) this.block;
|
||||
if (forestrySlab.isFireproof()) {
|
||||
return 0;
|
||||
} else {
|
||||
return 150;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,4 +218,9 @@ public class ItemGermlingGE extends ItemGE implements IVariableFermentable, ICol
|
||||
}
|
||||
return tree.getGenome().getSappiness() * 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,6 @@ import forestry.core.network.PacketRegistryCore;
|
||||
import forestry.core.owner.GameProfileDataSerializer;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.recipes.ShapedRecipeCustom;
|
||||
import forestry.core.render.TextureManagerForestry;
|
||||
import forestry.core.utils.ClimateUtil;
|
||||
import forestry.core.utils.ForestryModEnvWarningCallable;
|
||||
@@ -71,12 +70,10 @@ import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.CORE, name = "Core", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.core.description")
|
||||
public class PluginCore extends BlankForestryPlugin {
|
||||
@@ -162,8 +159,6 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
alleleHelper.init();
|
||||
|
||||
Proxies.render.initRendering();
|
||||
|
||||
RecipeSorter.register("forestry:shaped", ShapedRecipeCustom.class, RecipeSorter.Category.SHAPED, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -466,37 +461,12 @@ public class PluginCore extends BlankForestryPlugin {
|
||||
return new ICommand[]{rootCommand};
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFuelHandler getFuelHandler() {
|
||||
return new FuelHandler(getItems());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHiddenItems(List<ItemStack> hiddenItems) {
|
||||
// research note items are not useful without actually having completed research
|
||||
hiddenItems.add(new ItemStack(getItems().researchNote));
|
||||
}
|
||||
|
||||
private static class FuelHandler implements IFuelHandler {
|
||||
private final ItemRegistryCore items;
|
||||
|
||||
public FuelHandler(ItemRegistryCore items) {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (fuel != null && fuel.getItem() == items.peat) {
|
||||
return 2000;
|
||||
}
|
||||
if (fuel != null && fuel.getItem() == items.bituminousPeat) {
|
||||
return 4200;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onBakeModels(ModelBakeEvent event) {
|
||||
|
||||
@@ -116,13 +116,25 @@ public class ItemRegistryCore extends ItemRegistry {
|
||||
|
||||
spectacles = registerItem(new ItemArmorNaturalist(), "naturalist_helmet");
|
||||
|
||||
peat = registerItem(new ItemForestry(), "peat");
|
||||
peat = new ItemForestry() {
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
return 2000;
|
||||
}
|
||||
};
|
||||
registerItem(peat, "peat");
|
||||
OreDictionary.registerOre(OreDictUtil.BRICK_PEAT, peat);
|
||||
|
||||
ash = registerItem(new ItemForestry(), "ash");
|
||||
OreDictionary.registerOre(OreDictUtil.DUST_ASH, ash);
|
||||
|
||||
bituminousPeat = registerItem(new ItemForestry(), "bituminous_peat");
|
||||
bituminousPeat = new ItemForestry() {
|
||||
@Override
|
||||
public int getItemBurnTime(ItemStack itemStack) {
|
||||
return 4200;
|
||||
}
|
||||
};
|
||||
registerItem(bituminousPeat, "bituminous_peat");
|
||||
|
||||
gearBronze = createItemForOreName(OreDictUtil.GEAR_BRONZE, "gear_bronze");
|
||||
gearCopper = createItemForOreName(OreDictUtil.GEAR_COPPER, "gear_copper");
|
||||
|
||||
@@ -145,12 +145,6 @@ public abstract class BlankForestryPlugin implements IForestryPlugin {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IFuelHandler getFuelHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
ForestryPlugin forestryPlugin = getClass().getAnnotation(ForestryPlugin.class);
|
||||
|
||||
@@ -74,7 +74,4 @@ public interface IForestryPlugin {
|
||||
|
||||
@Nullable
|
||||
ICommand[] getConsoleCommands();
|
||||
|
||||
@Nullable
|
||||
IFuelHandler getFuelHandler();
|
||||
}
|
||||
@@ -33,11 +33,9 @@ import net.minecraft.world.gen.IChunkGenerator;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import forestry.Forestry;
|
||||
@@ -108,11 +106,6 @@ public class PluginManager {
|
||||
if (resupplyHandler != null) {
|
||||
resupplyHandlers.add(resupplyHandler);
|
||||
}
|
||||
|
||||
IFuelHandler fuelHandler = plugin.getFuelHandler();
|
||||
if (fuelHandler != null) {
|
||||
GameRegistry.registerFuelHandler(fuelHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private static IForestryPlugin getPluginCore(List<IForestryPlugin> forestryPlugins) {
|
||||
|
||||
Reference in new issue
Block a user