mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +00:00
Update to 1.12
This commit is contained in:
1 parent
cb81d0ead4
commit
e2a49158f3
148 files changed
+817
-720
No files matched your search
+3
-3
@@ -7,7 +7,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ if (System.getenv("BUILD_NUMBER") != null) {
|
||||
version = version + "." + System.getenv("BUILD_NUMBER")
|
||||
}
|
||||
group = "binnie" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "binnie-mods-1.11.2"
|
||||
archivesBaseName = "binnie-mods-" + mcversion
|
||||
|
||||
minecraft {
|
||||
version = mcversion + "-" + forgeversion
|
||||
@@ -67,7 +67,7 @@ dependencies {
|
||||
runtime "jei-bees:jeibees:${jeibees_version}:mc${mcversion}"
|
||||
deobfProvided "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
||||
runtime "net.industrial-craft:industrialcraft-2:${ic2_version}"
|
||||
deobfProvided "MineTweaker3:MineTweaker3-API:${minetweaker_version}"
|
||||
deobfProvided "CraftTweaker2:CraftTweaker2-API:${minetweaker_version}"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
+9
-9
@@ -2,18 +2,18 @@
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
org.gradle.jvmargs=-Xmx3G
|
||||
|
||||
mcversion=1.11.2
|
||||
forgeversion=13.20.1.2393
|
||||
mcp_mappings=snapshot_20161220
|
||||
mcversion=1.12
|
||||
forgeversion=14.21.1.2443
|
||||
mcp_mappings=snapshot_20170806
|
||||
curse_project_id=223525
|
||||
|
||||
forestry_version=5.3.4.132
|
||||
ic2_version=2.7.71-ex111
|
||||
forestry_version=5.5.0.154
|
||||
ic2_version=2.8.14-ex112
|
||||
|
||||
version_major=2
|
||||
version_minor=1
|
||||
version_minor=2
|
||||
version_patch=0
|
||||
|
||||
jei_version=4.5.0.292
|
||||
jeibees_version=0.9.0.5
|
||||
minetweaker_version=3.0.26.113
|
||||
jei_version=4.7.4.82
|
||||
jeibees_version=0.9.0.2
|
||||
minetweaker_version=4.0.3.239
|
||||
@@ -89,10 +89,9 @@ public class BlockCeramic extends Block implements IColoredBlock, IItemModelRegi
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
itemList.add(new ItemStack(item, 1, c.getFlowerColorAllele().getID()));
|
||||
itemList.add(new ItemStack(this, 1, c.getFlowerColorAllele().getID()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, color.ordinal()));
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package binnie.botany.ceramic;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.Constants;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
@@ -15,9 +17,13 @@ import net.minecraftforge.common.ForgeHooks;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.ceramic.brick.CeramicBrickType;
|
||||
import binnie.botany.gardening.ModuleGardening;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
public class CeramicTileRecipe implements IRecipe {
|
||||
private ItemStack cached = ItemStack.EMPTY;
|
||||
public class CeramicTileRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe { private ItemStack cached = ItemStack.EMPTY;
|
||||
|
||||
public CeramicTileRecipe() {
|
||||
setRegistryName(new ResourceLocation(Constants.BOTANY_MOD_ID, "ceramic_tile"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
@@ -63,8 +69,8 @@ public class CeramicTileRecipe implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 2;
|
||||
public boolean canFit(int width, int height) {
|
||||
return width >= 2 && height >= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.Constants;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlower;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
public class PigmentRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public PigmentRecipe() {
|
||||
setRegistryName(new ResourceLocation(Constants.BOTANY_MOD_ID, "pigment"));
|
||||
}
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IFlower;
|
||||
|
||||
public class PigmentRecipe implements IRecipe {
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting crafting, World world) {
|
||||
return !getCraftingResult(crafting).isEmpty();
|
||||
@@ -45,12 +48,7 @@ public class PigmentRecipe implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
|
||||
public boolean canFit(int width, int height) {
|
||||
return width >= 1 && height >= 1;
|
||||
}
|
||||
}
|
||||
@@ -103,9 +103,8 @@ public class BlockCeramicBrick extends Block implements IMultipassBlock<CeramicB
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
itemList.add(new CeramicBrickPair(color, color, CeramicBrickType.TILE).getStack(1));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
enum EnumTubeInsulate {
|
||||
public enum EnumTubeInsulate {
|
||||
CLAY(0xa1aacc, "clay"),
|
||||
COBBLE(0x7b7b7b, "cobblestone"),
|
||||
SAND(0xefeab5, "sandstone"),
|
||||
@@ -16,11 +16,11 @@ enum EnumTubeInsulate {
|
||||
public static final EnumTubeInsulate[] VALUES = values();
|
||||
|
||||
int color;
|
||||
String name;
|
||||
String uid;
|
||||
|
||||
EnumTubeInsulate(int color, String name) {
|
||||
EnumTubeInsulate(int color, String uid) {
|
||||
this.color = color;
|
||||
this.name = name;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public static EnumTubeInsulate get(int meta) {
|
||||
@@ -32,7 +32,11 @@ enum EnumTubeInsulate {
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return I18N.localise("botany.tube.insulate." + name + ".name");
|
||||
return I18N.localise("botany.tube.insulate." + uid + ".name");
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
||||
@@ -2,7 +2,7 @@ package binnie.botany.flower;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
enum EnumTubeMaterial {
|
||||
public enum EnumTubeMaterial {
|
||||
COPPER(0xe3b78e, "copper"),
|
||||
TIN(0xe1eef4, "tin"),
|
||||
BRONZE(0xddc276, "bronze"),
|
||||
@@ -11,22 +11,26 @@ enum EnumTubeMaterial {
|
||||
public static final EnumTubeMaterial[] VALUES = values();
|
||||
|
||||
int color;
|
||||
String name;
|
||||
String uid;
|
||||
|
||||
EnumTubeMaterial(int color, String name) {
|
||||
EnumTubeMaterial(int color, String uid) {
|
||||
this.color = color;
|
||||
this.name = name;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public static EnumTubeMaterial get(int meta) {
|
||||
return VALUES[meta % VALUES.length];
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return I18N.localise("botany.tube.material." + name + ".name");
|
||||
return I18N.localise("botany.tube.material." + uid + ".name");
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -89,7 +90,7 @@ public class ItemBotany extends Item implements IColoredItem, IItemModelRegister
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> list, boolean flag) {
|
||||
public void addInformation(ItemStack itemStack, @Nullable World worldIn, List<String> list, ITooltipFlag flagIn) {
|
||||
IFlower individual = (IFlower) getIndividual(itemStack);
|
||||
if (individual == null) {
|
||||
list.add(TextFormatting.DARK_RED + I18N.localise("item.botany.flower.destroy"));
|
||||
@@ -150,8 +151,10 @@ public class ItemBotany extends Item implements IColoredItem, IItemModelRegister
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
addCreativeItems(itemList, true);
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
addCreativeItems(items, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void addCreativeItems(NonNullList<ItemStack> itemList, boolean hideSecrets) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
@@ -7,6 +9,7 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -14,6 +17,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -58,11 +62,12 @@ public class ItemInsulatedTube extends ItemCore implements IColoredItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (EnumTubeMaterial mat : EnumTubeMaterial.values()) {
|
||||
for (EnumTubeInsulate ins : EnumTubeInsulate.values()) {
|
||||
subItems.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (EnumTubeMaterial mat : EnumTubeMaterial.values()) {
|
||||
for (EnumTubeInsulate ins : EnumTubeInsulate.values()) {
|
||||
items.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,8 +94,8 @@ public class ItemInsulatedTube extends ItemCore implements IColoredItem {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List<String> list, boolean flag) {
|
||||
super.addInformation(itemstack, player, list, flag);
|
||||
public void addInformation(ItemStack itemstack, @Nullable World worldIn, List<String> list, ITooltipFlag flagIn) {
|
||||
super.addInformation(itemstack, worldIn, list, flagIn);
|
||||
Multimap<ICircuitLayout, ICircuit> circuits = getCircuits(itemstack);
|
||||
if (!circuits.isEmpty()) {
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
|
||||
@@ -90,8 +90,7 @@ public class BlockPlant extends BlockBush implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, NonNullList<ItemStack> subBlocks) {
|
||||
public void getSubBlocks(CreativeTabs p_149666_2_, NonNullList<ItemStack> subBlocks) {
|
||||
for (PlantType type : PlantType.values()) {
|
||||
subBlocks.add(type.get());
|
||||
}
|
||||
|
||||
@@ -135,8 +135,7 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -25,8 +28,7 @@ public class ItemSoil extends ItemBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
String info = "";
|
||||
info += BlockSoil.getMoisture(stack, true, true);
|
||||
if (info.length() > 0) {
|
||||
|
||||
@@ -3,11 +3,16 @@ package binnie.botany.gardening;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.botany.flower.EnumTubeInsulate;
|
||||
import binnie.botany.flower.EnumTubeMaterial;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
@@ -167,66 +172,68 @@ public class ModuleGardening implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.BOTANY_MOD_ID);
|
||||
IGardeningManager gardening = BotanyCore.getGardening();
|
||||
GameRegistry.addRecipe(new CeramicTileRecipe());
|
||||
for (int mat = 0; mat < 4; ++mat) {
|
||||
for (int insulate = 0; insulate < 6; ++insulate) {
|
||||
ItemStack tubes = new ItemStack(insulatedTube, 2, mat + 128 * insulate);
|
||||
ForgeRegistries.RECIPES.register(new CeramicTileRecipe());
|
||||
for (EnumTubeMaterial mat: EnumTubeMaterial.VALUES) {
|
||||
for (EnumTubeInsulate insulate : EnumTubeInsulate.VALUES) {
|
||||
ItemStack tubes = new ItemStack(insulatedTube, 2, mat.ordinal() + 128 * insulate.ordinal());
|
||||
ItemStack insulateStack = ItemInsulatedTube.getInsulateStack(tubes);
|
||||
ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionic_tubes"), 1, mat);
|
||||
GameRegistry.addShapelessRecipe(tubes, forestryTube, forestryTube, insulateStack);
|
||||
ItemStack forestryTube = new ItemStack(Mods.Forestry.item("thermionic_tubes"), 1, mat.ordinal());
|
||||
String recipeName = "thermionic_tubes_" + insulate.getUid() + "_" + mat.getUid();
|
||||
recipeUtil.addShapelessRecipe(recipeName, tubes, forestryTube, forestryTube, insulateStack);
|
||||
}
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_wood",
|
||||
trowelWood,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "plankWood")
|
||||
'x', "plankWood"
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_stone",
|
||||
trowelStone,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "cobblestone"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_iron",
|
||||
trowelIron,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "ingotIron"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_gold",
|
||||
trowelGold,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "ingotGold"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("trowel_diamond",
|
||||
trowelDiamond,
|
||||
"d ", " x ", " s",
|
||||
'd', Blocks.DIRT,
|
||||
's', "stickWood",
|
||||
'x', "gemDiamond"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
recipeUtil.addRecipe("soil_meter",
|
||||
soilMeter,
|
||||
" gg", " rg", "i ",
|
||||
'g', "ingotGold",
|
||||
'r', "dustRedstone",
|
||||
'i', "ingotIron"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("weed_killer",
|
||||
BotanyItems.WEEDKILLER.get(4),
|
||||
new ItemStack(Items.SPIDER_EYE),
|
||||
new ItemStack(Items.WHEAT_SEEDS),
|
||||
@@ -234,40 +241,40 @@ public class ModuleGardening implements IInitializable {
|
||||
new ItemStack(Items.WHEAT_SEEDS)
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_ash",
|
||||
BotanyItems.POWDER_ASH.get(4),
|
||||
Mods.Forestry.stack("ash")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_mulch",
|
||||
BotanyItems.POWDER_MULCH.get(4),
|
||||
Mods.Forestry.stack("mulch")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_compost",
|
||||
BotanyItems.POWDER_COMPOST.get(4),
|
||||
Mods.Forestry.stack("fertilizer_bio")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_fertilizer",
|
||||
BotanyItems.POWDER_FERTILISER.get(4),
|
||||
Mods.Forestry.stack("fertilizer_compound")
|
||||
);
|
||||
|
||||
GameRegistry.addShapelessRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_pulp",
|
||||
BotanyItems.POWDER_PULP.get(4),
|
||||
Mods.Forestry.stack("wood_pulp")
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
recipeUtil.addShapelessRecipe("powder_sulphur",
|
||||
BotanyItems.POWDER_SULPHUR.get(4),
|
||||
"dustSulphur"
|
||||
));
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
recipeUtil.addShapelessRecipe("pigment_black",
|
||||
new ItemStack(pigment, 2, EnumFlowerColor.Black.ordinal()),
|
||||
"pigment", "pigment", "dyeBlack"
|
||||
));
|
||||
);
|
||||
|
||||
gardening.registerAcidFertiliser(BotanyItems.POWDER_SULPHUR.get(1), 1);
|
||||
gardening.registerAcidFertiliser(BotanyItems.POWDER_MULCH.get(1), 1);
|
||||
@@ -286,32 +293,32 @@ public class ModuleGardening implements IInitializable {
|
||||
gardening.registerNutrientFertiliser(Mods.Forestry.stack("fertilizer_compound"), 2);
|
||||
|
||||
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAcidFertilisers.entrySet()) {
|
||||
addAcidFertiliserRecipe(entry.getKey(), entry.getValue());
|
||||
addAcidFertiliserRecipe(recipeUtil, entry.getKey(), entry.getValue());
|
||||
}
|
||||
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedAlkalineFertilisers.entrySet()) {
|
||||
addAlkalineFertiliserRecipe(entry.getKey(), entry.getValue());
|
||||
addAlkalineFertiliserRecipe(recipeUtil, entry.getKey(), entry.getValue());
|
||||
}
|
||||
for (Map.Entry<ItemStack, Integer> entry : ModuleGardening.queuedNutrientFertilisers.entrySet()) {
|
||||
addNutrientFertiliserRecipe(entry.getKey(), entry.getValue());
|
||||
addNutrientFertiliserRecipe(recipeUtil, entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(BotanyItems.MORTAR.get(6), " c ", "cgc", " c ", 'c', Items.CLAY_BALL, 'g', Blocks.GRAVEL);
|
||||
recipeUtil.addRecipe("mortar", BotanyItems.MORTAR.get(6), " c ", "cgc", " c ", 'c', Items.CLAY_BALL, 'g', Blocks.GRAVEL);
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
ItemStack clay = new ItemStack(this.clay, 1, c.ordinal());
|
||||
ItemStack pigment = new ItemStack(this.pigment, 1, c.ordinal());
|
||||
GameRegistry.addShapelessRecipe(clay, Items.CLAY_BALL, Items.CLAY_BALL, Items.CLAY_BALL, pigment);
|
||||
recipeUtil.addShapelessRecipe("clay_" + c.getIdent(), clay, Items.CLAY_BALL, Items.CLAY_BALL, Items.CLAY_BALL, pigment);
|
||||
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(ceramic, c.ordinal()), 0.0f);
|
||||
ItemStack glass = TileEntityMetadata.getItemStack(stained, c.ordinal());
|
||||
glass.setCount(4);
|
||||
|
||||
GameRegistry.addShapedRecipe(
|
||||
recipeUtil.addRecipe("mortar_" + c.getIdent(),
|
||||
glass,
|
||||
" g ", "gpg", " g ",
|
||||
'g', Blocks.GLASS,
|
||||
'p', pigment
|
||||
);
|
||||
}
|
||||
GameRegistry.addRecipe(new PigmentRecipe());
|
||||
ForgeRegistries.RECIPES.register(new PigmentRecipe());
|
||||
}
|
||||
|
||||
private ItemStack getStack(int type, int pH, int moisture) {
|
||||
@@ -321,7 +328,7 @@ public class ModuleGardening implements IInitializable {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
private void addAcidFertiliserRecipe(ItemStack stack, int strengthMax) {
|
||||
private void addAcidFertiliserRecipe(RecipeUtil recipeUtil, ItemStack stack, int strengthMax) {
|
||||
for (int moisture = 0; moisture < 3; ++moisture) {
|
||||
for (int pH = 0; pH < 3; ++pH) {
|
||||
for (int type = 0; type < 3; ++type) {
|
||||
@@ -336,7 +343,8 @@ public class ModuleGardening implements IInitializable {
|
||||
stacks[i] = start;
|
||||
}
|
||||
stacks[numOfBlocks] = stack.copy();
|
||||
GameRegistry.addShapelessRecipe(end, stacks);
|
||||
String recipeName = "acid_fertiliser_moisture" + moisture + "_ph" + pH + "_type" + type + "_strength" + strength;
|
||||
recipeUtil.addShapelessRecipe(recipeName, end, stacks);
|
||||
}
|
||||
numOfBlocks /= 2;
|
||||
}
|
||||
@@ -345,7 +353,7 @@ public class ModuleGardening implements IInitializable {
|
||||
}
|
||||
}
|
||||
|
||||
private void addAlkalineFertiliserRecipe(ItemStack stack, int strengthMax) {
|
||||
private void addAlkalineFertiliserRecipe(RecipeUtil recipeUtil, ItemStack stack, int strengthMax) {
|
||||
for (int moisture = 0; moisture < 3; ++moisture) {
|
||||
for (int pH = 0; pH < 3; ++pH) {
|
||||
for (int type = 0; type < 3; ++type) {
|
||||
@@ -360,7 +368,8 @@ public class ModuleGardening implements IInitializable {
|
||||
stacks[i] = start;
|
||||
}
|
||||
stacks[numOfBlocks] = stack.copy();
|
||||
GameRegistry.addShapelessRecipe(end, stacks);
|
||||
String recipeName = "alkaline_fertiliser_moisture" + moisture + "_ph" + pH + "_type" + type + "_strength" + strength;
|
||||
recipeUtil.addShapelessRecipe(recipeName, end, stacks);
|
||||
}
|
||||
numOfBlocks /= 2;
|
||||
}
|
||||
@@ -369,7 +378,7 @@ public class ModuleGardening implements IInitializable {
|
||||
}
|
||||
}
|
||||
|
||||
private void addNutrientFertiliserRecipe(ItemStack stack, int strengthMax) {
|
||||
private void addNutrientFertiliserRecipe(RecipeUtil recipeUtil, ItemStack stack, int strengthMax) {
|
||||
for (int moisture = 0; moisture < 3; ++moisture) {
|
||||
for (int pH = 0; pH < 3; ++pH) {
|
||||
for (int type = 0; type < 3; ++type) {
|
||||
@@ -384,7 +393,8 @@ public class ModuleGardening implements IInitializable {
|
||||
stacks[i] = start;
|
||||
}
|
||||
stacks[numOfBlocks] = stack.copy();
|
||||
GameRegistry.addShapelessRecipe(end, stacks);
|
||||
String recipeName = "nutrient_fertiliser_moisture" + moisture + "_ph" + pH + "_type" + type + "_strength" + strength;
|
||||
recipeUtil.addShapelessRecipe(recipeName, end, stacks);
|
||||
}
|
||||
numOfBlocks /= 2;
|
||||
}
|
||||
|
||||
@@ -92,13 +92,11 @@ public enum EnumFlowerColor implements IStringSerializable {
|
||||
|
||||
public static final EnumFlowerColor[] VALUES = values();
|
||||
|
||||
private final String ident;
|
||||
private FlowerColorAllele allele;
|
||||
|
||||
EnumFlowerColor(String ident, int c) {
|
||||
this(c);
|
||||
}
|
||||
|
||||
EnumFlowerColor(int color) {
|
||||
EnumFlowerColor(String ident, int color) {
|
||||
this.ident = ident;
|
||||
int r = color >> 16 & 0xFF;
|
||||
int g = color >> 8 & 0xFF;
|
||||
int b = color & 0xFF;
|
||||
@@ -110,6 +108,10 @@ public enum EnumFlowerColor implements IStringSerializable {
|
||||
allele = new FlowerColorAllele(uid, ordinal(), color, colorDis, name().toLowerCase(), uid, true);
|
||||
}
|
||||
|
||||
public String getIdent() {
|
||||
return ident;
|
||||
}
|
||||
|
||||
public static void addMix(EnumFlowerColor start1, EnumFlowerColor start2, EnumFlowerColor result, int chance) {
|
||||
BotanyCore.getFlowerRoot().registerColourMix(new ColorMix(start1.allele, start2.allele, result.allele, chance));
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class FlowerAlyzerPlugin implements IAlyzerPlugin {
|
||||
}
|
||||
|
||||
public void drawLine(GuiScreen gui, int xOffset, String msg, int color) {
|
||||
gui.mc.fontRendererObj.drawString(msg, guiLeft + xOffset, guiTop + lastTopOffset + margin, color);
|
||||
gui.mc.fontRenderer.drawString(msg, guiLeft + xOffset, guiTop + lastTopOffset + margin, color);
|
||||
}
|
||||
|
||||
public void drawChromosom(GuiScreen gui, EnumFlowerChromosome chromosome, IFlower flower) {
|
||||
@@ -95,16 +95,16 @@ public class FlowerAlyzerPlugin implements IAlyzerPlugin {
|
||||
ItemStack renderS = getIconStacks().get(flower.getGenome().getSecondary().getUID());
|
||||
|
||||
|
||||
gui.mc.fontRendererObj.drawString("Active", guiLeft + 10 + COLUMN_1, guiTop + 10, 0xffffff);
|
||||
gui.mc.fontRendererObj.drawString("Inactive", guiLeft + 10 + COLUMN_2, guiTop + 10, 0xffffff);
|
||||
gui.mc.fontRenderer.drawString("Active", guiLeft + 10 + COLUMN_1, guiTop + 10, 0xffffff);
|
||||
gui.mc.fontRenderer.drawString("Inactive", guiLeft + 10 + COLUMN_2, guiTop + 10, 0xffffff);
|
||||
|
||||
if (renderP != null && renderS != null) {
|
||||
RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();
|
||||
itemRender.renderItemAndEffectIntoGUI(renderP, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12);
|
||||
itemRender.renderItemOverlayIntoGUI(gui.mc.fontRendererObj, renderP, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12, null);
|
||||
itemRender.renderItemOverlayIntoGUI(gui.mc.fontRenderer, renderP, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12, null);
|
||||
|
||||
itemRender.renderItemAndEffectIntoGUI(renderS, guiLeft + 10 + COLUMN_2, guiTop + 10 + 12);
|
||||
itemRender.renderItemOverlayIntoGUI(gui.mc.fontRendererObj, renderS, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12, null);
|
||||
itemRender.renderItemOverlayIntoGUI(gui.mc.fontRenderer, renderS, guiLeft + 10 + COLUMN_1, guiTop + 10 + 12, null);
|
||||
}
|
||||
|
||||
guiTop += rowSize * 3;
|
||||
|
||||
@@ -29,10 +29,10 @@ public class ItemDictionary extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
super.getSubItems(itemIn, tab, subItems);
|
||||
subItems.add(new ItemStack(itemIn, 1, 1));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
items.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,8 @@ package binnie.botany.genetics;
|
||||
import java.awt.Color;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -13,7 +15,6 @@ import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.api.storage.IBackpackInterface;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.storage.BackpackDefinition;
|
||||
|
||||
import binnie.Binnie;
|
||||
@@ -79,6 +80,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.GENETICS_MOD_ID);
|
||||
forestry.api.apiculture.FlowerManager.flowerRegistry.registerAcceptableFlower(Botany.flower, "flowersVanilla");
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
100,
|
||||
@@ -95,8 +97,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
'D', Items.DIAMOND,
|
||||
'E', Items.EMERALD
|
||||
);
|
||||
RecipeUtil.addRecipe
|
||||
(Botany.botanistBackpack,
|
||||
recipeUtil.addRecipe("botanist_backpack", Botany.botanistBackpack,
|
||||
"X#X",
|
||||
"VYZ",
|
||||
"X#X",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.gui.database;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -39,8 +40,8 @@ public class ControlColorDisplay extends Control implements IControlValue<IFlowe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
super.getTooltip(tooltip);
|
||||
public void getTooltip(Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
super.getTooltip(tooltip, tooltipFlag);
|
||||
tooltip.add(value.getColorName());
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.gui.database;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -47,7 +48,7 @@ public class ControlColorMixSymbol extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
public void getTooltip(Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
if (type == 1) {
|
||||
float chance = value.getChance();
|
||||
tooltip.add(I18N.localise(DatabaseConstants.BOTANY_CONTROL_KEY + ".color_mix_symbol.chance", chance));
|
||||
|
||||
@@ -46,10 +46,11 @@ public class ItemClay extends Item implements IColoredItem, IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
list.add(new ItemStack(this, 1, color.ordinal()));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
items.add(new ItemStack(this, 1, color.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,10 +46,11 @@ public class ItemPigment extends Item implements IItemModelRegister, IColoredIte
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
list.add(new ItemStack(this, 1, color.ordinal()));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
items.add(new ItemStack(this, 1, color.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,14 +32,13 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public abstract class BaseBakedModel implements IPerspectiveAwareModel {
|
||||
public abstract class BaseBakedModel implements IBakedModel {
|
||||
private static final TRSRTransformation flipX = new TRSRTransformation(null, null, new Vector3f(-1, 1, 1), null);
|
||||
private final EnumMap<ItemCameraTransforms.TransformType, TRSRTransformation> transformMap = new EnumMap<>(ItemCameraTransforms.TransformType.class);
|
||||
private final ResourceLocation particle;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ManagerGenetics extends ManagerBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
public void preInit() {
|
||||
if (BinnieCore.isApicultureActive()) {
|
||||
this.beeBreedingSystem = new BeeBreedingSystem();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.core.gui;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
|
||||
public interface ITooltip {
|
||||
void getTooltip(Tooltip tooltip);
|
||||
void getTooltip(Tooltip tooltip, ITooltipFlag tooltipFlag);
|
||||
}
|
||||
@@ -90,8 +90,8 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
|
||||
protected void renderTextField() {
|
||||
this.field.width = this.getWidth();
|
||||
this.field.height = this.getHeight();
|
||||
this.field.xPosition = (int) ((this.getHeight() - 8.0f) / 2.0f);
|
||||
this.field.yPosition = (int) ((this.getHeight() - 8.0f) / 2.0f);
|
||||
this.field.x = (int) ((this.getHeight() - 8.0f) / 2.0f);
|
||||
this.field.y = (int) ((this.getHeight() - 8.0f) / 2.0f);
|
||||
this.field.drawTextBox();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -83,7 +84,7 @@ public class Control extends Widget implements ITooltipHelp, ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
tooltip.add(this.tooltipStrings);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.gui.controls.tab;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -38,13 +39,13 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
final String name = this.getName();
|
||||
if (name != null && !name.isEmpty()) {
|
||||
tooltip.add(this.getName());
|
||||
}
|
||||
if (this.value instanceof ITooltip) {
|
||||
((ITooltip) this.value).getTooltip(tooltip);
|
||||
((ITooltip) this.value).getTooltip(tooltip, tooltipFlag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -101,7 +102,7 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
if (this.species != null) {
|
||||
switch (this.discovered) {
|
||||
case Show: {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.gui.database;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -58,7 +59,7 @@ class ControlMutationSymbol extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
if (this.type == 1 && this.discovered) {
|
||||
final IAlleleSpecies species1 = this.value.getAllele0();
|
||||
final IAlleleSpecies species2 = this.value.getAllele1();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.gui.fieldkit;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -55,7 +56,7 @@ public class ControlChromoPicker extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
public void getTooltip(Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
tooltip.add(Binnie.GENETICS.getSystem(parent.getRoot()).getChromosomeName(type));
|
||||
}
|
||||
}
|
||||
@@ -200,7 +200,7 @@ public class ContainerCraftGUI extends Container {
|
||||
final int slotNumber = action.getShort("n");
|
||||
this.createServerSlot(InventoryType.values()[type % 4], index, slotNumber);
|
||||
for (IContainerListener listener : listeners) {
|
||||
listener.updateCraftingInventory(this, this.getInventory());
|
||||
listener.sendAllContents(this, this.getInventory());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.JsonToNBT;
|
||||
@@ -106,7 +107,8 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
this.window.getHelpTooltip(tooltip);
|
||||
} else {
|
||||
tooltip.setType(Tooltip.Type.STANDARD);
|
||||
this.window.getTooltip(tooltip);
|
||||
ITooltipFlag tooltipFlag = this.mc.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
|
||||
this.window.getTooltip(tooltip, tooltipFlag);
|
||||
}
|
||||
if (tooltip.exists()) {
|
||||
this.renderTooltip(new Point(mouseX, mouseY), tooltip);
|
||||
@@ -286,7 +288,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
|
||||
public FontRenderer getFontRenderer() {
|
||||
return this.fontRendererObj;
|
||||
return this.fontRenderer;
|
||||
}
|
||||
|
||||
public void resize(final Point size) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -115,13 +116,13 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
return (T) widget.getTopParent();
|
||||
}
|
||||
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
final Deque<IWidget> queue = this.calculateMousedOverWidgets();
|
||||
while (!queue.isEmpty()) {
|
||||
final IWidget widget = queue.removeFirst();
|
||||
if (widget.isEnabled() && widget.isVisible() && widget.calculateIsMouseOver()) {
|
||||
if (widget instanceof ITooltip) {
|
||||
((ITooltip) widget).getTooltip(tooltip);
|
||||
((ITooltip) widget).getTooltip(tooltip, tooltipFlag);
|
||||
if (tooltip.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.core.gui.minecraft.control;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -63,7 +64,7 @@ public class ControlEnergyBar extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
tooltip.add((int) this.getPercentage() + "% charged");
|
||||
tooltip.add(this.getStoredEnergy() + "/" + this.getMaxEnergy() + " RF");
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.core.gui.minecraft.control;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -86,7 +87,7 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltipOrig) {
|
||||
public void getTooltip(final Tooltip tooltipOrig, ITooltipFlag tooltipFlag) {
|
||||
final MinecraftTooltip tooltip = (MinecraftTooltip) tooltipOrig;
|
||||
if (this.errorState != null) {
|
||||
if (this.type == 0) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.gui.minecraft.control;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -24,16 +25,20 @@ public class ControlHelp extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.HELP);
|
||||
tooltip.add("Help");
|
||||
tooltip.add("To activate help tooltips,");
|
||||
tooltip.add("hold down the tab key and");
|
||||
tooltip.add("mouse over controls.");
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
this.getTooltip(tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHelpTooltip(final Tooltip tooltip) {
|
||||
this.getTooltip(tooltip);
|
||||
}
|
||||
|
||||
private void getTooltip(final Tooltip tooltip) {
|
||||
tooltip.setType(Tooltip.Type.HELP);
|
||||
tooltip.add("Help");
|
||||
tooltip.add("To activate help tooltips,");
|
||||
tooltip.add("hold down the tab key and");
|
||||
tooltip.add("mouse over controls.");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.gui.minecraft.control;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -27,7 +28,7 @@ public class ControlInfo extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
tooltip.setType(Tooltip.Type.INFORMATION);
|
||||
tooltip.add("Info");
|
||||
tooltip.add(this.info);
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -82,14 +83,13 @@ public class ControlItemDisplay extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
if (this.hastooltip && !this.itemStack.isEmpty()) {
|
||||
final boolean advancedItemTooltips = Minecraft.getMinecraft().gameSettings.advancedItemTooltips;
|
||||
List<String> itemStackTooltip = this.itemStack.getTooltip(((Window) this.getTopParent()).getPlayer(), advancedItemTooltips);
|
||||
List<String> itemStackTooltip = this.itemStack.getTooltip(((Window) this.getTopParent()).getPlayer(), tooltipFlag);
|
||||
tooltip.add(itemStackTooltip);
|
||||
tooltip.setItemStack(this.itemStack);
|
||||
}
|
||||
super.getTooltip(tooltip);
|
||||
super.getTooltip(tooltip, tooltipFlag);
|
||||
}
|
||||
|
||||
public void setRotating() {
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.List;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
@@ -169,7 +170,7 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
if (this.isTankValid()) {
|
||||
final int percentage = (int) (100.0 * this.getTank().getAmount() / this.getTankCapacity());
|
||||
tooltip.add(this.getTank().getName());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.gui.minecraft.control;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -28,7 +29,7 @@ public class ControlPowerSystem extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
tooltip.setType(Tooltip.Type.POWER);
|
||||
tooltip.add("Power Supply");
|
||||
tooltip.add("Powered by " + this.system.getUnitName());
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.core.gui.minecraft.control;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
@@ -63,12 +64,12 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
final ItemStack stack = this.getItemStack();
|
||||
if (stack.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<String> list = stack.getTooltip(((Window) this.getTopParent()).getPlayer(), false);
|
||||
List<String> list = stack.getTooltip(((Window) this.getTopParent()).getPlayer(), tooltipFlag);
|
||||
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
if (i == 0) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.core.gui.minecraft.control;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -32,7 +33,7 @@ public class ControlUser extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
tooltip.setType(Tooltip.Type.USER);
|
||||
tooltip.add("Owner");
|
||||
if (!Objects.equals(this.username, "")) {
|
||||
|
||||
@@ -7,11 +7,11 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.RenderItem;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.VertexBuffer;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
@@ -80,7 +80,7 @@ public class RenderUtil {
|
||||
private static FontRenderer getFontRenderer(Minecraft minecraft, ItemStack ingredient) {
|
||||
FontRenderer fontRenderer = ingredient.getItem().getFontRenderer(ingredient);
|
||||
if (fontRenderer == null) {
|
||||
fontRenderer = minecraft.fontRendererObj;
|
||||
fontRenderer = minecraft.fontRenderer;
|
||||
}
|
||||
return fontRenderer;
|
||||
}
|
||||
@@ -94,12 +94,12 @@ public class RenderUtil {
|
||||
vMax = vMax - maskTop / 16.0 * (vMax - vMin);
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
VertexBuffer vertexBuffer = tessellator.getBuffer();
|
||||
vertexBuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
vertexBuffer.pos(xCoord, yCoord + 16, zLevel).tex(uMin, vMax).endVertex();
|
||||
vertexBuffer.pos(xCoord + 16 - maskRight, yCoord + 16, zLevel).tex(uMax, vMax).endVertex();
|
||||
vertexBuffer.pos(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).tex(uMax, vMin).endVertex();
|
||||
vertexBuffer.pos(xCoord, yCoord + maskTop, zLevel).tex(uMin, vMin).endVertex();
|
||||
BufferBuilder bufferBuilder = tessellator.getBuffer();
|
||||
bufferBuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
bufferBuilder.pos(xCoord, yCoord + 16, zLevel).tex(uMin, vMax).endVertex();
|
||||
bufferBuilder.pos(xCoord + 16 - maskRight, yCoord + 16, zLevel).tex(uMax, vMax).endVertex();
|
||||
bufferBuilder.pos(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).tex(uMax, vMin).endVertex();
|
||||
bufferBuilder.pos(xCoord, yCoord + maskTop, zLevel).tex(uMin, vMin).endVertex();
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
@@ -119,13 +119,13 @@ public class RenderUtil {
|
||||
}
|
||||
|
||||
public static int getTextWidth(final String text) {
|
||||
FontRenderer fontRendererObj = Minecraft.getMinecraft().fontRendererObj;
|
||||
return fontRendererObj.getStringWidth(text);
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
return fontRenderer.getStringWidth(text);
|
||||
}
|
||||
|
||||
public static int getTextHeight() {
|
||||
FontRenderer fontRendererObj = Minecraft.getMinecraft().fontRendererObj;
|
||||
return (fontRendererObj == null) ? 0 : fontRendererObj.FONT_HEIGHT;
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
return (fontRenderer == null) ? 0 : fontRenderer.FONT_HEIGHT;
|
||||
}
|
||||
|
||||
public static void drawText(final Point pos, final String text, final int colour) {
|
||||
@@ -137,8 +137,8 @@ public class RenderUtil {
|
||||
if (area.size().xPos() <= 0.0f) {
|
||||
return;
|
||||
}
|
||||
FontRenderer fontRendererObj = Minecraft.getMinecraft().fontRendererObj;
|
||||
final List<String> wrappedStrings = fontRendererObj.listFormattedStringToWidth(text, area.size().xPos());
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
final List<String> wrappedStrings = fontRenderer.listFormattedStringToWidth(text, area.size().xPos());
|
||||
final float totalHeight = wrappedStrings.size() * getTextHeight();
|
||||
float posY = pos.yPos();
|
||||
if (area.size().yPos() > totalHeight) {
|
||||
@@ -149,7 +149,7 @@ public class RenderUtil {
|
||||
float posX = area.size().xPos() - stringWidth;
|
||||
posX *= justification.getXOffset();
|
||||
GlStateManager.disableDepth();
|
||||
fontRendererObj.drawString(string, (int) (pos.xPos() + posX), (int) posY, colour);
|
||||
fontRenderer.drawString(string, (int) (pos.xPos() + posX), (int) posY, colour);
|
||||
posY += getTextHeight();
|
||||
}
|
||||
GlStateManager.color(1.0f, 1.0f, 1.0f);
|
||||
|
||||
@@ -181,7 +181,7 @@ public class TextureRenderer {
|
||||
|
||||
public int textHeight(final String text, final int width) {
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
FontRenderer fontRenderer = minecraft.fontRendererObj;
|
||||
FontRenderer fontRenderer = minecraft.fontRenderer;
|
||||
return fontRenderer.listFormattedStringToWidth(text, width).size() * RenderUtil.getTextHeight();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -57,14 +59,14 @@ public class ItemFieldKit extends ItemCore {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack p_77624_1_, final EntityPlayer p_77624_2_, final List<String> p_77624_3_, final boolean p_77624_4_) {
|
||||
final int i = p_77624_1_.getMaxDamage() - p_77624_1_.getItemDamage();
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
final int i = stack.getMaxDamage() - stack.getItemDamage();
|
||||
if (i == 0) {
|
||||
p_77624_3_.add("No paper");
|
||||
tooltip.add("No paper");
|
||||
} else {
|
||||
p_77624_3_.add("" + i + " sheet" + ((i > 1) ? "s" : "") + " of paper");
|
||||
tooltip.add("" + i + " sheet" + ((i > 1) ? "s" : "") + " of paper");
|
||||
}
|
||||
super.addInformation(p_77624_1_, p_77624_2_, p_77624_3_, p_77624_4_);
|
||||
super.addInformation(stack, worldIn, tooltip, flagIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -25,11 +28,12 @@ public class ItemMisc extends ItemCore {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item itemIn, final CreativeTabs creativeTabs, NonNullList<ItemStack> subItems) {
|
||||
for (IItemMiscProvider item : this.items) {
|
||||
if (item.isActive()) {
|
||||
subItems.add(this.getStack(item, 1));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (IItemMiscProvider item : this.items) {
|
||||
if (item.isActive()) {
|
||||
items.add(this.getStack(item, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,8 +48,8 @@ public class ItemMisc extends ItemCore {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
super.addInformation(stack, worldIn, tooltip, flagIn);
|
||||
IItemMiscProvider item = this.getItem(stack.getItemDamage());
|
||||
item.addInformation(tooltip);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -24,6 +26,7 @@ public class ModuleItems implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new ItemStack(BinnieCore.getFieldKit(), 1, 63), "g ", " is", " pi", 'g', Blocks.GLASS_PANE, 'i', Items.IRON_INGOT, 'p', Items.PAPER, 's', new ItemStack(Items.DYE, 1));
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.CORE_MOD_ID);
|
||||
recipeUtil.addRecipe("field_kit", new ItemStack(BinnieCore.getFieldKit(), 1, 63), "g ", " is", " pi", 'g', Blocks.GLASS_PANE, 'i', Items.IRON_INGOT, 'p', Items.PAPER, 's', new ItemStack(Items.DYE, 1));
|
||||
}
|
||||
}
|
||||
@@ -63,17 +63,18 @@ public class ItemFluidContainer extends ItemFood implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final NonNullList<ItemStack> subItems) {
|
||||
super.getSubItems(item, tab, subItems);
|
||||
for (final IFluidType liquid : Binnie.LIQUID.fluids.values()) {
|
||||
if (!liquid.canPlaceIn(this.container)) {
|
||||
continue;
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
super.getSubItems(tab, items);
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (final IFluidType liquid : Binnie.LIQUID.fluids.values()) {
|
||||
if (!liquid.canPlaceIn(this.container)) {
|
||||
continue;
|
||||
}
|
||||
if (!liquid.showInCreative(this.container)) {
|
||||
continue;
|
||||
}
|
||||
items.add(getContainer(liquid));
|
||||
}
|
||||
if (!liquid.showInCreative(this.container)) {
|
||||
continue;
|
||||
}
|
||||
subItems.add(getContainer(liquid));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -67,12 +69,13 @@ public class ManagerLiquid extends ManagerBase {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addShapelessRecipe(FluidContainerType.GLASS.get(1), Items.GLASS_BOTTLE);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.GLASS_BOTTLE), FluidContainerType.GLASS.get(1));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(FluidContainerType.GLASS.get(3),
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.CORE_MOD_ID);
|
||||
recipeUtil.addShapelessRecipe("glass_container_conversion", FluidContainerType.GLASS.get(1), Items.GLASS_BOTTLE);
|
||||
recipeUtil.addShapelessRecipe("glass_bottle_conversion", new ItemStack(Items.GLASS_BOTTLE), FluidContainerType.GLASS.get(1));
|
||||
recipeUtil.addRecipe("glass_container", FluidContainerType.GLASS.get(3),
|
||||
" b ", "g g", " g ",
|
||||
'g', OreDictUtil.BLOCK_GLASS, 'b', OreDictUtil.SLAB_WOOD
|
||||
));
|
||||
);
|
||||
}
|
||||
|
||||
public IFluidType getFluidType(final String liquid) {
|
||||
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -54,7 +55,7 @@ class BlockMachine extends Block implements IBlockMachine, ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (final MachinePackage pack : this.group.getPackages()) {
|
||||
if (pack.isActive()) {
|
||||
itemList.add(new ItemStack(this, 1, pack.getMetadata()));
|
||||
@@ -108,9 +109,10 @@ class BlockMachine extends Block implements IBlockMachine, ITileEntityProvider {
|
||||
MachinePackage machinePackage = this.getPackage(meta);
|
||||
return (machinePackage == null) ? "Unnamed Machine" : machinePackage.getDisplayName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
if (GuiScreen.isShiftKeyDown()) {
|
||||
MachinePackage machinePackage = this.getPackage(stack.getMetadata());
|
||||
@@ -121,7 +123,7 @@ class BlockMachine extends Block implements IBlockMachine, ITileEntityProvider {
|
||||
tooltip.add(TextFormatting.ITALIC + "<" + Translator.translateToLocal("for.gui.tooltip.tmi") + ">");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return state.getValue(MACHINE_TYPE);
|
||||
@@ -147,14 +149,9 @@ class BlockMachine extends Block implements IBlockMachine, ITileEntityProvider {
|
||||
}
|
||||
TileEntity tileEntity = worldIn.getTileEntity(pos);
|
||||
if (tileEntity != null) {
|
||||
if (tileEntity.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, facing)) {
|
||||
IFluidHandler tileFluidHandler = tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, facing);
|
||||
ItemStack heldItem = playerIn.getHeldItem(hand);
|
||||
FluidActionResult actionResult = FluidUtil.interactWithFluidHandler(heldItem, tileFluidHandler, playerIn);
|
||||
if (actionResult.isSuccess()) {
|
||||
playerIn.setHeldItem(hand, actionResult.getResult());
|
||||
return true;
|
||||
}
|
||||
IFluidHandler tileFluidHandler = tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, facing);
|
||||
if (tileFluidHandler != null && FluidUtil.interactWithFluidHandler(playerIn, hand, tileFluidHandler)) {
|
||||
return true;
|
||||
}
|
||||
if (tileEntity instanceof TileEntityMachine) {
|
||||
((TileEntityMachine) tileEntity).getMachine().onRightClick(worldIn, playerIn, pos);
|
||||
|
||||
@@ -24,6 +24,7 @@ import binnie.core.machines.power.PowerSystem;
|
||||
import binnie.core.util.ItemStackSet;
|
||||
|
||||
public class MachineUtil {
|
||||
private static final Random DAMAGE_RANDOM = new Random();
|
||||
private IMachine machine;
|
||||
|
||||
public MachineUtil(final IMachine machine) {
|
||||
@@ -103,8 +104,10 @@ public class MachineUtil {
|
||||
public void damageItem(final ItemStack item, final int slot, final int damage) {
|
||||
if (damage < 0) {
|
||||
item.setItemDamage(Math.max(0, item.getItemDamage() + damage));
|
||||
} else if (item.attemptDamageItem(damage, new Random())) {
|
||||
this.setStack(slot, ItemStack.EMPTY);
|
||||
} else {
|
||||
if (item.attemptDamageItem(damage, DAMAGE_RANDOM, null)) {
|
||||
this.setStack(slot, ItemStack.EMPTY);
|
||||
}
|
||||
}
|
||||
this.setStack(slot, item);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
public class TileEntityMachineRenderer extends TileEntitySpecialRenderer<TileEntityMachine> {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntityMachine te, double x, double y, double z, float partialTicks, int destroyStage) {
|
||||
public void render(TileEntityMachine te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||
if (te != null && te.getMachine() != null) {
|
||||
te.getMachine().getPackage().renderMachine(te.getMachine(), x, y, z, partialTicks, destroyStage);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -22,7 +23,7 @@ class ControlColourSelector extends Control implements ITooltip, IControlValue<E
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
public void getTooltip(final Tooltip tooltip, ITooltipFlag tooltipFlag) {
|
||||
tooltip.add(this.value.toString());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -27,14 +29,15 @@ public class ModuleStorage implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.CORE_MOD_ID);
|
||||
final String ironGear = OreDictionary.getOres("gearIron").isEmpty() ? "ingotIron" : "gearIron";
|
||||
final String goldGear = OreDictionary.getOres("gearGold").isEmpty() ? "ingotGold" : "gearGold";
|
||||
final String diamondGear = "gemDiamond";
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.Compartment.get(1), "pcp", "cbc", "pcp", 'b', Items.BOOK, 'c', Blocks.CHEST, 'p', Blocks.STONE_BUTTON));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentCopper.get(1), "pcp", "cbc", "pcp", 'b', Compartment.Compartment.get(1), 'c', "gearCopper", 'p', Blocks.STONE_BUTTON));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentBronze.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', "gearBronze", 'p', Items.GOLD_NUGGET));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentIron.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', ironGear, 'p', Items.GOLD_NUGGET));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentGold.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentIron.get(1), 'c', goldGear, 'p', Items.EMERALD));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(Compartment.CompartmentDiamond.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentGold.get(1), 'c', diamondGear, 'p', Items.EMERALD));
|
||||
recipeUtil.addRecipe("compartment", Compartment.Compartment.get(1), "pcp", "cbc", "pcp", 'b', Items.BOOK, 'c', Blocks.CHEST, 'p', Blocks.STONE_BUTTON);
|
||||
recipeUtil.addRecipe("compartment_copper", Compartment.CompartmentCopper.get(1), "pcp", "cbc", "pcp", 'b', Compartment.Compartment.get(1), 'c', "gearCopper", 'p', Blocks.STONE_BUTTON);
|
||||
recipeUtil.addRecipe("compartment_bronze", Compartment.CompartmentBronze.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', "gearBronze", 'p', Items.GOLD_NUGGET);
|
||||
recipeUtil.addRecipe("compartment_iron", Compartment.CompartmentIron.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentCopper.get(1), 'c', ironGear, 'p', Items.GOLD_NUGGET);
|
||||
recipeUtil.addRecipe("compartment_gold", Compartment.CompartmentGold.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentIron.get(1), 'c', goldGear, 'p', Items.EMERALD);
|
||||
recipeUtil.addRecipe("compartment_diamond", Compartment.CompartmentDiamond.get(1), "pcp", "cbc", "pcp", 'b', Compartment.CompartmentGold.get(1), 'c', diamondGear, 'p', Items.EMERALD);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.core.models;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
@@ -8,6 +7,7 @@ import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -28,8 +28,8 @@ import net.minecraft.util.registry.IRegistry;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.model.IPerspectiveAwareModel;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.PerspectiveMapWrapper;
|
||||
import net.minecraftforge.client.model.SimpleModelState;
|
||||
import net.minecraftforge.common.model.IModelState;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
@@ -98,7 +98,7 @@ public class ModelManager implements IModelManager {
|
||||
private static IModelState mergeStates(IModelState state, IModelState secondaryState) {
|
||||
Map<TransformType, TRSRTransformation> tMap = Maps.newHashMap();
|
||||
TRSRTransformation guiTransformation = secondaryState.apply(Optional.of(TransformType.GUI)).get();
|
||||
tMap.putAll(IPerspectiveAwareModel.MapWrapper.getTransforms(state));
|
||||
tMap.putAll(PerspectiveMapWrapper.getTransforms(state));
|
||||
tMap.put(TransformType.GUI, guiTransformation);
|
||||
return new SimpleModelState(ImmutableMap.copyOf(tMap));
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public enum BinnieCorePacketID implements IPacketID {
|
||||
}
|
||||
} else if (this == BinnieCorePacketID.CRAFT_GUI_ACTION && context.side == Side.SERVER && context.netHandler instanceof NetHandlerPlayServer) {
|
||||
final MessageCraftGUI packet3 = new MessageCraftGUI(message);
|
||||
final EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).playerEntity;
|
||||
final EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).player;
|
||||
if (player.openContainer instanceof ContainerCraftGUI && packet3.getTagCompound() != null) {
|
||||
((ContainerCraftGUI) player.openContainer).receiveNBTServer(player, packet3.getTagCompound());
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public abstract class BinniePacketHandler implements IMessageHandler<MessageBinn
|
||||
public static class ServerProxy extends MessageProxy {
|
||||
@Override
|
||||
public void onMessage(IPacketID id, MessageBinnie message, MessageContext ctx) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
EntityPlayerMP player = ctx.getServerHandler().player;
|
||||
checkThreadAndEnqueue(id, message, ctx, player.getServerWorld());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,8 @@ public class BinnieModProxy implements IBinnieModProxy {
|
||||
|
||||
@Override
|
||||
public Block registerBlock(Block block) {
|
||||
return GameRegistry.register(block);
|
||||
ForgeRegistries.BLOCKS.register(block);
|
||||
return block;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,8 +2,8 @@ package binnie.core.util;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.world.WorldSavedData;
|
||||
import net.minecraft.world.storage.MapStorage;
|
||||
import net.minecraft.world.storage.WorldSavedData;
|
||||
|
||||
public class FakeMapStorage extends MapStorage {
|
||||
public FakeMapStorage() {
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package binnie.core.util;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class RecipeUtil {
|
||||
private final String modId;
|
||||
|
||||
public RecipeUtil(String modId) {
|
||||
this.modId = modId;
|
||||
}
|
||||
|
||||
public void addRecipe(String recipeName, Block block, Object... obj) {
|
||||
addRecipe(recipeName, new ItemStack(block), obj);
|
||||
}
|
||||
|
||||
public void addRecipe(String recipeName, Item item, Object... obj) {
|
||||
addRecipe(recipeName, new ItemStack(item), obj);
|
||||
}
|
||||
|
||||
public void addRecipe(String recipeName, ItemStack itemstack, Object... obj) {
|
||||
ShapedOreRecipe recipe = new ShapedOreRecipe(null, itemstack, obj);
|
||||
recipe.setRegistryName(modId, recipeName);
|
||||
ForgeRegistries.RECIPES.register(recipe);
|
||||
}
|
||||
|
||||
public void addShapelessRecipe(String recipeName, ItemStack itemstack, Object... obj) {
|
||||
ShapelessOreRecipe recipe = new ShapelessOreRecipe(null, itemstack, obj);
|
||||
recipe.setRegistryName(modId, recipeName);
|
||||
ForgeRegistries.RECIPES.register(recipe);
|
||||
}
|
||||
}
|
||||
@@ -60,9 +60,9 @@ public class BlockAlveary extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (int i = 0; i < EnumAlvearyLogicType.VALUES.length; i++) {
|
||||
list.add(new ItemStack(itemIn, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public class BlockExtraBeeHive extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(@Nonnull final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (int i = 0; i < EnumHiveType.values().length; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ContainerStimulator extends AbstractAlvearyContainer {
|
||||
public void checkPower() {
|
||||
if (power != storage.getEnergyStored()) {
|
||||
for (IContainerListener listener : listeners) {
|
||||
listener.sendProgressBarUpdate(this, 9, power = storage.getEnergyStored());
|
||||
listener.sendWindowProperty(this, 9, power = storage.getEnergyStored());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class GuiContainerAlvearyPart extends GuiContainer {
|
||||
public GuiContainerAlvearyPart(AbstractAlvearyContainer container) {
|
||||
super(container);
|
||||
this.container = container;
|
||||
font = Minecraft.getMinecraft().fontRendererObj;
|
||||
font = Minecraft.getMinecraft().fontRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extrabees.init;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
@@ -30,12 +31,12 @@ public final class BlockRegister {
|
||||
}
|
||||
|
||||
private static void registerMisc() {
|
||||
GameRegistry.register(ExtraBees.ectoplasm = new BlockEctoplasm());
|
||||
ForgeRegistries.BLOCKS.register(ExtraBees.ectoplasm = new BlockEctoplasm());
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private static void registerHives() {
|
||||
GameRegistry.register(ExtraBees.hive = new BlockExtraBeeHive());
|
||||
ForgeRegistries.BLOCKS.register(ExtraBees.hive = new BlockExtraBeeHive());
|
||||
}
|
||||
|
||||
private static void registerHiveDrops() {
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package binnie.extrabees.init;
|
||||
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
@@ -30,10 +29,11 @@ import binnie.extrabees.items.types.ExtraBeeItems;
|
||||
import binnie.extrabees.utils.Utils;
|
||||
|
||||
public final class RecipeRegister {
|
||||
private static final RecipeUtil RECIPE_UTIL = new RecipeUtil(ExtraBees.MODID);
|
||||
|
||||
public static void postInitRecipes() {
|
||||
if (Loader.isModLoaded("ic2")) {
|
||||
GameRegistry.addRecipe(ExtraBees.honeyCrystal.getCharged(0), "#@#", "@#@", "#@#", '@', PluginApiculture.getItems().honeyDrop, '#', EnumHoneyDrop.ENERGY.get(1));
|
||||
RECIPE_UTIL.addRecipe("honey_crystal", ExtraBees.honeyCrystal.getCharged(0), "#@#", "@#@", "#@#", '@', PluginApiculture.getItems().honeyDrop, '#', EnumHoneyDrop.ENERGY.get(1));
|
||||
}
|
||||
for (final EnumHoneyComb info : EnumHoneyComb.values()) {
|
||||
info.addRecipe();
|
||||
@@ -44,7 +44,7 @@ public final class RecipeRegister {
|
||||
for (final EnumPropolis info3 : EnumPropolis.values()) {
|
||||
info3.addRecipe();
|
||||
}
|
||||
EnumHiveFrame.init();
|
||||
EnumHiveFrame.init(RECIPE_UTIL);
|
||||
addForestryRecipes();
|
||||
addForestryRecipes();
|
||||
addMiscItemRecipes();
|
||||
@@ -56,13 +56,13 @@ public final class RecipeRegister {
|
||||
Item thermionicTubes = PluginCore.getItems().tubes;
|
||||
Item chipsets = PluginCore.getItems().circuitboards;
|
||||
|
||||
GameRegistry.addRecipe(getAlvearyPart(EnumAlvearyLogicType.MUTATOR), "g g", " a ", "t t", 'g', Items.GOLD_INGOT, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 5));
|
||||
GameRegistry.addRecipe(getAlvearyPart(EnumAlvearyLogicType.FRAME), "iii", "tat", " t ", 'i', Items.IRON_INGOT, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
GameRegistry.addRecipe(getAlvearyPart(EnumAlvearyLogicType.RAINSHIELD), " b ", "bab", "t t", 'b', Items.BRICK, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
GameRegistry.addRecipe(getAlvearyPart(EnumAlvearyLogicType.LIGHTING), "iii", "iai", " t ", 'i', Items.GLOWSTONE_DUST, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
GameRegistry.addRecipe(getAlvearyPart(EnumAlvearyLogicType.STIMULATOR), "kik", "iai", " t ", 'i', Items.GOLD_NUGGET, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4), 'k', new ItemStack(chipsets, 1, 2));
|
||||
GameRegistry.addRecipe(getAlvearyPart(EnumAlvearyLogicType.HATCHERY), "i i", " a ", "iti", 'i', Blocks.GLASS_PANE, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 5));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(getAlvearyPart(EnumAlvearyLogicType.TRANSMISSION), " t ", "tat", " t ", 'a', alveary, 't', "gearTin"));
|
||||
RECIPE_UTIL.addRecipe("alveary_mutator", getAlvearyPart(EnumAlvearyLogicType.MUTATOR), "g g", " a ", "t t", 'g', Items.GOLD_INGOT, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 5));
|
||||
RECIPE_UTIL.addRecipe("alveary_frame", getAlvearyPart(EnumAlvearyLogicType.FRAME), "iii", "tat", " t ", 'i', Items.IRON_INGOT, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
RECIPE_UTIL.addRecipe("alveary_rain_shield", getAlvearyPart(EnumAlvearyLogicType.RAINSHIELD), " b ", "bab", "t t", 'b', Items.BRICK, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
RECIPE_UTIL.addRecipe("alveary_lighting", getAlvearyPart(EnumAlvearyLogicType.LIGHTING), "iii", "iai", " t ", 'i', Items.GLOWSTONE_DUST, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
RECIPE_UTIL.addRecipe("alveary_stimulator", getAlvearyPart(EnumAlvearyLogicType.STIMULATOR), "kik", "iai", " t ", 'i', Items.GOLD_NUGGET, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4), 'k', new ItemStack(chipsets, 1, 2));
|
||||
RECIPE_UTIL.addRecipe("alveary_hatchery", getAlvearyPart(EnumAlvearyLogicType.HATCHERY), "i i", " a ", "iti", 'i', Blocks.GLASS_PANE, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 5));
|
||||
RECIPE_UTIL.addRecipe("alveary_transmission", getAlvearyPart(EnumAlvearyLogicType.TRANSMISSION), " t ", "tat", " t ", 'a', alveary, 't', "gearTin");
|
||||
ICircuitLayout stimulatorLayout = new BinnieCircuitLayout("Stimulator", BinnieCircuitSocketType.STIMULATOR);
|
||||
for (final AlvearySimulatorCircuitType type : AlvearySimulatorCircuitType.values()) {
|
||||
type.createCircuit(stimulatorLayout);
|
||||
@@ -79,7 +79,7 @@ public final class RecipeRegister {
|
||||
|
||||
private static void addMiscItemRecipes() {
|
||||
final ItemStack lapisShard = ExtraBeeItems.LapisShard.get(1);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.DYE, 1, 4), lapisShard, lapisShard, lapisShard, lapisShard);
|
||||
RECIPE_UTIL.addShapelessRecipe("lapis_from_shards", new ItemStack(Items.DYE, 1, 4), lapisShard, lapisShard, lapisShard, lapisShard);
|
||||
for (final ExtraBeeItems item : ExtraBeeItems.values()) {
|
||||
if (item.metalString != null) {
|
||||
ItemStack dust = null;
|
||||
@@ -92,11 +92,11 @@ public final class RecipeRegister {
|
||||
}
|
||||
final ItemStack input = item.get(1);
|
||||
if (dust != null) {
|
||||
GameRegistry.addShapelessRecipe(dust, input, input, input, input);
|
||||
RECIPE_UTIL.addShapelessRecipe(item.getModelPath() + "_dust", dust, input, input, input, input);
|
||||
} else if (ingot != null) {
|
||||
GameRegistry.addShapelessRecipe(ingot, input, input, input, input, input, input, input, input, input);
|
||||
RECIPE_UTIL.addShapelessRecipe(item.getModelPath() + "_ingot", ingot, input, input, input, input, input, input, input, input, input);
|
||||
} else if (item == ExtraBeeItems.CoalDust) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.COAL), input, input, input, input);
|
||||
RECIPE_UTIL.addShapelessRecipe("coal_dust_to_coal", new ItemStack(Items.COAL), input, input, input, input);
|
||||
}
|
||||
} else if (item.gemString != null) {
|
||||
ItemStack gem = null;
|
||||
@@ -105,7 +105,7 @@ public final class RecipeRegister {
|
||||
}
|
||||
final ItemStack input2 = item.get(1);
|
||||
if (gem != null) {
|
||||
GameRegistry.addShapelessRecipe(gem.copy(), input2, input2, input2, input2, input2, input2, input2, input2, input2);
|
||||
RECIPE_UTIL.addShapelessRecipe(item.getModelPath() + "_gem", gem.copy(), input2, input2, input2, input2, input2, input2, input2, input2, input2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,11 @@ public class ItemBeehive extends ItemBlock implements IItemModelProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> subItems) {
|
||||
for (int i = 0; i < EnumHiveType.values().length; ++i) {
|
||||
subItems.add(new ItemStack(this, 1, i));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (int i = 0; i < EnumHiveType.values().length; ++i) {
|
||||
items.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -106,9 +108,9 @@ public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier, IIt
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
this.frame.addInformation(stack, playerIn, tooltip, advanced);
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
super.addInformation(stack, worldIn, tooltip, flagIn);
|
||||
this.frame.addInformation(stack, tooltip, flagIn);
|
||||
if (!stack.isItemDamaged()) {
|
||||
tooltip.add(Translator.translateToLocalFormatted("item.for.durability", stack.getMaxDamage()));
|
||||
}
|
||||
|
||||
@@ -148,19 +148,20 @@ public class ItemHoneyCrystal extends Item implements IElectricItem, IItemHudInf
|
||||
info.add(ElectricItem.manager.getToolTip(stack));
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
if(Mods.IC2.active()) {
|
||||
subItems.add(getCharged(0.0D));
|
||||
subItems.add(getCharged(1.0D / 0.0));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (Mods.IC2.active() && this.isInCreativeTab(tab)) {
|
||||
items.add(getCharged(0.0D));
|
||||
// TODO: @Nedelosk please fix
|
||||
// items.add(getCharged(1.0D / 0.0));
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "ic2")
|
||||
public ItemStack getCharged(double charge) {
|
||||
ItemStack ret = new ItemStack(this);
|
||||
// TODO: tier 2147483647 ?!
|
||||
ElectricItem.manager.charge(ret, charge, 2147483647, true, false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.extrabees.items;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -10,6 +11,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -34,21 +36,22 @@ public class ItemIndustrialFrame extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> subItems) {
|
||||
for (final IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
final ItemStack stack = new ItemStack(this);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
subItems.add(stack);
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (final IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
final ItemStack stack = new ItemStack(this);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
items.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
super.addInformation(stack, worldIn, tooltip, flagIn);
|
||||
final IndustrialFrame frame = getFrame(stack);
|
||||
if (frame == null) {
|
||||
tooltip.add("Invalid Contents");
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package binnie.extrabees.items;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -29,8 +32,8 @@ public class ItemMiscProduct extends ItemProduct {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
super.addInformation(stack, worldIn, tooltip, flagIn);
|
||||
((IEBItemMiscProvider) get(stack)).addInformation(tooltip);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,10 +41,12 @@ public class ItemProduct extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> subItems) {
|
||||
for (final IEBEnumItem type : this.types) {
|
||||
if (type.isActive()) {
|
||||
subItems.add(new ItemStack(this, 1, type.ordinal()));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (final IEBEnumItem type : this.types) {
|
||||
if (type.isActive()) {
|
||||
items.add(new ItemStack(this, 1, type.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ package binnie.extrabees.items.types;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -30,10 +31,10 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
|
||||
COCOA{
|
||||
@Override
|
||||
protected void init(ItemStack impregnatedFrame) {
|
||||
protected void init(RecipeUtil recipeUtil, ItemStack impregnatedFrame) {
|
||||
logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.25f);
|
||||
logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
|
||||
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.COCOA.item),
|
||||
recipeUtil.addRecipe("cocoa_frame", new ItemStack(EnumHiveFrame.COCOA.item),
|
||||
" c ",
|
||||
"cFc",
|
||||
" c ",
|
||||
@@ -43,29 +44,29 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
},
|
||||
CAGE{
|
||||
@Override
|
||||
protected void init(ItemStack impregnatedFrame) {
|
||||
protected void init(RecipeUtil recipeUtil, ItemStack impregnatedFrame) {
|
||||
logic.setModifier(EnumBeeModifier.TERRITORY, 0.5f, 0.1f);
|
||||
logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f);
|
||||
logic.setModifier(EnumBeeModifier.PRODUCTION, 0.75f, 0.5f);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.CAGE.item), impregnatedFrame, Blocks.IRON_BARS);
|
||||
recipeUtil.addShapelessRecipe("cage_frame", new ItemStack(EnumHiveFrame.CAGE.item), impregnatedFrame, Blocks.IRON_BARS);
|
||||
}
|
||||
},
|
||||
SOUL(80){
|
||||
@Override
|
||||
protected void init(ItemStack impregnatedFrame) {
|
||||
protected void init(RecipeUtil recipeUtil, ItemStack impregnatedFrame) {
|
||||
logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f);
|
||||
logic.setModifier(EnumBeeModifier.LIFESPAN, 0.75f, 0.5f);
|
||||
logic.setModifier(EnumBeeModifier.PRODUCTION, 0.25f, 0.1f);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.SOUL.item), impregnatedFrame, Blocks.SOUL_SAND);
|
||||
recipeUtil.addShapelessRecipe("soul_frame", new ItemStack(EnumHiveFrame.SOUL.item), impregnatedFrame, Blocks.SOUL_SAND);
|
||||
}
|
||||
},
|
||||
CLAY{
|
||||
@Override
|
||||
protected void init(ItemStack impregnatedFrame) {
|
||||
protected void init(RecipeUtil recipeUtil, ItemStack impregnatedFrame) {
|
||||
logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
|
||||
logic.setModifier(EnumBeeModifier.MUTATION, 0.5f, 0.2f);
|
||||
logic.setModifier(EnumBeeModifier.PRODUCTION, 0.75f, 0.2f);
|
||||
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.CLAY.item),
|
||||
recipeUtil.addRecipe("clay_frame", new ItemStack(EnumHiveFrame.CLAY.item),
|
||||
" c ",
|
||||
"cFc",
|
||||
" c ",
|
||||
@@ -75,7 +76,7 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
},
|
||||
DEBUG{
|
||||
@Override
|
||||
protected void init(ItemStack impregnatedFrame) {
|
||||
protected void init(RecipeUtil recipeUtil, ItemStack impregnatedFrame) {
|
||||
logic.setModifier(EnumBeeModifier.LIFESPAN, 1.0E-4f, 1.0E-4f);
|
||||
}
|
||||
};
|
||||
@@ -94,14 +95,14 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
this.item = new ItemHiveFrame(this).setRegistryName("hive_frame." + name().toLowerCase());
|
||||
}
|
||||
|
||||
protected void init(ItemStack impregnatedFrame){
|
||||
protected void init(RecipeUtil recipeUtil, ItemStack impregnatedFrame){
|
||||
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
public static void init(RecipeUtil recipeUtil) {
|
||||
ItemStack impregnatedFrame = PluginApiculture.getItems().frameImpregnated.getItemStack();
|
||||
for(EnumHiveFrame frame : values()){
|
||||
frame.init(impregnatedFrame);
|
||||
frame.init(recipeUtil, impregnatedFrame);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,8 +187,8 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
this.logic.addInformation(stack, playerIn, tooltip, advanced);
|
||||
public void addInformation(ItemStack stack, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
this.logic.addInformation(stack, tooltip, flagIn);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.extrabees.items.types;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import binnie.core.Mods;
|
||||
import com.google.common.base.MoreObjects;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -14,8 +15,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.core.PluginCore;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
@@ -512,7 +511,8 @@ public enum EnumHoneyComb implements IEBEnumItem {
|
||||
@Override
|
||||
protected void addSubtypes(ItemStack beeswax, ItemStack honeyDrop) {
|
||||
addProduct(honeyDrop, 0.25f);
|
||||
tryAddProduct(PluginCore.getItems().fertilizerBio.getItemStack(), 1.00f);
|
||||
ItemStack compost = Mods.Forestry.stack("fertilizer_bio");
|
||||
tryAddProduct(compost, 1.00f);
|
||||
}
|
||||
},
|
||||
SAWDUST(12561009, 15913854){
|
||||
@@ -636,8 +636,8 @@ public enum EnumHoneyComb implements IEBEnumItem {
|
||||
|
||||
public static void addSubtypes() {
|
||||
OreDictionary.registerOre("beeComb", new ItemStack(ExtraBees.comb, 1, 32767));
|
||||
ItemStack beeswax = PluginCore.getItems().beeswax.getItemStack();
|
||||
ItemStack honeyDrop = PluginApiculture.getItems().honeyDrop.getItemStack();
|
||||
ItemStack beeswax = Mods.Forestry.stack("beeswax");
|
||||
ItemStack honeyDrop = Mods.Forestry.stack("honey_drop");
|
||||
for(EnumHoneyComb comb : values()){
|
||||
comb.addSubtypes(beeswax, honeyDrop);
|
||||
}
|
||||
@@ -665,7 +665,7 @@ public enum EnumHoneyComb implements IEBEnumItem {
|
||||
}
|
||||
|
||||
public boolean addProduct(@Nullable Item item, final Float chance) {
|
||||
return addProduct(new ItemStack(Objects.firstNonNull(item, Item.getItemFromBlock(Blocks.AIR))), chance);
|
||||
return addProduct(new ItemStack(MoreObjects.firstNonNull(item, Item.getItemFromBlock(Blocks.AIR))), chance);
|
||||
}
|
||||
|
||||
public boolean addProduct(final ItemStack item, final Float chance) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import binnie.extrabees.genetics.ExtraBeeDefinition;
|
||||
|
||||
@@ -14,18 +14,20 @@ public class ExtraBeesCommonProxy {
|
||||
}
|
||||
|
||||
public Block registerBlock(Block block) {
|
||||
return GameRegistry.register(block);
|
||||
ForgeRegistries.BLOCKS.register(block);
|
||||
return block;
|
||||
}
|
||||
|
||||
public Item registerItem(Item item) {
|
||||
return GameRegistry.register(item);
|
||||
ForgeRegistries.ITEMS.register(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public String localise(String s) {
|
||||
return I18n.translateToLocal("extrabees." + s);
|
||||
}
|
||||
|
||||
|
||||
public String localiseWithOutPrefix(String s) {
|
||||
return I18n.translateToLocal(s);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -55,7 +55,7 @@ public class BeeModifierLogic {
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
for (Map.Entry<EnumBeeModifier, Float[]> modifier : modifiers.entrySet()) {
|
||||
final EnumBeeModifier key = modifier.getKey();
|
||||
final Float[] value = modifier.getValue();
|
||||
|
||||
@@ -3,8 +3,8 @@ package binnie.extrabees.worldgen;
|
||||
import binnie.extrabees.utils.config.ConfigurationMain;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkGenerator;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
import net.minecraftforge.fml.common.IWorldGenerator;
|
||||
|
||||
import java.util.LinkedList;
|
||||
@@ -26,7 +26,7 @@ public class ExtraBeesWorldGenerator implements IWorldGenerator {
|
||||
|
||||
@Override
|
||||
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
|
||||
worldGenHives.stream().forEach(hive -> generateHive(hive, rand, chunkX, chunkZ, world));
|
||||
worldGenHives.forEach(hive -> generateHive(hive, rand, chunkX, chunkZ, world));
|
||||
}
|
||||
|
||||
private void generateHive(WorldGenHive hive, Random rand, int chunkX, int chunkZ, World world) {
|
||||
|
||||
@@ -101,12 +101,13 @@ public class ItemDrink extends ItemFood implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item item, final CreativeTabs creativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
for (final Glassware glassware : Glassware.values()) {
|
||||
itemList.add(this.getStack(glassware, null));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
for (final Glassware glassware : Glassware.values()) {
|
||||
items.add(this.getStack(glassware, null));
|
||||
}
|
||||
items.add(this.getStack(Glassware.Wine, Alcohol.RedWine.get(Glassware.Wine.getCapacity())));
|
||||
}
|
||||
itemList.add(this.getStack(Glassware.Wine, Alcohol.RedWine.get(Glassware.Wine.getCapacity())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -89,12 +89,11 @@ public abstract class BlockETDecorativeLeaves extends Block implements IItemMode
|
||||
/**
|
||||
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (IBlockState state : getBlockState().getValidStates()) {
|
||||
int meta = getMetaFromState(state);
|
||||
ItemStack itemStack = new ItemStack(item, 1, meta);
|
||||
ItemStack itemStack = new ItemStack(this, 1, meta);
|
||||
list.add(itemStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,35 +130,31 @@ public abstract class BlockETDefaultLeaves extends BlockAbstractLeaves {
|
||||
int variantMeta = (meta % variantCount) + blockNumber * VARIANTS_PER_BLOCK;
|
||||
return ETTreeDefinition.byMetadata(variantMeta);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected NonNullList<ItemStack> getLeafDrop(World world, @Nullable GameProfile playerProfile, BlockPos pos, float saplingModifier, int fortune) {
|
||||
NonNullList<ItemStack> prod = NonNullList.create();
|
||||
|
||||
protected void getLeafDrop(NonNullList<ItemStack> drops, World world, @Nullable GameProfile playerProfile, BlockPos pos, float saplingModifier, int fortune) {
|
||||
ITree tree = getTree(world, pos);
|
||||
if (tree == null) {
|
||||
return prod;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Add saplings
|
||||
List<ITree> saplings = tree.getSaplings(world, playerProfile, pos, saplingModifier);
|
||||
for (ITree sapling : saplings) {
|
||||
if (sapling != null) {
|
||||
prod.add(TreeManager.treeRoot.getMemberStack(sapling, EnumGermlingType.SAPLING));
|
||||
drops.add(TreeManager.treeRoot.getMemberStack(sapling, EnumGermlingType.SAPLING));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add fruits
|
||||
ITreeGenome genome = tree.getGenome();
|
||||
IFruitProvider fruitProvider = genome.getFruitProvider();
|
||||
if (fruitProvider.isFruitLeaf(genome, world, pos)) {
|
||||
NonNullList<ItemStack> produceStacks = tree.produceStacks(world, pos, Integer.MAX_VALUE);
|
||||
prod.addAll(produceStacks);
|
||||
drops.addAll(produceStacks);
|
||||
}
|
||||
|
||||
return prod;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
|
||||
ETTreeDefinition type = getTreeType(meta);
|
||||
|
||||
@@ -42,7 +42,7 @@ public enum EnumETLog implements IWoodType {
|
||||
Eucalyptus("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Box("Box", PlankType.ExtraTreePlanks.Box),
|
||||
Syzgium("Syzgium", PlankType.ExtraTreePlanks.Syzgium),
|
||||
PinkIvory("Pink Ivory", PlankType.ExtraTreePlanks.PinkIvory),
|
||||
PinkIvory("PinkIvory", PlankType.ExtraTreePlanks.PinkIvory),
|
||||
Eucalyptus2("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus, false),
|
||||
Eucalyptus3("Eucalyptus", PlankType.ExtraTreePlanks.Eucalyptus, false),
|
||||
Cherry("Cherry", PlankType.ForestryPlanks.CHERRY, false),
|
||||
@@ -51,6 +51,7 @@ public enum EnumETLog implements IWoodType {
|
||||
public static final EnumETLog[] VALUES = values();
|
||||
|
||||
private final String name;
|
||||
private final String uid;
|
||||
private final IPlankType plank;
|
||||
private final boolean hasProducts;
|
||||
|
||||
@@ -60,6 +61,7 @@ public enum EnumETLog implements IWoodType {
|
||||
|
||||
EnumETLog(final String name, final IPlankType plank, boolean hasProducts) {
|
||||
this.name = name;
|
||||
this.uid = name.toLowerCase(Locale.ENGLISH).replace(" ", "_");
|
||||
this.plank = plank;
|
||||
this.hasProducts = hasProducts;
|
||||
}
|
||||
@@ -113,8 +115,7 @@ public enum EnumETLog implements IWoodType {
|
||||
|
||||
@Override
|
||||
public String getHeartTexture() {
|
||||
String name = name().toLowerCase(Locale.ENGLISH).replace(" ", "_");
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":blocks/logs/" + name + "_trunk";
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":blocks/logs/" + uid + "_trunk";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -129,8 +130,7 @@ public enum EnumETLog implements IWoodType {
|
||||
|
||||
@Override
|
||||
public String getBarkTexture() {
|
||||
String name = name().toLowerCase(Locale.ENGLISH).replace(" ", "_");
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":blocks/logs/" + name + "_bark";
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":blocks/logs/" + uid + "_bark";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,5 +146,9 @@ public enum EnumETLog implements IWoodType {
|
||||
public int getMetadata() {
|
||||
return ordinal();
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ItemBlockETDecorativeLeaves extends ItemBlockForestry<BlockETDecora
|
||||
int meta = itemStack.getMetadata();
|
||||
BlockETDecorativeLeaves block = getBlock();
|
||||
ETTreeDefinition treeDefinition = block.getTreeType(meta);
|
||||
if (treeDefinition == null) {
|
||||
if (treeDefinition == null || treeDefinition.getGenome() == null) {
|
||||
return Translator.translateToLocal("trees.grammar.leaves.type");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.core.util.RecipeUtil;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -15,6 +16,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
|
||||
@@ -36,7 +38,6 @@ import forestry.arboriculture.blocks.BlockForestryFenceGate;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import forestry.arboriculture.items.ItemBlockLeaves;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
|
||||
@@ -321,10 +322,11 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
RecipeUtil recipeUtil = new RecipeUtil(Constants.EXTRA_TREES_MOD_ID);
|
||||
for (BlockETLog log : logs) {
|
||||
ItemStack logInput = new ItemStack(log, 1, OreDictionary.WILDCARD_VALUE);
|
||||
ItemStack coalOutput = new ItemStack(Items.COAL, 1, 1);
|
||||
RecipeUtil.addSmelting(logInput, coalOutput, 0.15F);
|
||||
GameRegistry.addSmelting(logInput, coalOutput, 0.15F);
|
||||
}
|
||||
|
||||
IWoodAccess woodAccess = TreeManager.woodAccess;
|
||||
@@ -335,10 +337,10 @@ public class ModuleBlocks implements IInitializable {
|
||||
ItemStack fireproofPlanks = log.getPlank().getStack(true);
|
||||
|
||||
planks.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(planks.copy(), logs.copy());
|
||||
recipeUtil.addShapelessRecipe(log.getUid() + "_planks", planks.copy(), logs.copy());
|
||||
|
||||
fireproofPlanks.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(fireproofPlanks.copy(), fireproofLogs);
|
||||
recipeUtil.addShapelessRecipe(log.getUid() + "_fireproof_planks", fireproofPlanks.copy(), fireproofLogs);
|
||||
|
||||
if (ForestryAPI.enabledPlugins.containsAll(Arrays.asList(ForestryPluginUids.FACTORY, ForestryPluginUids.APICULTURE))) {
|
||||
|
||||
@@ -360,9 +362,13 @@ public class ModuleBlocks implements IInitializable {
|
||||
ItemStack fences = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.FENCE, fireproof);
|
||||
ItemStack fenceGates = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.FENCE_GATE, fireproof);
|
||||
ItemStack stairs = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.STAIRS, fireproof);
|
||||
|
||||
|
||||
String plankUid = plankType.getWoodType().getUid();
|
||||
if (fireproof) {
|
||||
plankUid += "_fireproof";
|
||||
}
|
||||
stairs.setCount(4);
|
||||
RecipeUtil.addPriorityRecipe(stairs.copy(),
|
||||
recipeUtil.addRecipe(plankUid + "_stairs", stairs.copy(),
|
||||
"# ",
|
||||
"## ",
|
||||
"###",
|
||||
@@ -370,18 +376,18 @@ public class ModuleBlocks implements IInitializable {
|
||||
);
|
||||
|
||||
slabs.setCount(6);
|
||||
RecipeUtil.addPriorityRecipe(slabs.copy(), "###", '#', planks.copy());
|
||||
recipeUtil.addRecipe(plankUid + "_slabs", slabs.copy(), "###", '#', planks.copy());
|
||||
|
||||
fences.setCount(3);
|
||||
planks.setCount(1);
|
||||
RecipeUtil.addRecipe(fences.copy(),
|
||||
recipeUtil.addRecipe(plankUid + "_fences", fences.copy(),
|
||||
"#X#",
|
||||
"#X#",
|
||||
'#', planks.copy(), 'X', "stickWood");
|
||||
|
||||
fenceGates.setCount(1);
|
||||
planks.setCount(1);
|
||||
RecipeUtil.addRecipe(fenceGates.copy(),
|
||||
recipeUtil.addRecipe(plankUid + "_fence_gates", fenceGates.copy(),
|
||||
"X#X",
|
||||
"X#X",
|
||||
'#', planks.copy(), 'X', "stickWood");
|
||||
@@ -390,7 +396,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
ItemStack doors = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.DOOR, false);
|
||||
doors.setCount(3);
|
||||
planks.setCount(1);
|
||||
RecipeUtil.addPriorityRecipe(doors.copy(),
|
||||
recipeUtil.addRecipe(plankUid + "_doors", doors.copy(),
|
||||
"## ",
|
||||
"## ",
|
||||
"## ",
|
||||
@@ -411,9 +417,9 @@ public class ModuleBlocks implements IInitializable {
|
||||
'X', planks.copy()});
|
||||
}
|
||||
}
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSize());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeEmbedded());
|
||||
GameRegistry.addRecipe(new MultiFenceRecipeSolid());
|
||||
ForgeRegistries.RECIPES.register(new MultiFenceRecipeSize());
|
||||
ForgeRegistries.RECIPES.register(new MultiFenceRecipeEmbedded());
|
||||
ForgeRegistries.RECIPES.register(new MultiFenceRecipeSolid());
|
||||
this.addSqueezer(EnumVanillaWoodType.SPRUCE, ExtraTreeLiquid.Resin, 50);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,11 +178,10 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final NonNullList<ItemStack> list) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int f = 0; f < 2; ++f) {
|
||||
list.add(new ItemStack(item, 1, i + f * 8));
|
||||
list.add(new ItemStack(this, 1, i + f * 8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,26 +112,6 @@ public class BlockMultiFence extends BlockFence implements IBlockMetadata, IStat
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
if (PluginArboriculture.validFences.contains(block)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block != Blocks.BARRIER) {
|
||||
Material blockMaterial = block.getMaterial(state);
|
||||
if (block instanceof BlockFence || block instanceof BlockFenceGate || block instanceof IBlockFence) {
|
||||
return blockMaterial == this.blockMaterial;
|
||||
}
|
||||
if (blockMaterial.isOpaque() && state.isFullCube() && blockMaterial != Material.GOURD) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
super.breakBlock(world, pos, state);
|
||||
@@ -173,9 +153,8 @@ public class BlockMultiFence extends BlockFence implements IBlockMetadata, IStat
|
||||
return ((IExtendedBlockState) state).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (FenceType type : FenceType.values()) {
|
||||
itemList.add(WoodManager.getFence(PlankType.VanillaPlanks.SPRUCE, PlankType.VanillaPlanks.BIRCH, type, 1));
|
||||
}
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.Constants;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
public class MultiFenceRecipeEmbedded implements IRecipe {
|
||||
public class MultiFenceRecipeEmbedded extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
private ItemStack cached = ItemStack.EMPTY;
|
||||
|
||||
public MultiFenceRecipeEmbedded() {
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, "multi_fence_embedded"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting inv, final World world) {
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
@@ -46,8 +53,8 @@ public class MultiFenceRecipeEmbedded implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
public boolean canFit(int width, int height) {
|
||||
return width >= 3 && height >= 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,22 +3,26 @@ package binnie.extratrees.block.decor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.Constants;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
public class MultiFenceRecipeSize implements IRecipe {
|
||||
public class MultiFenceRecipeSize extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
private ItemStack cached = ItemStack.EMPTY;
|
||||
|
||||
public MultiFenceRecipeSize() {
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, "multi_fence_size"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,8 +73,8 @@ public class MultiFenceRecipeSize implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
public boolean canFit(int width, int height) {
|
||||
return width >= 3 && height >= 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
package binnie.extratrees.block.decor;
|
||||
|
||||
import binnie.Constants;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
public class MultiFenceRecipeSolid implements IRecipe {
|
||||
public class MultiFenceRecipeSolid extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
private ItemStack cached = ItemStack.EMPTY;
|
||||
|
||||
public MultiFenceRecipeSolid() {
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, "multi_fence_solid"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(final InventoryCrafting inv, final World world) {
|
||||
for (int row = 0; row < 3; ++row) {
|
||||
@@ -43,8 +50,8 @@ public class MultiFenceRecipeSolid implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 3;
|
||||
public boolean canFit(int width, int height) {
|
||||
return width >= 3 && height >= 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -101,7 +102,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
public abstract ItemStack getCreativeStack(final IDesign p0);
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (final IDesign design : CarpentryManager.carpentryInterface.getSortedDesigns()) {
|
||||
itemList.add(this.getCreativeStack(design));
|
||||
}
|
||||
@@ -142,7 +143,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, @Nullable World player, List<String> tooltip, ITooltipFlag advanced) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(block.getPrimaryMaterial().getDesignMaterialName() + " and " + block.getSecondaryMaterial().getDesignMaterialName());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extratrees.integration.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
@@ -8,7 +9,6 @@ import binnie.extratrees.integration.crafttweaker.handlers.BreweryRecipeHandler;
|
||||
import binnie.extratrees.integration.crafttweaker.handlers.DistilleryRecipeHandler;
|
||||
import binnie.extratrees.integration.crafttweaker.handlers.FruitPressRecipeHandler;
|
||||
import binnie.extratrees.integration.crafttweaker.handlers.LumbermillRecipeHandler;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
|
||||
public class CraftTweakerModule implements IInitializable {
|
||||
public static final String MOD_ID = "crafttweaker";
|
||||
@@ -27,10 +27,10 @@ public class CraftTweakerModule implements IInitializable {
|
||||
|
||||
@Optional.Method(modid = "crafttweaker")
|
||||
private void initCT(){
|
||||
MineTweakerAPI.registerClass(BreweryRecipeHandler.class);
|
||||
MineTweakerAPI.registerClass(DistilleryRecipeHandler.class);
|
||||
MineTweakerAPI.registerClass(FruitPressRecipeHandler.class);
|
||||
MineTweakerAPI.registerClass(LumbermillRecipeHandler.class);
|
||||
CraftTweakerAPI.registerClass(BreweryRecipeHandler.class);
|
||||
CraftTweakerAPI.registerClass(DistilleryRecipeHandler.class);
|
||||
CraftTweakerAPI.registerClass(FruitPressRecipeHandler.class);
|
||||
CraftTweakerAPI.registerClass(LumbermillRecipeHandler.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package binnie.extratrees.integration.crafttweaker;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
|
||||
public class CraftTweakerUtil {
|
||||
|
||||
public static ItemStack getItemStack(IIngredient item) {
|
||||
@@ -14,8 +13,9 @@ public class CraftTweakerUtil {
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
Object internal = item.getInternal();
|
||||
if(internal == null || !(internal instanceof ItemStack)) {
|
||||
MineTweakerAPI.logError("Not a valid item stack: " + item);
|
||||
if (!(internal instanceof ItemStack)) {
|
||||
CraftTweakerAPI.logError("Not a valid item stack: " + item);
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
return (ItemStack) internal;
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,9 @@
|
||||
package binnie.extratrees.integration.crafttweaker.handlers;
|
||||
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import crafttweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -9,10 +13,6 @@ import binnie.extratrees.integration.crafttweaker.CraftTweakerUtil;
|
||||
import binnie.extratrees.item.ExtraTreeItems;
|
||||
import binnie.extratrees.machines.brewery.recipes.BrewedGrainRecipe;
|
||||
import binnie.extratrees.machines.brewery.recipes.BreweryRecipe;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import stanhebben.zenscript.annotations.Optional;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
package binnie.extratrees.integration.crafttweaker.handlers;
|
||||
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import binnie.extratrees.api.recipes.ExtraTreesRecipeManager;
|
||||
import binnie.extratrees.integration.crafttweaker.CraftTweakerUtil;
|
||||
import binnie.extratrees.machines.distillery.recipes.DistilleryRecipe;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,8 @@
|
||||
package binnie.extratrees.integration.crafttweaker.handlers;
|
||||
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import crafttweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -7,9 +10,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.extratrees.api.recipes.ExtraTreesRecipeManager;
|
||||
import binnie.extratrees.integration.crafttweaker.CraftTweakerUtil;
|
||||
import binnie.extratrees.machines.fruitpress.recipes.FruitPressRecipe;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
|
||||
+11
-80
@@ -1,10 +1,11 @@
|
||||
package binnie.extratrees.integration.crafttweaker.handlers;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import crafttweaker.CraftTweakerAPI;
|
||||
import crafttweaker.IAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -12,8 +13,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.core.api.IBinnieRecipe;
|
||||
import binnie.core.api.ICraftingManager;
|
||||
import binnie.core.util.ItemStackUtil;
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
|
||||
public class GenericRecipeHandler {
|
||||
|
||||
@@ -31,7 +30,7 @@ public class GenericRecipeHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(recipeToRemove, manager));
|
||||
CraftTweakerAPI.apply(new Remove<>(recipeToRemove, manager));
|
||||
}
|
||||
|
||||
public static <R extends IBinnieRecipe, M extends ICraftingManager<R>> void removeRecipeInput(ItemStack input, M manager) {
|
||||
@@ -48,7 +47,7 @@ public class GenericRecipeHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(recipeToRemove, manager));
|
||||
CraftTweakerAPI.apply(new Remove<>(recipeToRemove, manager));
|
||||
}
|
||||
|
||||
public static <R extends IBinnieRecipe, M extends ICraftingManager<R>> void removeRecipe(FluidStack output, M manager) {
|
||||
@@ -65,7 +64,7 @@ public class GenericRecipeHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(recipeToRemove, manager));
|
||||
CraftTweakerAPI.apply(new Remove<>(recipeToRemove, manager));
|
||||
}
|
||||
|
||||
public static <R extends IBinnieRecipe, M extends ICraftingManager<R>> void removeRecipeInput(FluidStack input, M manager) {
|
||||
@@ -82,14 +81,14 @@ public class GenericRecipeHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
MineTweakerAPI.apply(new Remove(recipeToRemove, manager));
|
||||
CraftTweakerAPI.apply(new Remove<>(recipeToRemove, manager));
|
||||
}
|
||||
|
||||
public static <R extends IBinnieRecipe, M extends ICraftingManager<R>> void addRecipe(R recipe, M manager) {
|
||||
MineTweakerAPI.apply(new Add(recipe, manager));
|
||||
CraftTweakerAPI.apply(new Add<>(recipe, manager));
|
||||
}
|
||||
|
||||
private static class Add<R extends IBinnieRecipe, M extends ICraftingManager<R>> implements IUndoableAction {
|
||||
private static class Add<R extends IBinnieRecipe, M extends ICraftingManager<R>> implements IAction {
|
||||
private final R recipe;
|
||||
private final M manager;
|
||||
|
||||
@@ -100,37 +99,7 @@ public class GenericRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
if(manager.addRecipe(recipe)) {
|
||||
Object recipeWrapper = manager.getJeiWrapper(recipe);
|
||||
if(recipeWrapper != null) {
|
||||
MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(recipeWrapper, manager.getJEICategory());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if(manager.removeRecipe(recipe)) {
|
||||
Object recipeWrapper = manager.getJeiWrapper(recipe);
|
||||
if(recipeWrapper != null) {
|
||||
MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(recipeWrapper, manager.getJEICategory());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing " + manager.toString() + " recipe for " + recipe.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
manager.addRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,7 +108,7 @@ public class GenericRecipeHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static class Remove<R extends IBinnieRecipe, M extends ICraftingManager<R>> implements IUndoableAction {
|
||||
private static class Remove<R extends IBinnieRecipe, M extends ICraftingManager<R>> implements IAction {
|
||||
private final List<R> recipes;
|
||||
private final M manager;
|
||||
|
||||
@@ -150,50 +119,12 @@ public class GenericRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
Iterator<R> rIterator = recipes.iterator();
|
||||
while(rIterator.hasNext()) {
|
||||
R recipe = rIterator.next();
|
||||
if (manager.removeRecipe(recipe)) {
|
||||
Object recipeWrapper = manager.getJeiWrapper(recipe);
|
||||
if (recipeWrapper != null) {
|
||||
MineTweakerAPI.getIjeiRecipeRegistry().removeRecipe(recipeWrapper, manager.getJEICategory());
|
||||
}
|
||||
}else{
|
||||
rIterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
for(R recipe : recipes) {
|
||||
if (manager.addRecipe(recipe)) {
|
||||
Object recipeWrapper = manager.getJeiWrapper(recipe);
|
||||
if (recipeWrapper != null) {
|
||||
MineTweakerAPI.getIjeiRecipeRegistry().addRecipe(recipeWrapper, manager.getJEICategory());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
recipes.removeIf(recipe -> !manager.removeRecipe(recipe));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + manager.toString() + " recipe for " + recipes.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Adding " + manager.toString() + " recipe for " + recipes.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
package binnie.extratrees.integration.crafttweaker.handlers;
|
||||
|
||||
import crafttweaker.api.item.IIngredient;
|
||||
import crafttweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.extratrees.api.recipes.ExtraTreesRecipeManager;
|
||||
import binnie.extratrees.integration.crafttweaker.CraftTweakerUtil;
|
||||
import binnie.extratrees.machines.lumbermill.recipes.LumbermillRecipe;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package binnie.extratrees.item;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -42,17 +44,18 @@ public class ItemArboristDatabase extends Item implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
|
||||
if (isMaster(stack)) {
|
||||
tooltip.add(TextFormatting.DARK_PURPLE + I18N.localise("extratrees.item.database.arborist.master.tooltip"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
super.getSubItems(item, tab, subItems);
|
||||
subItems.add(new ItemStack(item, 1, 1));
|
||||
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) {
|
||||
super.getSubItems(tab, items);
|
||||
if (this.isInCreativeTab(tab)) {
|
||||
items.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loaded 100 of 148 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user