Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package com.triphion.ancient;
import com.sun.jna.platform.mac.Carbon.EventHandlerProcPtr;
import com.triphion.ancient.creativetabs.TabAncientBlocks;
import com.triphion.ancient.creativetabs.TabAncientItems;
import com.triphion.ancient.creativetabs.TabAncientTools;
import com.triphion.ancient.creativetabs.TabAncientWands;
import com.triphion.ancient.handlers.AchievementHandler;
import com.triphion.ancient.handlers.RecipeHandler;
import com.triphion.ancient.init.DevModArmour;
import com.triphion.ancient.init.ModArmour;
import com.triphion.ancient.init.ModBlocks;
import com.triphion.ancient.init.ModDevItems;
import com.triphion.ancient.init.ModItems;
import com.triphion.ancient.init.ModSpecialItems;
import com.triphion.ancient.init.ModTools;
import com.triphion.ancient.proxy.CommonProxy;
import com.triphion.ancient.util.Utils;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
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;
@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class AncientMod {
public static final CreativeTabs items = new TabAncientItems();
public static final CreativeTabs blocks = new TabAncientBlocks();
public static final CreativeTabs tools = new TabAncientTools();
public static final CreativeTabs wands = new TabAncientWands();
@Mod.Instance(Reference.MODID)
public static AncientMod instance;
@SidedProxy(serverSide = Reference.SERVER_PROXY_CLASS, clientSide = Reference.CLIENT_PROXY_CLASS)
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
ModBlocks.init();
ModItems.init();
ModTools.init();
ModArmour.init();
ModDevItems.init();
ModSpecialItems.init();
DevModArmour.init();
ModBlocks.register();
ModItems.register();
ModTools.register();
ModArmour.register();
ModDevItems.register();
ModSpecialItems.register();
DevModArmour.register();
proxy.preInit();
OBJLoader.INSTANCE.addDomain(Reference.MODID.toLowerCase());
proxy.registerRenders();
AchievementHandler.registerAchievements();
}
@EventHandler
public void init(FMLInitializationEvent event) {
proxy.init();
RecipeHandler.registerCraftingRecipes();
RecipeHandler.registerFurnaceRecipes();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}
package com.triphion.ancient.blocks;
import com.triphion.ancient.AncientMod;
import com.triphion.ancient.Reference;
import com.triphion.ancient.util.Utils;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockBeeBox extends Block {
public BlockBeeBox(String unlocalizedName, String registryName) {
super(Material.ROCK);
this.setUnlocalizedName(unlocalizedName);
this.setRegistryName(new ResourceLocation(Reference.MODID, registryName));
this.setHardness(2);
this.setResistance(2);
this.setHarvestLevel("pickaxe", 0);
}
@SideOnly(Side.CLIENT)
public void initModel() {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(this), 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
return false;
}
@Override
public boolean isBlockNormalCube(IBlockState blockState) {
return false;
}
@Override
public boolean isOpaqueCube(IBlockState blockState) {
return false;
}
}
package com.triphion.ancient.init;
import com.triphion.ancient.AncientMod;
import com.triphion.ancient.Reference;
import com.triphion.ancient.blocks.BlockAnemoneOre;
import com.triphion.ancient.blocks.BlockAradoxiteOre;
import com.triphion.ancient.blocks.BlockBeeBox;
import com.triphion.ancient.blocks.BlockFlorumCrop;
import com.triphion.ancient.blocks.BlockFlorumOre;
import com.triphion.ancient.blocks.BlockGalactiumOreBlue;
import com.triphion.ancient.blocks.BlockGalactiumOreOrange;
import com.triphion.ancient.blocks.BlockGalactiumOrePurple;
import com.triphion.ancient.blocks.BlockLantinumLamp;
import com.triphion.ancient.blocks.BlockLantinumOre;
import com.triphion.ancient.blocks.BlockLeadBlock;
import com.triphion.ancient.blocks.BlockLeadOre;
import com.triphion.ancient.blocks.BlockLeadStairs;
import com.triphion.ancient.blocks.BlockLeadBlock;
import com.triphion.ancient.blocks.BlockLuniteOre;
import com.triphion.ancient.blocks.BlockMoltenOre;
import com.triphion.ancient.blocks.BlockPurpuriumOre;
import com.triphion.ancient.blocks.BlockSpectoniumOre;
import com.triphion.ancient.blocks.BlockStoneBlock;
import com.triphion.ancient.blocks.BlockStoneStairs;
import com.triphion.ancient.util.Utils;
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.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class ModBlocks {
public static Block purpuriumore;
public static Block luniteore;
public static Block leadore;
public static Block leadblock;
public static Block spectoniumOre;
public static Block florumOre;
public static Block lantinumOre;
public static Block lantinumLamp;
public static Block FlorumCrop;
public static Block stoneBlock;
public static BlockLeadStairs leadStairs;
public static BlockStoneStairs stoneStairs;
public static Block moltenOre;
public static Block aradoxiteOre;
public static Block galactiumOrepurple;
public static Block galactiumOreblue;
public static Block galactiumOreorange;
public static Block anemoneOre;
public static Block beeBox;
public static void init() {
purpuriumore = new BlockPurpuriumOre("purpuriumore", "purpuriumore");
luniteore = new BlockLuniteOre("luniteore", "luniteore");
leadore = new BlockLeadOre("leadore", "leadore");
leadblock = new BlockLeadBlock("leadblock", "leadblock");
spectoniumOre = new BlockSpectoniumOre("spectonium_ore", "spectonium_ore");
florumOre = new BlockFlorumOre("florum_ore", "florum_ore");
lantinumOre = new BlockLantinumOre("lantinum_ore", "lantinum_ore");
lantinumLamp = new BlockLantinumLamp("lantinum_lamp", "lantinum_lamp");
FlorumCrop = new BlockFlorumCrop("florumcrop");
stoneBlock = new BlockStoneBlock("stone_block", "stone_block");
leadStairs = new BlockLeadStairs("lead_stairs", leadblock.getDefaultState());
stoneStairs = new BlockStoneStairs("stone_stairs", stoneBlock.getDefaultState());
moltenOre = new BlockMoltenOre("molten_ore", "molten_ore");
aradoxiteOre = new BlockAradoxiteOre("aradoxite_ore", "aradoxite_ore");
galactiumOrepurple = new BlockGalactiumOrePurple("galactium_ore_purple", "galactium_ore_purple");
galactiumOreblue = new BlockGalactiumOreBlue("galactium_ore_blue", "galactium_ore_blue");
galactiumOreorange = new BlockGalactiumOreOrange("galactium_ore_orange", "galactium_ore_orange");
anemoneOre = new BlockAnemoneOre("anemone_ore", "anemone_ore");
beeBox = new BlockBeeBox("bee_box", "bee_box");
}
public static void register() {
registerBlock(purpuriumore);
registerBlock(luniteore);
registerBlock(leadore);
registerBlock(leadblock);
registerBlock(spectoniumOre);
registerBlock(florumOre);
registerBlock(lantinumOre);
registerBlock(lantinumLamp);
GameRegistry.register(FlorumCrop);
registerBlock(stoneBlock);
registerBlock(leadStairs);
registerBlock(stoneStairs);
registerBlock(moltenOre);
registerBlock(aradoxiteOre);
registerBlock(galactiumOrepurple);
registerBlock(galactiumOreblue);
registerBlock(galactiumOreorange);
registerBlock(anemoneOre);
registerBlock(beeBox);
}
public static void registerRenders() {
registerRender(purpuriumore);
registerRender(luniteore);
registerRender(leadore);
registerRender(leadblock);
registerRender(spectoniumOre);
registerRender(florumOre);
registerRender(lantinumOre);
registerRender(lantinumLamp);
registerRender(stoneBlock);
registerRender(leadStairs);
registerRender(stoneStairs);
registerRender(moltenOre);
registerRender(aradoxiteOre);
registerRender(galactiumOrepurple);
registerRender(galactiumOreblue);
registerRender(galactiumOreorange);
registerRender(anemoneOre);
registerRender(beeBox);
}
public static void registerBlock(Block block) {
block.setCreativeTab(AncientMod.blocks);
GameRegistry.register(block);
GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
Utils.getLogger().info("Registered Block: " + block.getUnlocalizedName().substring(5));
}
public static void registerRender(Block block) {
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(new ResourceLocation(Reference.MODID, block.getUnlocalizedName().substring(5)), "Inventory"));
Utils.getLogger().info("Registered render for" + block.getUnlocalizedName().substring(5));
}
}
package com.triphion.ancient.proxy;
import com.triphion.ancient.AncientMod;
import com.triphion.ancient.Reference;
import com.triphion.ancient.init.DevModArmour;
import com.triphion.ancient.init.ModArmour;
import com.triphion.ancient.init.ModBlocks;
import com.triphion.ancient.init.ModDevItems;
import com.triphion.ancient.init.ModItems;
import com.triphion.ancient.init.ModSpecialItems;
import com.triphion.ancient.init.ModTools;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.obj.OBJLoader;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenders() {
ModItems.registerRenders();
ModTools.registerRenders();
ModBlocks.registerRenders();
ModArmour.registerRenders();
ModDevItems.registerRenders();
ModSpecialItems.registerRenders();
DevModArmour.registerRenders();
}
}
package com.triphion.ancient;
public class Reference {
public static final String MODID = "ancient";
public static final String VERSION = "1.0";
public static final String NAME = "Ancient Mod";
public static final String SERVER_PROXY_CLASS = "com.triphion.ancient.proxy.CommonProxy";
public static final String CLIENT_PROXY_CLASS = "com.triphion.ancient.proxy.ClientProxy";
}
{
"forge_marker": 1,
"defaults": {
"custom": { "flip-v": true },
"model": "ancient:bee_box.obj"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}
# Blender MTL File: 'Beebox.blend'
# Material Count: 1
newmtl Material.001
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd ancient:blocks/bee_box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.