mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-19 19:59:49 +00:00
Clean Up and fix some bugs
This commit is contained in:
1 parent
21752a8b28
commit
31d0a03d3f
11 files changed
+213
-97
No files matched your search
@@ -19,8 +19,13 @@ import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.core.gui.GuiIdRegistry;
|
||||
import forestry.core.gui.GuiType;
|
||||
import forestry.core.proxy.Proxies;
|
||||
@@ -55,6 +60,11 @@ public class ExtraBees {
|
||||
|
||||
@SidedProxy(clientSide = "binnie.extrabees.proxy.ExtraBeesClientProxy", serverSide = "binnie.extrabees.proxy.ExtraBeesCommonProxy")
|
||||
public static ExtraBeesCommonProxy proxy;
|
||||
|
||||
public ExtraBees(){
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
public static ConfigHandler configHandler;
|
||||
|
||||
public static Material materialBeehive;
|
||||
@@ -76,8 +86,6 @@ public class ExtraBees {
|
||||
configHandler.addConfigurable(new ConfigurationMain());
|
||||
BlockRegister.preInitBlocks();
|
||||
ItemRegister.preInitItems();
|
||||
MinecraftForge.EVENT_BUS.register(proxy);
|
||||
ExtraBeesBranch.setSpeciesBranches();
|
||||
try {
|
||||
Method m = GuiIdRegistry.class.getDeclaredMethod("registerGuiHandlers", GuiType.class, List.class);
|
||||
m.setAccessible(true);
|
||||
@@ -115,4 +123,15 @@ public class ExtraBees {
|
||||
AlvearyMutationHandler.addMutationItem(new ItemStack(Items.ENDER_PEARL), 2.0f);
|
||||
AlvearyMutationHandler.addMutationItem(new ItemStack(Items.ENDER_EYE), 4.0f);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterSpecies(AlleleSpeciesRegisterEvent<IAlleleBeeSpecies> event){
|
||||
if(event.getRoot() != BeeManager.beeRoot){
|
||||
return;
|
||||
}
|
||||
ExtraBeesBranch.setSpeciesBranches();
|
||||
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package binnie.extrabees.alveary;
|
||||
|
||||
import forestry.apiculture.MaterialBeehive;
|
||||
import forestry.core.gui.GuiHandler;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
@@ -19,8 +19,10 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.apiculture.MaterialBeehive;
|
||||
import forestry.core.gui.GuiHandler;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class BlockAlveary extends Block implements ITileEntityProvider {
|
||||
@@ -29,6 +31,7 @@ public class BlockAlveary extends Block implements ITileEntityProvider {
|
||||
|
||||
public BlockAlveary() {
|
||||
super(new MaterialBeehive(false));
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setRegistryName("alveary");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package binnie.extrabees.client.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import binnie.extrabees.utils.ExtraBeesResourceLocation;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.Dimension;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.Dimension;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import binnie.extrabees.utils.ExtraBeesResourceLocation;
|
||||
|
||||
public abstract class AbstractAlvearyContainer extends Container {
|
||||
|
||||
@@ -27,8 +29,8 @@ public abstract class AbstractAlvearyContainer extends Container {
|
||||
this.inv = inv;
|
||||
this.dimension = dimension;
|
||||
String base = "extrabees.machine.alveay." + type.getName();
|
||||
title = ExtraBees.proxy.localise(base + ".name");
|
||||
tooltip = ExtraBees.proxy.localise(base + ".info");
|
||||
title = ExtraBees.proxy.localiseWithOutPrefix(base + ".name");
|
||||
tooltip = ExtraBees.proxy.localiseWithOutPrefix(base + ".info");
|
||||
background = new ExtraBeesResourceLocation("textures/gui/gui" + type.getName() + ".png");
|
||||
setupContainer();
|
||||
}
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.client.BeeModelProvider;
|
||||
import binnie.extrabees.genetics.effect.ExtraBeesEffect;
|
||||
import binnie.extrabees.items.ItemHoneyComb;
|
||||
import binnie.extrabees.items.types.EnumHoneyComb;
|
||||
import binnie.extrabees.items.types.IEBEnumItem;
|
||||
import binnie.extrabees.utils.Utils;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
@@ -30,22 +43,14 @@ import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
import forestry.core.genetics.alleles.EnumAllele;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.client.BeeModelProvider;
|
||||
import binnie.extrabees.genetics.effect.ExtraBeesEffect;
|
||||
import binnie.extrabees.items.ItemHoneyComb;
|
||||
import binnie.extrabees.items.types.EnumHoneyComb;
|
||||
import binnie.extrabees.items.types.IEBEnumItem;
|
||||
import binnie.extrabees.utils.Utils;
|
||||
|
||||
public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
ARID("aridus", 12511316),
|
||||
@@ -769,12 +774,12 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise(getUnlocalizedName());
|
||||
return ExtraBees.proxy.localiseWithOutPrefix(getUnlocalizedName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise(getUID() + ".desc");
|
||||
return ExtraBees.proxy.localiseWithOutPrefix(getUID() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package binnie.extrabees.init;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -12,10 +10,8 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.alveary.BlockAlveary;
|
||||
import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
import binnie.extrabees.blocks.type.EnumHiveType;
|
||||
import binnie.extrabees.items.ItemBeehive;
|
||||
import binnie.extrabees.items.ItemBlockAlveary;
|
||||
import binnie.extrabees.items.ItemHoneyComb;
|
||||
import binnie.extrabees.items.ItemHoneyCrystal;
|
||||
import binnie.extrabees.items.ItemHoneyDrop;
|
||||
@@ -35,31 +31,13 @@ public final class ItemRegister {
|
||||
|
||||
@SuppressWarnings("all")
|
||||
private static void registerMisc() {
|
||||
Item i = GameRegistry.register(new ItemBlock(ExtraBees.alveary) {
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return ((BlockAlveary) block).getUnlocalizedName(stack.getMetadata());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getHasSubtypes() {
|
||||
return true;
|
||||
}
|
||||
}.setRegistryName(ExtraBees.alveary.getRegistryName()));
|
||||
for (int j = 0; j < EnumAlvearyLogicType.VALUES.length; j++) {
|
||||
ExtraBees.proxy.registerModel(i, j);
|
||||
}
|
||||
i = GameRegistry.register(new ItemBeehive(ExtraBees.hive));
|
||||
for (int j = 0; j < EnumHiveType.values().length; j++) {
|
||||
ExtraBees.proxy.registerModel(i, j);
|
||||
}
|
||||
ExtraBees.proxy.registerModel(GameRegistry.register(new ItemBlock(ExtraBees.ectoplasm).setRegistryName(ExtraBees.ectoplasm.getRegistryName())), 0);
|
||||
ItemBlockAlveary itemBlockAlveary = GameRegistry.register(new ItemBlockAlveary(ExtraBees.alveary));
|
||||
itemBlockAlveary.registerModel(itemBlockAlveary);
|
||||
ItemBeehive itemBeehive = GameRegistry.register(new ItemBeehive(ExtraBees.hive));
|
||||
ExtraBees.proxy.registerModel(itemBeehive);
|
||||
ItemBlock ectoplasm = new ItemBlock(ExtraBees.ectoplasm);
|
||||
ectoplasm.setRegistryName(ExtraBees.ectoplasm.getRegistryName());
|
||||
ExtraBees.proxy.registerModel(GameRegistry.register(ectoplasm), 0);
|
||||
ExtraBees.itemMisc = ExtraBees.proxy.registerItem(new ItemMiscProduct(Tabs.tabApiculture, ExtraBeeItems.values()));
|
||||
for (final EnumHiveFrame frame : EnumHiveFrame.values()) {
|
||||
ExtraBees.proxy.registerItem(frame.getItem());
|
||||
@@ -73,6 +51,7 @@ public final class ItemRegister {
|
||||
ExtraBees.propolis = new ItemPropolis();
|
||||
|
||||
ExtraBees.proxy.registerItem(ExtraBees.honeyCrystal);
|
||||
ExtraBees.proxy.registerModel(ExtraBees.honeyCrystal);
|
||||
ExtraBees.proxy.registerItem(ExtraBees.comb);
|
||||
ExtraBees.proxy.registerItem(ExtraBees.honeyDrop);
|
||||
ExtraBees.proxy.registerItem(ExtraBees.propolis);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package binnie.extrabees.items;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IItemModelProvider {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void registerModel(Item item);
|
||||
}
|
||||
@@ -1,16 +1,23 @@
|
||||
package binnie.extrabees.items;
|
||||
|
||||
import binnie.extrabees.blocks.type.EnumHiveType;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
public class ItemBeehive extends ItemBlock {
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.extrabees.blocks.type.EnumHiveType;
|
||||
|
||||
public class ItemBeehive extends ItemBlock implements IItemModelProvider {
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public ItemBeehive(@Nonnull final Block block) {
|
||||
@@ -37,4 +44,14 @@ public class ItemBeehive extends ItemBlock {
|
||||
public String getItemStackDisplayName(final ItemStack itemStack) {
|
||||
return EnumHiveType.values()[itemStack.getItemDamage()].toString() + " Hive";
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item) {
|
||||
int i = 0;
|
||||
for(EnumHiveType type : EnumHiveType.values()){
|
||||
ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation("extrabees:hive", "type=" + type.getName()));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation version 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
package binnie.extrabees.items;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.extrabees.alveary.BlockAlveary;
|
||||
import binnie.extrabees.alveary.EnumAlvearyLogicType;
|
||||
|
||||
public class ItemBlockAlveary extends ItemBlock implements IItemModelProvider {
|
||||
public ItemBlockAlveary(Block block) {
|
||||
super(block);
|
||||
setRegistryName(block.getRegistryName());
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return ((BlockAlveary) block).getUnlocalizedName(stack.getMetadata());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item) {
|
||||
int i = 0;
|
||||
for(EnumAlvearyLogicType type : EnumAlvearyLogicType.values()){
|
||||
ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation("extrabees:alveary", "type=" + type.getName()));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,6 @@ import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
import binnie.core.Mods;
|
||||
@@ -35,7 +33,7 @@ import ic2.api.item.IItemHudInfo;
|
||||
@Optional.Interface(modid = "ic2", iface = "ic2.api.item.IElectricItem"),
|
||||
@Optional.Interface(modid = "ic2", iface = "ic2.api.item.IItemHudInfo")
|
||||
})
|
||||
public class ItemHoneyCrystal extends Item implements IElectricItem, IItemHudInfo, IItemModelRegister {
|
||||
public class ItemHoneyCrystal extends Item implements IElectricItem, IItemHudInfo, IItemModelProvider {
|
||||
private int maxCharge;
|
||||
private int transferLimit;
|
||||
private int tier;
|
||||
@@ -81,9 +79,9 @@ public class ItemHoneyCrystal extends Item implements IElectricItem, IItemHudInf
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
public void registerModel(Item item) {
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation("extrabees:honey_crystal_full", "inventory"), new ModelResourceLocation("extrabees:honey_crystal_empty", "inventory"), new ModelResourceLocation("extrabees:honey_crystal", "inventory"));
|
||||
manager.registerItemModel(item, new HoneyCrystalMeshDefinition());
|
||||
ModelLoader.setCustomMeshDefinition(item, new HoneyCrystalMeshDefinition());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extrabees.proxy;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.utils.ExtraBeesResourceLocation;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import forestry.core.models.BlankModel;
|
||||
import forestry.core.models.ModelManager;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
@@ -16,12 +16,18 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.registry.IRegistry;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import forestry.core.models.BlankModel;
|
||||
import forestry.core.models.ModelManager;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.items.IItemModelProvider;
|
||||
import binnie.extrabees.utils.ExtraBeesResourceLocation;
|
||||
|
||||
public class ExtraBeesClientProxy extends ExtraBeesCommonProxy {
|
||||
|
||||
@@ -61,7 +67,12 @@ public class ExtraBeesClientProxy extends ExtraBeesCommonProxy {
|
||||
public void registerModel(@Nonnull Item item, int meta) {
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), "inventory"));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <P extends Item & IItemModelProvider> void registerModel(P provider) {
|
||||
provider.registerModel(provider);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onModelsBaked(ModelBakeEvent event) {
|
||||
IRegistry<ModelResourceLocation, IBakedModel> registry = event.getModelRegistry();
|
||||
|
||||
@@ -4,15 +4,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
|
||||
import binnie.extrabees.genetics.ExtraBeesSpecies;
|
||||
import binnie.extrabees.items.IItemModelProvider;
|
||||
|
||||
public class ExtraBeesCommonProxy {
|
||||
|
||||
@@ -29,19 +24,16 @@ public class ExtraBeesCommonProxy {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public String localise(String s) {
|
||||
return I18n.translateToLocal("extrabees." + s);
|
||||
}
|
||||
|
||||
public String localiseWithOutPrefix(String s) {
|
||||
return I18n.translateToLocal(s);
|
||||
}
|
||||
|
||||
public void registerModel(Item item, int meta) {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterSpecies(AlleleSpeciesRegisterEvent<IAlleleBeeSpecies> event){
|
||||
if(event.getRoot() != BeeManager.beeRoot){
|
||||
return;
|
||||
}
|
||||
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
public <P extends Item & IItemModelProvider> void registerModel(P provider) {
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user