Jump to content

Crash when searching for my block in creative mode.


Nieue

Recommended Posts

Hello, as you can see in the title I get a crash when I search for my block/go into my custom creative tab where the block is in.

The block has a custom model, and I believe that is the problem. This was my first model block, so I don't know much of it yet and I followed this tutorial: http://minalien.com/tutorial-advancedmodelloader/

Error:

 

 

 

      Minecraft has crashed!     

      ----------------------     

 

Minecraft has stopped running because it encountered a problem; Rendering screen

 

A full error report has been saved to C:\Users\Dennis\Downloads\Minecraft\Mod\1.5.2\jars\.\crash-reports\crash-2013-06-25_18.00.41-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(

 

 

 

--- BEGIN ERROR REPORT c91cbf8d --------

Full report at:

C:\Users\Dennis\Downloads\Minecraft\Mod\1.5.2\jars\.\crash-reports\crash-2013-06-25_18.00.41-client.txt

Please show that file to Mojang, NOT just this screen!

 

Generated 25-6-13 18:00

 

-- Head --

Stacktrace:

at net.minecraftforge.client.model.obj.WavefrontObject.renderAll(WavefrontObject.java:175)

at mods.Millarki.client.ModelAltar.render(ModelAltar.java:26)

at mods.Millarki.client.ItemAltarRenderer.renderAltar(ItemAltarRenderer.java:66)

at mods.Millarki.client.ItemAltarRenderer.renderItem(ItemAltarRenderer.java:47)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.inventory.GuiContainer.drawSlotInventory(GuiContainer.java:417)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:128)

at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:43)

at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:664)

 

-- Screen render details --

Details:

Screen name: net.minecraft.client.gui.inventory.GuiContainerCreative

Mouse location: Scaled: (116, 40). Absolute: (232, 399)

Screen size: Scaled: (427, 240). Absolute: (854, 480). Scale factor of 2

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Player875'/304, l='MpServer', x=-111,50, y=68,62, z=-237,50]]

Chunk stats: MultiplayerChunkCache: 335

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (-106,64,-242), Chunk: (at 6,4,14 in -7,-16; contains blocks -112,0,-256 to -97,255,-241), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)

Level time: 1173 game time, 1173 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 108 total; [EntityClientPlayerMP['Player875'/304, l='MpServer', x=-111,50, y=68,62, z=-237,50], EntitySheep['Sheep'/110, l='MpServer', x=-189,84, y=64,00, z=-266,22], EntitySheep['Sheep'/108, l='MpServer', x=-187,84, y=63,00, z=-271,50], EntitySheep['Sheep'/109, l='MpServer', x=-189,28, y=63,00, z=-269,50], EntitySheep['Sheep'/107, l='MpServer', x=-190,69, y=64,00, z=-268,73], EntitySkeleton['Skeleton'/119, l='MpServer', x=-168,50, y=29,00, z=-285,50], EntityBat['Bat'/112, l='MpServer', x=-183,75, y=27,10, z=-164,73], EntityZombie['Zombie'/127, l='MpServer', x=-160,50, y=27,00, z=-175,50], EntityZombie['Zombie'/126, l='MpServer', x=-160,97, y=28,00, z=-180,47], EntitySkeleton['Skeleton'/125, l='MpServer', x=-161,03, y=38,00, z=-246,31], EntitySkeleton['Skeleton'/124, l='MpServer', x=-165,06, y=37,00, z=-244,56], EntityBat['Bat'/123, l='MpServer', x=-163,69, y=43,10, z=-274,41], EntityZombie['Zombie'/122, l='MpServer', x=-167,63, y=22,00, z=-276,97], EntitySkeleton['Skeleton'/121, l='MpServer', x=-169,88, y=30,00, z=-279,56], EntitySkeleton['Skeleton'/120, l='MpServer', x=-169,50, y=29,00, z=-281,50], EntityEnderman['Enderman'/139, l='MpServer', x=-158,66, y=18,00, z=-288,84], EntityEnderman['Enderman'/138, l='MpServer', x=-156,88, y=19,00, z=-288,47], EntityItem['item.tile.sapling.oak'/141, l='MpServer', x=-151,84, y=70,13, z=-266,25], EntityItem['item.tile.sapling.oak'/140, l='MpServer', x=-151,13, y=65,13, z=-271,72], EntityZombie['Zombie'/143, l='MpServer', x=-157,51, y=39,00, z=-242,95], EntityZombie['Zombie'/142, l='MpServer', x=-144,20, y=29,00, z=-249,38], EntitySkeleton['Skeleton'/129, l='MpServer', x=-162,91, y=56,00, z=-175,50], EntitySkeleton['Skeleton'/128, l='MpServer', x=-165,50, y=53,00, z=-167,50], EntityCreeper['Creeper'/152, l='MpServer', x=-156,50, y=47,00, z=-159,50], EntityZombie['Zombie'/156, l='MpServer', x=-137,46, y=30,00, z=-244,99], EntityCreeper['Creeper'/157, l='MpServer', x=-139,50, y=29,00, z=-247,22], EntityPig['Pig'/158, l='MpServer', x=-137,81, y=66,00, z=-253,53], EntityItem['item.tile.mushroom'/159, l='MpServer', x=-138,91, y=26,13, z=-199,34], EntityZombie['Zombie'/144, l='MpServer', x=-150,97, y=21,00, z=-234,59], EntityZombie['Zombie'/145, l='MpServer', x=-155,50, y=40,00, z=-231,50], EntityZombie['Zombie'/146, l='MpServer', x=-151,47, y=24,00, z=-217,16], EntityZombie['Zombie'/147, l='MpServer', x=-157,16, y=25,00, z=-219,84], EntityZombie['Zombie'/148, l='MpServer', x=-153,94, y=23,00, z=-176,63], EntityZombie['Zombie'/149, l='MpServer', x=-159,38, y=26,00, z=-171,91], EntityCreeper['Creeper'/150, l='MpServer', x=-145,50, y=46,00, z=-172,50], EntityCreeper['Creeper'/168, l='MpServer', x=-117,78, y=24,00, z=-158,88], EntityPig['Pig'/175, l='MpServer', x=-108,69, y=68,00, z=-220,47], EntityPig['Pig'/174, l='MpServer', x=-97,75, y=67,00, z=-219,50], EntityItem['item.tile.sapling.oak'/173, l='MpServer', x=-105,31, y=74,13, z=-252,47], EntityZombie['Zombie'/172, l='MpServer', x=-103,47, y=18,95, z=-239,31], EntityBat['Bat'/163, l='MpServer', x=-133,23, y=15,01, z=-165,92], EntityCreeper['Creeper'/162, l='MpServer', x=-131,59, y=21,00, z=-166,06], EntityCreeper['Creeper'/161, l='MpServer', x=-128,34, y=24,00, z=-169,03], EntityCreeper['Creeper'/160, l='MpServer', x=-130,17, y=24,00, z=-168,59], EntityPig['Pig'/167, l='MpServer', x=-114,16, y=67,00, z=-252,59], EntityPig['Pig'/166, l='MpServer', x=-113,03, y=67,00, z=-249,84], EntityCreeper['Creeper'/165, l='MpServer', x=-123,00, y=35,00, z=-244,50], EntityPig['Pig'/164, l='MpServer', x=-114,50, y=72,00, z=-257,69], EntityPig['Pig'/186, l='MpServer', x=-91,03, y=69,00, z=-225,19], EntityCreeper['Creeper'/187, l='MpServer', x=-86,50, y=28,00, z=-217,50], EntityZombie['Zombie'/184, l='MpServer', x=-86,78, y=29,00, z=-255,25], EntitySpider['Spider'/185, l='MpServer', x=-92,28, y=36,00, z=-244,41], EntityZombie['Zombie'/190, l='MpServer', x=-93,91, y=39,00, z=-195,70], EntityBat['Bat'/191, l='MpServer', x=-86,75, y=20,10, z=-184,25], EntityCreeper['Creeper'/188, l='MpServer', x=-85,50, y=28,00, z=-216,50], EntityBat['Bat'/189, l='MpServer', x=-83,75, y=16,80, z=-218,48], EntityItem['item.tile.mushroom'/178, l='MpServer', x=-96,28, y=39,13, z=-205,91], EntityPig['Pig'/176, l='MpServer', x=-96,41, y=66,00, z=-212,25], EntityZombie['Zombie'/177, l='MpServer', x=-107,06, y=41,00, z=-198,50], EntityPig['Pig'/182, l='MpServer', x=-83,50, y=76,00, z=-270,31], EntityPig['Pig'/183, l='MpServer', x=-80,41, y=75,00, z=-264,06], EntityZombie['Zombie'/180, l='MpServer', x=-92,34, y=19,00, z=-306,48], EntityPig['Pig'/181, l='MpServer', x=-85,78, y=72,00, z=-278,78], EntityItem['item.tile.sapling.oak'/205, l='MpServer', x=-71,25, y=69,13, z=-260,22], EntityPig['Pig'/204, l='MpServer', x=-78,97, y=70,00, z=-280,06], EntityItem['item.tile.sapling.oak'/207, l='MpServer', x=-72,13, y=76,13, z=-248,66], EntityItem['item.tile.sapling.oak'/206, l='MpServer', x=-75,72, y=72,13, z=-249,13], EntityZombie['Zombie'/201, l='MpServer', x=-68,56, y=24,00, z=-303,00], EntityZombie['Zombie'/200, l='MpServer', x=-71,69, y=24,00, z=-304,31], EntityZombie['Zombie'/203, l='MpServer', x=-67,50, y=24,00, z=-303,50], EntityPig['Pig'/202, l='MpServer', x=-74,66, y=66,00, z=-315,22], EntityBat['Bat'/193, l='MpServer', x=-86,25, y=20,06, z=-182,67], EntityCreeper['Creeper'/192, l='MpServer', x=-86,85, y=22,00, z=-184,77], EntityCreeper['Creeper'/195, l='MpServer', x=-92,97, y=36,00, z=-166,53], EntityZombie['Zombie'/194, l='MpServer', x=-91,03, y=56,00, z=-180,50], EntityPig['Pig'/220, l='MpServer', x=-58,82, y=69,00, z=-307,60], EntityPig['Pig'/221, l='MpServer', x=-52,50, y=70,00, z=-302,50], EntityItem['item.tile.sapling.oak'/222, l='MpServer', x=-53,13, y=76,13, z=-267,13], EntityItem['item.tile.sapling.oak'/223, l='MpServer', x=-54,81, y=77,13, z=-265,47], EntityCreeper['Creeper'/216, l='MpServer', x=-65,00, y=36,00, z=-171,56], EntityEnderman['Enderman'/217, l='MpServer', x=-67,01, y=35,00, z=-173,93], EntityCreeper['Creeper'/218, l='MpServer', x=-52,09, y=18,00, z=-307,72], EntityPig['Pig'/219, l='MpServer', x=-53,81, y=70,00, z=-304,53], EntityCreeper['Creeper'/212, l='MpServer', x=-67,98, y=53,00, z=-223,08], EntityBat['Bat'/213, l='MpServer', x=-62,64, y=21,68, z=-201,91], EntityZombie['Zombie'/214, l='MpServer', x=-77,03, y=54,00, z=-178,50], EntityCreeper['Creeper'/215, l='MpServer', x=-64,66, y=36,00, z=-170,69], EntitySkeleton['Skeleton'/208, l='MpServer', x=-69,31, y=24,00, z=-221,13], EntityBat['Bat'/209, l='MpServer', x=-72,25, y=27,10, z=-211,53], EntityBat['Bat'/210, l='MpServer', x=-69,19, y=17,24, z=-209,85], EntityBat['Bat'/211, l='MpServer', x=-75,72, y=19,61, z=-209,36], EntityPig['Pig'/238, l='MpServer', x=-41,06, y=68,00, z=-298,41], EntityBat['Bat'/237, l='MpServer', x=-33,97, y=16,12, z=-311,31], EntitySkeleton['Skeleton'/236, l='MpServer', x=-45,50, y=17,00, z=-310,50], EntityBat['Bat'/231, l='MpServer', x=-56,71, y=11,37, z=-182,15], EntitySkeleton['Skeleton'/230, l='MpServer', x=-56,16, y=14,00, z=-187,47], EntitySkeleton['Skeleton'/229, l='MpServer', x=-58,69, y=47,00, z=-207,91], EntityBat['Bat'/228, l='MpServer', x=-44,94, y=23,52, z=-202,70], EntityCreeper['Creeper'/227, l='MpServer', x=-55,41, y=46,00, z=-220,84], EntityCreeper['Creeper'/226, l='MpServer', x=-53,50, y=46,00, z=-221,50], EntityBat['Bat'/225, l='MpServer', x=-53,22, y=26,89, z=-216,07], EntityBat['Bat'/224, l='MpServer', x=-56,25, y=30,10, z=-212,25], EntityZombie['Zombie'/246, l='MpServer', x=-46,50, y=39,00, z=-191,50], EntityBat['Bat'/244, l='MpServer', x=-46,50, y=26,10, z=-194,22], EntityZombie['Zombie'/245, l='MpServer', x=-45,50, y=39,00, z=-193,50], EntitySkeleton['Skeleton'/242, l='MpServer', x=-41,50, y=42,00, z=-220,94], EntityBat['Bat'/243, l='MpServer', x=-42,44, y=51,10, z=-219,25], EntitySkeleton['Skeleton'/241, l='MpServer', x=-46,50, y=42,00, z=-224,50]]

Retry entities: 0 total; []

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:441)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2414)

at net.minecraft.client.Minecraft.run(Minecraft.java:776)

at java.lang.Thread.run(Thread.java:722)

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 8 (amd64) version 6.2

Java Version: 1.7.0_21, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 814485120 bytes (776 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 17635 (987560 bytes; 0 MB) allocated, 1418 (79408 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63

FML: MCP v7.51 FML v5.2.23.738 Minecraft Forge 7.8.1.738 4 mods loaded, 4 mods active

mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{5.2.23.738} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{7.8.1.738} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Millarki{0.0.0.1} [Caves of Millarki] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

LWJGL: 2.4.2

OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 9.17.10.2849, Intel

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Texture Pack: Default

Profiler Position: N/A (disabled)

Vec3 Pool Size: 1135 (63560 bytes; 0 MB) allocated, 246 (13776 bytes; 0 MB) used

 

java.lang.NullPointerException

at net.minecraftforge.client.model.obj.WavefrontObject.renderAll(WavefrontObject.java:175)

at mods.Millarki.client.ModelAltar.render(ModelAltar.java:26)

at mods.Millarki.client.ItemAltarRenderer.renderAltar(ItemAltarRenderer.java:66)

at mods.Millarki.client.ItemAltarRenderer.renderItem(ItemAltarRenderer.java:47)

at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:160)

at net.minecraft.client.renderer.entity.RenderItem.renderItemAndEffectIntoGUI(RenderItem.java:441)

at net.minecraft.client.gui.inventory.GuiContainer.drawSlotInventory(GuiContainer.java:417)

at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:128)

at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:43)

at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:664)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1021)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:871)

at net.minecraft.client.Minecraft.run(Minecraft.java:760)

at java.lang.Thread.run(Thread.java:722)

--- END ERROR REPORT 706ae2b7 ----------

 

 

 

 

Clientproxy:

 

package mods.Millarki.client;

 

import mods.Millarki.common.CommonProxy;

import mods.Millarki.common.Millarki;

import mods.Millarki.common.TileEntityAltar;

import mods.Millarki.client.ItemAltarRenderer;

import mods.Millarki.client.TileEntityAltarRenderer;

import net.minecraftforge.client.MinecraftForgeClient;

import cpw.mods.fml.client.registry.ClientRegistry;

import cpw.mods.fml.client.registry.RenderingRegistry;

 

public class ClientProxy extends CommonProxy

{

@Override

public void InitRendering()

{

ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAltar.class, new TileEntityAltarRenderer());

 

MinecraftForgeClient.registerItemRenderer(Millarki.BLOCK_ID, new ItemAltarRenderer());

}

}

 

 

Commonproxy:

 

package mods.Millarki.common;

 

public class CommonProxy

{

public void InitRendering()

{

}

public void registerRendering()

{

 

}

public static String PURESTONE_1 = "/mods/Millarki/textures/armor/purestone_1.png";

public static String PURESTONE_2 = "/mods/Millarki/textures/armor/purestone_2.png";

public static String DARK_1 = "/mods/Millarki/textures/armor/dark_1.png";

public static String DARK_2 = "/mods/Millarki/textures/armor/dark_2.png";

}

 

Main mod class:

 

package mods.Millarki.common;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockFurnace;

import net.minecraft.block.BlockOre;

import net.minecraft.block.BlockOreStorage;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.EnumArmorMaterial;

import net.minecraft.item.EnumToolMaterial;

import net.minecraft.item.Item;

import net.minecraft.item.ItemArmor;

import net.minecraft.item.ItemAxe;

import net.minecraft.item.ItemHoe;

import net.minecraft.item.ItemPickaxe;

import net.minecraft.item.ItemSpade;

import net.minecraft.item.ItemStack;

import net.minecraft.item.ItemSword;

import net.minecraft.item.crafting.FurnaceRecipes;

import net.minecraft.world.World;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraftforge.common.BiomeDictionary;

import net.minecraftforge.common.Configuration;

import net.minecraftforge.common.DimensionManager;

import net.minecraftforge.common.EnumHelper;

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.oredict.OreDictionary;

import cpw.mods.fml.client.registry.RenderingRegistry;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.Init;

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.Mod.PreInit;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.network.NetworkRegistry;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

import net.minecraft.block.material.Material;

import cpw.mods.fml.common.registry.EntityRegistry;

import net.minecraft.entity.EnumCreatureType;

 

 

@Mod(modid = "Millarki", name = "Caves of Millarki", version = "0.0.0.1")

@NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {"Millarki"}, packetHandler = MillarkiPacketHandler.class)

public class Millarki

{

 

public final static EnumToolMaterial ROUGHBONE = EnumHelper.addToolMaterial("ROUGHBONE", 6, 100, 5.0F, 2, 10);

public final static EnumToolMaterial BONE = EnumHelper.addToolMaterial("BONE", 4, 2, 4.0F, 0, 0);

public final static EnumToolMaterial DARKBONE = EnumHelper.addToolMaterial("DARKBONE", 6, 500, 50.0F, 1, 20);

public final static EnumToolMaterial PUREBONE = EnumHelper.addToolMaterial("PUREBONE", 6, 750, 10.0F, 3, 15);

public final static EnumToolMaterial PRECIOUS = EnumHelper.addToolMaterial("PRECIOUS", 6, 2000, 15.0F, 7, 30);

public final static EnumToolMaterial FLAME = EnumHelper.addToolMaterial("FLAME", 6, 1000, 12.5F, 4, 25);

 

public final static EnumArmorMaterial PURESTONEARMOR = EnumHelper.addArmorMaterial("PURESTONEARMOR", 25, new int[]{2, 6, 5, 2}, 9);

public final static EnumArmorMaterial DARKARMOR = EnumHelper.addArmorMaterial("DARKARMOR", 25, new int[]{2, 6, 5, 2}, 9);

 

///TO DO LIST///DOESN'T HAVE TO BE IN THIS ORDER :P///

//Give the effects to all of the tools (2 weapons are done => the flame sword and the dark sword)

//Add the gods

//Add Achievements (You're boned, One down, Two Up, Final Blow)

//Add Millarki's Altar

//Organize every class into it's own map (like the tools go in the tools map, blocks in the blocks map, etc.)

//Add mcmod.info file

//Add config file + give everything a configurable ID

//Make Garnet Ore unminable by Boned Pickaxe

//Add dimension

//Add knowledge bar

//Add Book of Knowledge

 

@PreInit

public void preInit(FMLInitializationEvent event) {

 

}

public static CreativeTabs MillarkiTab = new CreativeTabs("MillarkiTab")

    {

            public ItemStack getIconItemStack()

            {

                            return new ItemStack(RoughStone, 1, 0);

            }

    };

   

   

 

@SidedProxy(clientSide = "mods.Millarki.client.ClientProxy", serverSide = "mods.Millarki.common.CommonProxy")

public static CommonProxy Proxy;

 

public final static int BLOCK_ID = 2007;

public final static Block MillarkiAltar = new MillarkiAltar(BLOCK_ID);

 

@Instance

public static Millarki instance = new Millarki();

private GuiHandler guihandler = new GuiHandler();

//Blocks

public static Block BoneBench;

public static Block RoughStone;

public static Block BoneBlock;

public static Block GarnetOre;

public static Block PurifierIdle;

public static Block PurifierLit;

public static Block PureStone;

//Tools

///Boned

public static Item BonePickaxe;

public static Item RoughBoneSword;

public static Item RoughBonePickaxe;

public static Item RoughBoneAxe;

public static Item RoughBoneShovel;

public static Item RoughBoneHoe;

public static Item DarkPickaxe;

public static Item DarkSword;

public static Item DarkAxe;

public static Item DarkShovel;

public static Item DarkHoe;

public static Item PureBoneSword;

public static Item PureBonePickaxe;

public static Item PureBoneAxe;

public static Item PureBoneShovel;

public static Item PureBoneHoe;

public static Item PreciousSword;

public static Item PreciousPickaxe;

public static Item PreciousAxe;

public static Item PreciousShovel;

public static Item PreciousHoe;

public static Item FlameSword;

public static Item FlamePickaxe;

public static Item FlameAxe;

public static Item FlameShovel;

public static Item FlameHoe;

//Items

public static Item Garnet;

public static Item PurifyGem;

public static Item PureGarnet;

public static Item DarkChunk;

public static Item DarkGem;

public static Item DarkStick;

public static Item PreciousIngot;

public static Item PreciousStick;

public static Item FlameChunk;

public static Item FlameStick;

public static Item FlameGem;

//Armor

public static Item PureStoneHelm;

public static Item PureStoneChest;

public static Item PureStoneLegs;

public static Item PureStoneBoots;

public static Item DarkHelm;

public static Item DarkChest;

public static Item DarkLegs;

public static Item DarkBoots;

 

@Init

public void load(FMLInitializationEvent event)

{

//Blocks

BoneBench = new BoneBench(2000).setHardness(1.0F).setResistance(1.0F).setUnlocalizedName("bonebench").setCreativeTab(MillarkiTab);

RoughStone = new RoughStone(2001).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("roughstone").setCreativeTab(MillarkiTab);

BoneBlock = new BoneBlock(2002).setHardness(1.0F).setResistance(1.0F).setUnlocalizedName("boneblock").setCreativeTab(MillarkiTab);

GarnetOre = new GarnetOre(2003).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("garnetore").setCreativeTab(MillarkiTab);

PurifierIdle = new Purifier(2004, false).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("purifieridle").setCreativeTab(MillarkiTab);

PurifierLit = new Purifier(2005, true).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("purifierlit");

PureStone = new PureStone(2006).setHardness(5.0F).setResistance(10.0F).setUnlocalizedName("purestone").setCreativeTab(MillarkiTab);

//Tools

///Boned

    ///Tier 0 (Bone) (Chance of dropping skeleton skull)

BonePickaxe = new BonePickaxe(7000, BONE).setMaxStackSize(1).setUnlocalizedName("bonepickaxe").setCreativeTab(MillarkiTab);

    ///Tier 1 (Rough)

RoughBoneSword = new RoughBoneSword(7001, ROUGHBONE).setMaxStackSize(1).setUnlocalizedName("roughbonesword").setCreativeTab(MillarkiTab);

RoughBonePickaxe = new RoughBonePickaxe(7002, ROUGHBONE).setMaxStackSize(1).setUnlocalizedName("roughbonepickaxe").setCreativeTab(MillarkiTab);

RoughBoneAxe = new RoughBoneAxe(7003, ROUGHBONE).setMaxStackSize(1).setUnlocalizedName("roughboneaxe").setCreativeTab(MillarkiTab);

RoughBoneShovel = new RoughBoneShovel(7004, ROUGHBONE).setMaxStackSize(1).setUnlocalizedName("roughboneshovel").setCreativeTab(MillarkiTab);

RoughBoneHoe = new RoughBoneHoe(7005, ROUGHBONE).setMaxStackSize(1).setUnlocalizedName("roughbonehoe").setCreativeTab(MillarkiTab);

///Tier 2 (Pure) (Insta-purify effect)

PureBoneSword = new PureBoneSword(7007, PUREBONE).setMaxStackSize(1).setUnlocalizedName("purebonesword").setCreativeTab(MillarkiTab);

PureBonePickaxe = new PureBonePickaxe(7008, PUREBONE).setMaxStackSize(1).setUnlocalizedName("purebonepickaxe").setCreativeTab(MillarkiTab);

PureBoneAxe = new PureBoneAxe(7009, PUREBONE).setMaxStackSize(1).setUnlocalizedName("pureboneaxe").setCreativeTab(MillarkiTab);

PureBoneShovel = new PureBoneShovel(7010, PUREBONE).setMaxStackSize(1).setUnlocalizedName("pureboneshovel").setCreativeTab(MillarkiTab);

PureBoneHoe = new PureBoneHoe(7011, PUREBONE).setMaxStackSize(1).setUnlocalizedName("purebonehoe").setCreativeTab(MillarkiTab);

///Tier 3 (Flamed)(Insta-smelt effect/fire aspect effect)

FlameSword = new FlameSword(7013, FLAME).setMaxStackSize(1).setUnlocalizedName("flamesword").setCreativeTab(MillarkiTab);

FlamePickaxe = new FlamePickaxe(7014, FLAME).setMaxStackSize(1).setUnlocalizedName("flamepickaxe").setCreativeTab(MillarkiTab);

FlameAxe = new FlameAxe(7015, FLAME).setMaxStackSize(1).setUnlocalizedName("flameaxe").setCreativeTab(MillarkiTab);

FlameShovel = new FlameShovel(7016, FLAME).setMaxStackSize(1).setUnlocalizedName("flameshovel").setCreativeTab(MillarkiTab);

FlameHoe = new FlameHoe(7017, FLAME).setMaxStackSize(1).setUnlocalizedName("flamehoe").setCreativeTab(MillarkiTab);

///Tier 4 (Extra sword name: Withered) (When holding tools, gives you blindness)

DarkSword = new DarkSword(7021, DARKBONE).setMaxStackSize(1).setUnlocalizedName("darkbonesword").setCreativeTab(MillarkiTab);

DarkPickaxe = new DarkPickaxe(7022, DARKBONE).setMaxStackSize(1).setUnlocalizedName("darkbonepickaxe").setCreativeTab(MillarkiTab);

DarkAxe = new DarkAxe(7023, DARKBONE).setMaxStackSize(1).setUnlocalizedName("darkboneaxe").setCreativeTab(MillarkiTab);

DarkShovel = new DarkShovel(7024, DARKBONE).setMaxStackSize(1).setUnlocalizedName("darkboneshovel").setCreativeTab(MillarkiTab);

DarkHoe = new DarkHoe(7025, DARKBONE).setMaxStackSize(1).setUnlocalizedName("darkbonehoe").setCreativeTab(MillarkiTab);

///Tier 5 (Precious) (Fortune V/Looting V effect)

PreciousSword = new PreciousSword(7029, PRECIOUS).setMaxStackSize(1).setUnlocalizedName("precioussword").setCreativeTab(MillarkiTab);

PreciousPickaxe = new PreciousPickaxe(7030, PRECIOUS).setMaxStackSize(1).setUnlocalizedName("preciouspickaxe").setCreativeTab(MillarkiTab);

PreciousAxe = new PreciousAxe(7031, PRECIOUS).setMaxStackSize(1).setUnlocalizedName("preciousaxe").setCreativeTab(MillarkiTab);

PreciousShovel = new PreciousShovel(7032, PRECIOUS).setMaxStackSize(1).setUnlocalizedName("preciousshovel").setCreativeTab(MillarkiTab);

PreciousHoe = new PreciousHoe(7033, PRECIOUS).setMaxStackSize(1).setUnlocalizedName("precioushoe").setCreativeTab(MillarkiTab);

//Items

Garnet = new Garnet(7006).setUnlocalizedName("garnet").setCreativeTab(MillarkiTab);

PurifyGem = new PurifyGem(7044).setUnlocalizedName("purifygem").setCreativeTab(MillarkiTab);

PureGarnet = new PureGarnet(7012).setUnlocalizedName("puregarnet").setCreativeTab(MillarkiTab);

DarkChunk = new DarkChunk(7026).setUnlocalizedName("darkchunk").setCreativeTab(MillarkiTab);

DarkGem = new DarkGem(7027).setUnlocalizedName("darkgem").setCreativeTab(MillarkiTab);

DarkStick = new DarkStick(7028).setUnlocalizedName("darkstick").setCreativeTab(MillarkiTab);

PreciousIngot = new PreciousIngot(7034).setUnlocalizedName("preciousingot").setCreativeTab(MillarkiTab);

PreciousStick = new PreciousStick(7035).setUnlocalizedName("preciousstick").setCreativeTab(MillarkiTab);

FlameChunk = new FlameChunk(7018).setUnlocalizedName("flamepallet").setCreativeTab(MillarkiTab);

FlameStick = new FlameStick(7020).setUnlocalizedName("flamestick").setCreativeTab(MillarkiTab);

FlameGem = new FlameGem(7019).setUnlocalizedName("flamegem").setCreativeTab(MillarkiTab);

//Armour

PureStoneHelm  = new PureStoneArmor(7036, PURESTONEARMOR, 1, 0).setMaxStackSize(1).setUnlocalizedName("purestonehelm").setCreativeTab(MillarkiTab);

PureStoneChest = new PureStoneArmor(7037, PURESTONEARMOR, 1, 1).setMaxStackSize(1).setUnlocalizedName("purestonechest").setCreativeTab(MillarkiTab);

PureStoneLegs = new PureStoneArmor(7038, PURESTONEARMOR, 1, 2).setMaxStackSize(1).setUnlocalizedName("purestonepants").setCreativeTab(MillarkiTab);

PureStoneBoots = new PureStoneArmor(7039, PURESTONEARMOR, 1, 3).setMaxStackSize(1).setUnlocalizedName("purestoneboots").setCreativeTab(MillarkiTab);

DarkHelm = new DarkArmor(7040, DARKARMOR, 1, 0).setMaxStackSize(1).setUnlocalizedName("darkhelmet").setCreativeTab(MillarkiTab);

DarkChest = new DarkArmor(7041, DARKARMOR, 1, 1).setMaxStackSize(1).setUnlocalizedName("darkchest").setCreativeTab(MillarkiTab);

DarkLegs = new DarkArmor(7042, DARKARMOR, 1, 2).setMaxStackSize(1).setUnlocalizedName("darklegs").setCreativeTab(MillarkiTab);

DarkBoots = new DarkArmor(7043, DARKARMOR, 1, 3).setMaxStackSize(1).setUnlocalizedName("darkboots").setCreativeTab(MillarkiTab);

 

 

 

MinecraftForge.setBlockHarvestLevel(RoughStone, "pickaxe", 5);

MinecraftForge.setBlockHarvestLevel(GarnetOre, "pickaxe", 6);

MinecraftForge.setBlockHarvestLevel(PureStone, "pickaxe", 6);

MinecraftForge.setBlockHarvestLevel(PurifierIdle, "pickaxe", 6);

MinecraftForge.setBlockHarvestLevel(PurifierLit, "pickaxe", 6);

 

 

NetworkRegistry.instance().registerGuiHandler(this, guihandler);

 

GameRegistry.registerTileEntity(TileEntityPurifier.class, "TileEntityPurifier");

GameRegistry.registerTileEntity(TileEntityAltar.class, "TileEntityAltar");

 

LanguageRegistry.instance().addStringLocalization("itemGroup.MillarkiTab", "en_US", "Caves of Millarki");

 

LanguageRegistry.addName(BoneBench, "Boned Workbench");

LanguageRegistry.addName(RoughStone, "Rough Stone");

LanguageRegistry.addName(RoughBonePickaxe, "Rough Pickaxe");

LanguageRegistry.addName(RoughBoneAxe, "Rough Axe");

LanguageRegistry.addName(RoughBoneShovel, "Rough Shovel");

LanguageRegistry.addName(RoughBoneHoe, "Rough Hoe");

LanguageRegistry.addName(RoughBoneSword, "Rough Sword");

LanguageRegistry.addName(BoneBlock, "Block of Bones");

LanguageRegistry.addName(BonePickaxe, "Boned Pickaxe");

LanguageRegistry.addName(Garnet, "Garnet");

LanguageRegistry.addName(GarnetOre, "Garnet Ore");

LanguageRegistry.addName(PurifierIdle, "Purifier");

LanguageRegistry.addName(PurifyGem, "Purify Gem");

LanguageRegistry.addName(PureGarnet, "Pure Garnet");

LanguageRegistry.addName(PureStone, "Pure Stone");

LanguageRegistry.addName(PureStoneHelm, "Purestone Helmet");

LanguageRegistry.addName(PureStoneChest, "Purestone Chestplate");

LanguageRegistry.addName(PureStoneLegs, "Purestone Leggings");

LanguageRegistry.addName(PureStoneBoots, "Purestone Boots");

LanguageRegistry.addName(DarkPickaxe, "Darkened Pickaxe");

LanguageRegistry.addName(DarkAxe, "Darkened Axe");

LanguageRegistry.addName(DarkShovel, "Darkened Shovel");

LanguageRegistry.addName(DarkSword, "Darkened Sword");

LanguageRegistry.addName(DarkHoe, "Dark Hoe");

LanguageRegistry.addName(DarkHelm, "Darkened Helmet");

LanguageRegistry.addName(DarkChest, "Darkened Chestplate");

LanguageRegistry.addName(DarkLegs, "Darkened Leggings");

LanguageRegistry.addName(DarkBoots, "Darkened Boots");

LanguageRegistry.addName(DarkChunk, "Dark Chunk");

LanguageRegistry.addName(DarkGem,  "Dark Gem");

LanguageRegistry.addName(PureBonePickaxe, "Pure Pickaxe");

LanguageRegistry.addName(PureBoneAxe, "Pure Axe");

LanguageRegistry.addName(PureBoneShovel, "Pure Shovel");

LanguageRegistry.addName(PureBoneHoe, "Pure Hoe");

LanguageRegistry.addName(PureBoneSword, "Pure Sword");

LanguageRegistry.addName(PreciousPickaxe, "Precious Pickaxe");

LanguageRegistry.addName(PreciousAxe, "Precious Axe");

LanguageRegistry.addName(PreciousShovel, "Precious Shovel");

LanguageRegistry.addName(PreciousHoe, "Precious Hoe");

LanguageRegistry.addName(PreciousSword, "Precious Sword");

LanguageRegistry.addName(PreciousIngot, "Precious Ingot");

LanguageRegistry.addName(PreciousStick, "Precious Stick");

LanguageRegistry.addName(FlamePickaxe, "Flame Pickaxe");

LanguageRegistry.addName(FlameAxe, "Flame Axe");

LanguageRegistry.addName(FlameShovel, "Flame Shovel");

LanguageRegistry.addName(FlameHoe, "Flame Hoe");

LanguageRegistry.addName(FlameSword, "Flame Sword");

LanguageRegistry.addName(FlameChunk, "Flame Chunk");

LanguageRegistry.addName(FlameStick, "Flame Stick");

LanguageRegistry.addName(FlameGem, "Flame Gem");

LanguageRegistry.addName(DarkStick, "Dark Stick");

 

Proxy.InitRendering();

 

GameRegistry.registerBlock(RoughStone, "Stone.RoughStone");

GameRegistry.registerBlock(BoneBench, "Boned.BoneBench");

GameRegistry.registerBlock(BoneBlock, "Boned.BoneBlock");

GameRegistry.registerBlock(PureStone, "Pure.PureStone");

GameRegistry.registerBlock(GarnetOre, "Ore.GarnetOre");

GameRegistry.registerBlock(PurifierIdle, "Purifier.PurifierIdle");

GameRegistry.registerBlock(PurifierLit, "Purifier.PurifierLit");

GameRegistry.registerBlock(MillarkiAltar, "Altar.MillarkiAltar");

 

ItemStack bone = new ItemStack(Item.bone);

ItemStack bonb = new ItemStack(BoneBlock);

 

GameRegistry.addRecipe(new ItemStack (BoneBlock), "bbb", "bbb", "bbb",

'b', bone);

GameRegistry.addRecipe(new ItemStack (BoneBench), " xx", " xx", "  ",

'x', bonb);

GameRegistry.addRecipe(new ItemStack (BoneBench), "  ", "xx ", "xx ",

'x', bonb);

GameRegistry.addRecipe(new ItemStack (BoneBench), "  ", " xx", " xx",

'x', bonb);

 

GameRegistry.addShapelessRecipe(new ItemStack(PurifyGem), new Object[]{

new ItemStack(Item.diamond), new ItemStack(Garnet)

 

});

}}

 

 

 

 

Block class:

 

package mods.Millarki.common;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.player.EntityPlayer;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.World;

 

public class MillarkiAltar extends Block

{

public MillarkiAltar(int id)

{

super(id, Material.rock);

 

setUnlocalizedName("millarkialtar");

setHardness(5f);

setCreativeTab(Millarki.MillarkiTab);

}

 

@Override

public boolean hasTileEntity(int metadata)

{

return true;

}

 

@Override

public boolean renderAsNormalBlock()

{

return false;

}

 

@Override

public boolean isOpaqueCube()

{

return false;

}

 

@Override

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer playerEntity, int par6, float par7, float par8, float par9)

{

if(playerEntity.isSneaking())

return false;

 

playerEntity.setEntityHealth(0);

return true;

}

 

@Override

public TileEntity createTileEntity(World world, int metadata)

{

return new TileEntityAltar();

}

 

@Override

public int getRenderType()

{

return -1;

}

}

 

 

TileEntityBlock class:

 

package mods.Millarki.common;

 

import net.minecraft.tileentity.TileEntity;

 

public class TileEntityAltar extends TileEntity

{

public TileEntityAltar()

{

}

}

 

 

ItemBlockRenderer class:

 

package mods.Millarki.client;

 

import net.minecraft.item.ItemStack;

import net.minecraftforge.client.IItemRenderer;

 

import org.lwjgl.opengl.GL11;

 

import cpw.mods.fml.client.FMLClientHandler;

 

public class ItemAltarRenderer implements IItemRenderer

{

private ModelAltar modelAltar;

 

public ItemAltarRenderer()

{

modelAltar = new ModelAltar();

}

 

@Override

public boolean handleRenderType(ItemStack item, ItemRenderType type)

{

return true;

}

 

@Override

public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)

{

return true;

}

 

@Override

public void renderItem(ItemRenderType type, ItemStack item, Object... data)

{

switch(type)

{

case ENTITY:{

renderAltar(0f, 0f, 0f, 0.5f);

return;

}

 

case EQUIPPED:{

renderAltar(0f, 1f, 1f, 0.5f);

return;

}

 

case INVENTORY:{

renderAltar(0f, 0f, 0f, 0.5f);

return;

}

 

default:return;

}

}

 

private void renderAltar(float x, float y, float z, float scale)

{

GL11.glPushMatrix();

GL11.glDisable(GL11.GL_LIGHTING);

 

GL11.glTranslatef(x,  y,  z);

GL11.glScalef(scale, scale, scale);

GL11.glRotatef(180f, 0f, 1f, 0f);

 

FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/Millarki/textures/blocks/MillarkiAltar.png");

 

modelAltar.render();

 

GL11.glEnable(GL11.GL_LIGHTING);

GL11.glPopMatrix();

}

}

 

 

ModelBlock class:

 

package mods.Millarki.client;

 

import mods.Millarki.common.TileEntityAltar;

import net.minecraft.client.model.ModelBase;

import net.minecraftforge.client.model.AdvancedModelLoader;

import net.minecraftforge.client.model.IModelCustom;

 

import org.lwjgl.opengl.GL11;

 

import cpw.mods.fml.client.FMLClientHandler;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

@SideOnly(Side.CLIENT)

public class ModelAltar extends ModelBase

{

private IModelCustom modelAltar;

 

public ModelAltar()

{

modelAltar = AdvancedModelLoader.loadModel("/mods/Millarki/models/MillarkiAltar.obj");

}

 

public void render()

{

modelAltar.renderAll();

}

 

public void render(TileEntityAltar box, double x, double y, double z)

{

// Push a blank matrix onto the stack

GL11.glPushMatrix();

 

// Move the object into the correct position on the block (because the OBJ's origin is the center of the object)

GL11.glTranslatef((float)x + 0.5f, (float)y + 0.5f, (float)z + 0.5f);

 

// Scale our object to about half-size in all directions (the OBJ file is a little large)

GL11.glScalef(0.5f, 0.5f, 0.5f);

 

// Bind the texture, so that OpenGL properly textures our block.

FMLClientHandler.instance().getClient().renderEngine.bindTexture("/mods/Millarki/textures/blocks/MillarkiAltar.png");

 

// Render the object, using modelAltar.renderAll();

this.render();

 

// Pop this matrix from the stack.

GL11.glPopMatrix();

}

}

 

 

TileEntityBlockRenderer class:

 

package mods.Millarki.client;

 

import mods.Millarki.common.TileEntityAltar;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.tileentity.TileEntity;

 

public class TileEntityAltarRenderer extends TileEntitySpecialRenderer

{

private ModelAltar modelAltar = new ModelAltar();

 

@Override

public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick)

{

modelAltar.render((TileEntityAltar)tileEntity, x, y, z);

}

}

 

 

Block.obj:

 

// Date: 25-6-2013 16:47:57

// Template version 1.1

// Java generated by Techne

// Keep in mind that you still need to fill in some blanks

// - ZeuX

 

 

 

 

 

 

package net.minecraft.src;

 

public class ModelNew extends ModelBase

{

  //fields

    ModelRenderer Plate;

    ModelRenderer Candle1;

    ModelRenderer BookStand;

    ModelRenderer Candle2;

    ModelRenderer Candle3;

    ModelRenderer Candle4;

    ModelRenderer PlateHolder;

    ModelRenderer Page1;

    ModelRenderer Page2;

    ModelRenderer Book1;

    ModelRenderer Book2;

 

  public ModelNew()

  {

    textureWidth = 266;

    textureHeight = 202;

   

      Plate = new ModelRenderer(this, 88, 0);

      Plate.addBox(0F, 0F, 0F, 16, 3, 16);

      Plate.setRotationPoint(-8F, 15F, -8F);

      Plate.setTextureSize(266, 202);

      Plate.mirror = true;

      setRotation(Plate, 0F, 0F, 0F);

      Candle1 = new ModelRenderer(this, 0, 0);

      Candle1.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle1.setRotationPoint(5F, 12F, 4F);

      Candle1.setTextureSize(266, 202);

      Candle1.mirror = true;

      setRotation(Candle1, 0F, 0F, 0F);

      BookStand = new ModelRenderer(this, 42, 46);

      BookStand.addBox(0F, 0F, 0F, 3, 3, 8);

      BookStand.setRotationPoint(4F, 12F, 2F);

      BookStand.setTextureSize(266, 202);

      BookStand.mirror = true;

      setRotation(BookStand, 0F, -1.570796F, 0F);

      Candle2 = new ModelRenderer(this, 0, 0);

      Candle2.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle2.setRotationPoint(5F, 12F, -6F);

      Candle2.setTextureSize(266, 202);

      Candle2.mirror = true;

      setRotation(Candle2, 0F, 0F, 0F);

      Candle3 = new ModelRenderer(this, 0, 0);

      Candle3.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle3.setRotationPoint(-7F, 12F, 4F);

      Candle3.setTextureSize(266, 202);

      Candle3.mirror = true;

      setRotation(Candle3, 0F, 0F, 0F);

      Candle4 = new ModelRenderer(this, 0, 0);

      Candle4.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle4.setRotationPoint(-7F, 12F, -6F);

      Candle4.setTextureSize(266, 202);

      Candle4.mirror = true;

      setRotation(Candle4, 0F, 0F, 0F);

      PlateHolder = new ModelRenderer(this, 58, 20);

      PlateHolder.addBox(0F, 0F, 0F, 10, 6, 10);

      PlateHolder.setRotationPoint(-5F, 18F, -5F);

      PlateHolder.setTextureSize(266, 202);

      PlateHolder.mirror = true;

      setRotation(PlateHolder, 0F, 0F, 0F);

      Page1 = new ModelRenderer(this, 0, 6);

      Page1.addBox(0F, 0F, 0F, 4, 1, 5);

      Page1.setRotationPoint(0.3F, 13.75F, -3.7F);

      Page1.setTextureSize(266, 202);

      Page1.mirror = true;

      setRotation(Page1, 0.2792527F, 0.0698132F, -0.2094395F);

      Page2 = new ModelRenderer(this, 0, 6);

      Page2.addBox(0F, 0F, 0F, 4, 1, 5);

      Page2.setRotationPoint(-0.5F, 14.7F, -3.5F);

      Page2.setTextureSize(266, 202);

      Page2.mirror = true;

      setRotation(Page2, -0.2792527F, 0F, -2.932153F);

      Book1.mirror = true;

      Book1 = new ModelRenderer(this, -6, 12);

      Book1.addBox(0F, 0F, 0F, 5, 0, 6);

      Book1.setRotationPoint(0F, 15F, -4F);

      Book1.setTextureSize(266, 202);

      Book1.mirror = true;

      setRotation(Book1, 0.2792527F, 0.0698132F, -0.2094395F);

      Book1.mirror = false;

      Book2 = new ModelRenderer(this, -6, 12);

      Book2.addBox(0F, 0F, 0F, 5, 0, 6);

      Book2.setRotationPoint(0F, 15F, -4F);

      Book2.setTextureSize(266, 202);

      Book2.mirror = true;

      setRotation(Book2, -0.2792527F, 0F, -2.932153F);

  }

 

  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

  {

    super.render(entity, f, f1, f2, f3, f4, f5);

    setRotationAngles(f, f1, f2, f3, f4, f5);

    Plate.render(f5);

    Candle1.render(f5);

    BookStand.render(f5);

    Candle2.render(f5);

    Candle3.render(f5);

    Candle4.render(f5);

    PlateHolder.render(f5);

    Page1.render(f5);

    Page2.render(f5);

    Book1.render(f5);

    Book2.render(f5);

  }

 

  private void setRotation(ModelRenderer model, float x, float y, float z)

  {

    model.rotateAngleX = x;

    model.rotateAngleY = y;

    model.rotateAngleZ = z;

  }

 

  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)

  {

    super.setRotationAngles(f, f1, f2, f3, f4, f5);

  }

 

}

 

 

(The .obj was a .java out of Techne first, but I renamed it to .obj)

Thanks already :)

Link to comment
Share on other sites

  • Replies 80
  • Created
  • Last Reply

Top Posters In This Topic

That's not a Wavefront file. I don't think that Techne outputs Wavefront files.

What should I do with it then?

Convert it manually, find a converter (which I doubt you'll be able to do), or find another program that makes wavefront files.

 

Or just use it as a normal renderer. Why do you need a Wavefront renderer?

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

That's not a Wavefront file. I don't think that Techne outputs Wavefront files.

What should I do with it then?

Convert it manually, find a converter (which I doubt you'll be able to do), or find another program that makes wavefront files.

 

Or just use it as a normal renderer. Why do you need a Wavefront renderer?

I just copied the code from the tutorial and edited it to my codes. I can however make the model into a .java but I've tried that with this and it didn't work.

Link to comment
Share on other sites

That's not a Wavefront file. I don't think that Techne outputs Wavefront files.

What should I do with it then?

Convert it manually, find a converter (which I doubt you'll be able to do), or find another program that makes wavefront files.

 

Or just use it as a normal renderer. Why do you need a Wavefront renderer?

I just copied the code from the tutorial and edited it to my codes. I can however make the model into a .java but I've tried that with this and it didn't work.

"It doesn't work." Then we can fix it. Describe how it doesn't work. But it's going to work even less if you try it like this.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

That's not a Wavefront file. I don't think that Techne outputs Wavefront files.

What should I do with it then?

Convert it manually, find a converter (which I doubt you'll be able to do), or find another program that makes wavefront files.

 

Or just use it as a normal renderer. Why do you need a Wavefront renderer?

I just copied the code from the tutorial and edited it to my codes. I can however make the model into a .java but I've tried that with this and it didn't work.

"It doesn't work." Then we can fix it. Describe how it doesn't work. But it's going to work even less if you try it like this.

Okay, so I put in the model.java and edited the model code so it doesn't say .obj anymore instead it says .java.

And I get this error on startup:

 

 

 

      Minecraft has crashed!     

      ----------------------     

 

Minecraft has stopped running because it encountered a problem; Failed to start game

 

A full error report has been saved to C:\Users\Dennis\Downloads\Minecraft\Mod\Caves of Millarki 1.5.2\forge\jars\.\crash-reports\crash-2013-06-25_20.41.45-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(

 

 

 

--- BEGIN ERROR REPORT 8f719398 --------

Full report at:

C:\Users\Dennis\Downloads\Minecraft\Mod\Caves of Millarki 1.5.2\forge\jars\.\crash-reports\crash-2013-06-25_20.41.45-client.txt

Please show that file to Mojang, NOT just this screen!

 

Generated 25-6-13 20:41

 

-- System Details --

Details:

Minecraft Version: 1.5.2

Operating System: Windows 8 (amd64) version 6.2

Java Version: 1.7.0_21, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 798883048 bytes (761 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Suspicious classes: FML and Forge are installed

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v7.51 FML v5.2.23.738 Minecraft Forge 7.8.1.738 4 mods loaded, 4 mods active

mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

FML{5.2.23.738} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Forge{7.8.1.738} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

Millarki{0.0.0.1} [Caves of Millarki] (bin) Unloaded->Constructed->Pre-initialized->Errored

LWJGL: 2.4.2

OpenGL: Intel® HD Graphics 4000 GL version 4.0.0 - Build 9.17.10.2849, Intel

Is Modded: Definitely; Client brand changed to 'fml,forge'

Type: Client (map_client.txt)

Texture Pack: Default

Profiler Position: N/A (disabled)

Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

 

java.lang.IllegalArgumentException: The resource name is not supported

at net.minecraftforge.client.model.AdvancedModelLoader.loadModel(AdvancedModelLoader.java:60)

at mods.Millarki.client.ModelAltar.<init>(ModelAltar.java:21)

at mods.Millarki.client.TileEntityAltarRenderer.<init>(TileEntityAltarRenderer.java:9)

at mods.Millarki.client.ClientProxy.InitRendering(ClientProxy.java:17)

at mods.Millarki.common.Millarki.load(Millarki.java:300)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:494)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:213)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:448)

at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)

at net.minecraft.client.Minecraft.run(Minecraft.java:733)

at java.lang.Thread.run(Thread.java:722)

--- END ERROR REPORT be6f72d ----------

 

 

 

 

Model.java file:

 

// Date: 25-6-2013 20:32:22

// Template version 1.1

// Java generated by Techne

// Keep in mind that you still need to fill in some blanks

// - ZeuX

 

package mods.Millarki.models;

 

import net.minecraft.client.model.ModelBase;

import net.minecraft.client.model.ModelRenderer;

import net.minecraft.entity.Entity;

 

public class MillarkiAltar extends ModelBase

{

  //fields

    ModelRenderer Plate;

    ModelRenderer Candle1;

    ModelRenderer BookStand;

    ModelRenderer Candle2;

    ModelRenderer Candle3;

    ModelRenderer Candle4;

    ModelRenderer PlateHolder;

    ModelRenderer Page1;

    ModelRenderer Page2;

    ModelRenderer Book1;

    ModelRenderer Book2;

 

  public MillarkiAltar()

  {

    textureWidth = 266;

    textureHeight = 202;

   

      Plate = new ModelRenderer(this, 88, 0);

      Plate.addBox(0F, 0F, 0F, 16, 3, 16);

      Plate.setRotationPoint(-8F, 15F, -8F);

      Plate.setTextureSize(266, 202);

      Plate.mirror = true;

      setRotation(Plate, 0F, 0F, 0F);

      Candle1 = new ModelRenderer(this, 0, 0);

      Candle1.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle1.setRotationPoint(5F, 12F, 4F);

      Candle1.setTextureSize(266, 202);

      Candle1.mirror = true;

      setRotation(Candle1, 0F, 0F, 0F);

      BookStand = new ModelRenderer(this, 42, 46);

      BookStand.addBox(0F, 0F, 0F, 3, 3, 8);

      BookStand.setRotationPoint(4F, 12F, 2F);

      BookStand.setTextureSize(266, 202);

      BookStand.mirror = true;

      setRotation(BookStand, 0F, -1.570796F, 0F);

      Candle2 = new ModelRenderer(this, 0, 0);

      Candle2.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle2.setRotationPoint(5F, 12F, -6F);

      Candle2.setTextureSize(266, 202);

      Candle2.mirror = true;

      setRotation(Candle2, 0F, 0F, 0F);

      Candle3 = new ModelRenderer(this, 0, 0);

      Candle3.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle3.setRotationPoint(-7F, 12F, 4F);

      Candle3.setTextureSize(266, 202);

      Candle3.mirror = true;

      setRotation(Candle3, 0F, 0F, 0F);

      Candle4 = new ModelRenderer(this, 0, 0);

      Candle4.addBox(0F, 0F, 0F, 2, 3, 2);

      Candle4.setRotationPoint(-7F, 12F, -6F);

      Candle4.setTextureSize(266, 202);

      Candle4.mirror = true;

      setRotation(Candle4, 0F, 0F, 0F);

      PlateHolder = new ModelRenderer(this, 58, 20);

      PlateHolder.addBox(0F, 0F, 0F, 10, 6, 10);

      PlateHolder.setRotationPoint(-5F, 18F, -5F);

      PlateHolder.setTextureSize(266, 202);

      PlateHolder.mirror = true;

      setRotation(PlateHolder, 0F, 0F, 0F);

      Page1 = new ModelRenderer(this, 0, 6);

      Page1.addBox(0F, 0F, 0F, 4, 1, 5);

      Page1.setRotationPoint(0.3F, 13.75F, -3.7F);

      Page1.setTextureSize(266, 202);

      Page1.mirror = true;

      setRotation(Page1, 0.2792527F, 0.0698132F, -0.2094395F);

      Page2 = new ModelRenderer(this, 0, 6);

      Page2.addBox(0F, 0F, 0F, 4, 1, 5);

      Page2.setRotationPoint(-0.5F, 14.7F, -3.5F);

      Page2.setTextureSize(266, 202);

      Page2.mirror = true;

      setRotation(Page2, -0.2792527F, 0F, -2.932153F);

      Book1.mirror = true;

      Book1 = new ModelRenderer(this, -6, 12);

      Book1.addBox(0F, 0F, 0F, 5, 0, 6);

      Book1.setRotationPoint(0F, 15F, -4F);

      Book1.setTextureSize(266, 202);

      Book1.mirror = true;

      setRotation(Book1, 0.2792527F, 0.0698132F, -0.2094395F);

      Book1.mirror = false;

      Book2 = new ModelRenderer(this, -6, 12);

      Book2.addBox(0F, 0F, 0F, 5, 0, 6);

      Book2.setRotationPoint(0F, 15F, -4F);

      Book2.setTextureSize(266, 202);

      Book2.mirror = true;

      setRotation(Book2, -0.2792527F, 0F, -2.932153F);

  }

 

  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)

  {

    super.render(entity, f, f1, f2, f3, f4, f5);

    setRotationAngles(f, f1, f2, f3, f4, f5, entity);

    Plate.render(f5);

    Candle1.render(f5);

    BookStand.render(f5);

    Candle2.render(f5);

    Candle3.render(f5);

    Candle4.render(f5);

    PlateHolder.render(f5);

    Page1.render(f5);

    Page2.render(f5);

    Book1.render(f5);

    Book2.render(f5);

  }

 

  private void setRotation(ModelRenderer model, float x, float y, float z)

  {

    model.rotateAngleX = x;

    model.rotateAngleY = y;

    model.rotateAngleZ = z;

  }

 

  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent)

  {

    super.setRotationAngles(f, f1, f2, f3, f4, f5, ent);

  }

 

}

 

 

 

Link to comment
Share on other sites

look for a better tutorial. your "ModelBlock" class is totally unnecessary and most likely the culprit. your "Block.obj" should already be your model class and you don't need to go through those roundabout ways to access it.

Link to comment
Share on other sites

look for a better tutorial. your "ModelBlock" class is totally unnecessary and most likely the culprit. your "Block.obj" should already be your model class and you don't need to go through those roundabout ways to access it.

So, delete the block class and...?

Link to comment
Share on other sites

get rid of your ModelBlock class and replace it with the java file that you got from techne. it's your "Block.obj", but why you changed it to a .obj file, i have no idea why. change it back to a .java file. after you replace the ModelBlock class, you're going to get errors at first because now that it's replaced, this method

 

   public void render()
   {
      modelAltar.renderAll();
   }

 

is gone. so go edit your techne file and change this method

 

  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5);
    Plate.render(f5);
    Candle1.render(f5);
    BookStand.render(f5);
    Candle2.render(f5);
    Candle3.render(f5);
    Candle4.render(f5);
    PlateHolder.render(f5);
    Page1.render(f5);
    Page2.render(f5);
    Book1.render(f5);
    Book2.render(f5);
  }

 

to this

 

//you don't necessarily need to remove all the parameters. add more if you want more control over the rendering
  public void render()
  {
    // this is the scale of the model. change it if you want.
    float f5 = 0.0625F;

    Plate.render(f5);
    Candle1.render(f5);
    BookStand.render(f5);
    Candle2.render(f5);
    Candle3.render(f5);
    Candle4.render(f5);
    PlateHolder.render(f5);
    Page1.render(f5);
    Page2.render(f5);
    Book1.render(f5);
    Book2.render(f5);
  }

 

afterward, if your game stops crashing and you're able to place your block down but you don't see anything being rendered, it's most likely because the translations or scale isn't right. so you're going to have to play around with them to get it rendered in the right place and in the right size

 

what i said in a nutshell:

 

your ModelBlock class is bs. your Block.obj should be your ModelAltar.

Link to comment
Share on other sites

Okay, so I did that. And I had to change a few things in the main mod file:

 

Changed this: public final static Block MillarkiAltar = new MillarkiAltar(BLOCK_ID);

 

To: public final static mods.Millarki.common.MillarkiAltar MillarkiAltar = new MillarkiAltar();

 

And when I try to run the game it crashes

Console log:

 

2013-06-25 22:54:08 [iNFO] [ForgeModLoader] Forge Mod Loader version 5.2.23.738 for Minecraft 1.5.2 loading

2013-06-25 22:54:08 [iNFO] [ForgeModLoader] Java is Java HotSpot 64-Bit Server VM, version 1.7.0_21, running on Windows 8:amd64:6.2, installed at C:\Program Files\Java\jdk1.7.0_21\jre

2013-06-25 22:54:08 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

2013-06-25 22:54:11 [iNFO] [sTDOUT] 229 recipes

2013-06-25 22:54:11 [iNFO] [sTDOUT] 27 achievements

2013-06-25 22:54:11 [iNFO] [Minecraft-Client] Setting user: Player312

2013-06-25 22:54:11 [iNFO] [sTDOUT] (Session ID is -)

2013-06-25 22:54:11 [iNFO] [sTDERR] Client asked for parameter: server

2013-06-25 22:54:11 [iNFO] [Minecraft-Client] LWJGL Version: 2.4.2

2013-06-25 22:54:12 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization

2013-06-25 22:54:12 [iNFO] [sTDOUT] MinecraftForge v7.8.1.738 Initialized

2013-06-25 22:54:12 [iNFO] [ForgeModLoader] MinecraftForge v7.8.1.738 Initialized

2013-06-25 22:54:12 [iNFO] [sTDOUT] Replaced 85 ore recipies

2013-06-25 22:54:12 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization

2013-06-25 22:54:12 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Dennis\Downloads\Minecraft\Mod\Caves of Millarki 1.5.2\forge\jars\config\logging.properties

2013-06-25 22:54:12 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL

2013-06-25 22:54:12 [iNFO] [ForgeModLoader] Searching C:\Users\Dennis\Downloads\Minecraft\Mod\Caves of Millarki 1.5.2\forge\jars\mods for mods

2013-06-25 22:54:13 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load

2013-06-25 22:54:13 [iNFO] [mcp] Activating mod mcp

2013-06-25 22:54:13 [iNFO] [FML] Activating mod FML

2013-06-25 22:54:13 [iNFO] [Forge] Activating mod Forge

2013-06-25 22:54:13 [iNFO] [Millarki] Activating mod Millarki

2013-06-25 22:54:13 [iNFO] [ForgeModLoader] Registering Forge Packet Handler

2013-06-25 22:54:13 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler

2013-06-25 22:54:13 [iNFO] [sTDERR] Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError

2013-06-25 22:54:13 [iNFO] [sTDERR] at java.lang.Class.forName0(Native Method)

2013-06-25 22:54:13 [iNFO] [sTDERR] at java.lang.Class.forName(Class.java:266)

2013-06-25 22:54:13 [iNFO] [sTDERR] at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:425)

2013-06-25 22:54:13 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2013-06-25 22:54:13 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

2013-06-25 22:54:13 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

2013-06-25 22:54:13 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Method.java:601)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2013-06-25 22:54:13 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:192)

2013-06-25 22:54:13 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:172)

2013-06-25 22:54:13 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2013-06-25 22:54:13 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

2013-06-25 22:54:13 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

2013-06-25 22:54:13 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Method.java:601)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

2013-06-25 22:54:13 [iNFO] [sTDERR] at com.google.common.eventbus.EventBus.post(EventBus.java:267)

2013-06-25 22:54:13 [iNFO] [sTDERR] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:103)

2013-06-25 22:54:13 [iNFO] [sTDERR] at cpw.mods.fml.common.Loader.loadMods(Loader.java:504)

2013-06-25 22:54:13 [iNFO] [sTDERR] at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:163)

2013-06-25 22:54:13 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:411)

2013-06-25 22:54:13 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)

2013-06-25 22:54:13 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:733)

2013-06-25 22:54:13 [iNFO] [sTDERR] at java.lang.Thread.run(Thread.java:722)

2013-06-25 22:54:13 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException

2013-06-25 22:54:13 [iNFO] [sTDERR] at mods.Millarki.common.MillarkiAltar.<init>(MillarkiAltar.java:87)

2013-06-25 22:54:13 [iNFO] [sTDERR] at mods.Millarki.common.Millarki.<clinit>(Millarki.java:105)

2013-06-25 22:54:13 [iNFO] [sTDERR] ... 30 more

 

 

Link to comment
Share on other sites

yeah i don't think you understood what i said at all.... none of the things i said required you to change the MillarkiAltar class...

Read the OP and the thread. He used a tutorial for making special models, which I pointed out was unnecessary. You told him to replace the .obj file with .java, which he had already done, you restated what I had already said, and then you told him to delete his block class, which has caused an unnecessary tangle. Really, I was doing alright before you butted in.

 

@Nieue: Yes, that is the correct tutorial.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

yeah i don't think you understood what i said at all.... none of the things i said required you to change the MillarkiAltar class...

Read the OP and the thread. He used a tutorial for making special models, which I pointed out was unnecessary. You told him to replace the .obj file with .java, which he had already done, you restated what I had already said, and then you told him to delete his block class, which has caused an unnecessary tangle. Really, I was doing alright before you butted in.

 

@Nieue: Yes, that is the correct tutorial.

 

read my post again. i said "ModelBlock" class not "Block" class. he already has the necessary files to make it work and just needs to get rid of a few stuff. tried to help, but not my fault if neither of you read carefully. but whatever then. i'll stop butting in so you can help him, my lord.

Link to comment
Share on other sites

I followed this (http://www.minecraftforge.net/wiki/Custom_Tile_Entity_Renderer) tutorial, and I got an error when putting in the last line in my renderer class:

 

package mods.Millarki.client;

 

import mods.Millarki.common.Millarki;

import mods.Millarki.common.TileEntityAltar;

import net.minecraft.block.Block;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import org.lwjgl.opengl.GL11;

 

public class TileEntityAltarRenderer extends TileEntitySpecialRenderer{

    //This method is called when minecraft renders a tile entity

    public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {

        GL11.glPushMatrix();

        //This will move our renderer so that it will be on proper place in the world

        GL11.glTranslatef((float)d, (float)d1, (float)d2);

        TileEntityAltar tileEntityAltar = (TileEntityAltar)tileEntity;

        /*Note that true tile entity coordinates (tileEntity.xCoord, etc) do not match to render coordinates (d, etc) that are calculated as [true coordinates] - [player coordinates (camera coordinates)]*/

        renderBlockAltar(tileEntityAltar, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Millarki.MillarkiAltar);

        GL11.glPopMatrix();

    }

    //And this method actually renders your tile entity

    public void renderBlockAltar(TileEntityAltar tl, World world, int i, int j, int k, Block block) {

        Tessellator tessellator = Tessellator.instance;

        //This will make your block brightness dependent from surroundings lighting.

        float f = block.getBlockBrightness(world, i, j, k);

        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

        int l1 = l % 65536;

        int l2 = l / 65536;

        tessellator.setColorOpaque_F(f, f, f);

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);

       

        /*This will rotate your model corresponding to player direction that was when you placed the block. If you want this to work,

        add these lines to onBlockPlacedBy method in your block class.

        int dir = MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 0.5D) & 3;

        world.setBlockMetadataWithNotify(x, y, z, dir, 0);*/

 

        int dir = world.getBlockMetadata(i, j, k);

       

        GL11.glPushMatrix();

        GL11.glTranslatef(0.5F, 0, 0.5F);

        //This line actually rotates the renderer.

        GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);

        GL11.glTranslatef(-0.5F, 0, -0.5F);

        bindTextureByName("mods/Millarki/textures/blocks/MillarkiAltar.png");

        /*

        Place your rendering code here.

        */

        GL11.glPopMatrix();

        mods.Millarki.models.AltarModel model = new mods.Millarki.models.AltarModel();

        this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

 

    }

}

 

error on this.model.render...... error quick fix = Create field 'model' in this class & create constant 'model' in this class

Probably a very nooblike fault of me. But I don't know how to fix it :(

Link to comment
Share on other sites

I followed this (http://www.minecraftforge.net/wiki/Custom_Tile_Entity_Renderer) tutorial, and I got an error when putting in the last line in my renderer class:

 

package mods.Millarki.client;

 

import mods.Millarki.common.Millarki;

import mods.Millarki.common.TileEntityAltar;

import net.minecraft.block.Block;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import org.lwjgl.opengl.GL11;

 

public class TileEntityAltarRenderer extends TileEntitySpecialRenderer{

    //This method is called when minecraft renders a tile entity

    public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {

        GL11.glPushMatrix();

        //This will move our renderer so that it will be on proper place in the world

        GL11.glTranslatef((float)d, (float)d1, (float)d2);

        TileEntityAltar tileEntityAltar = (TileEntityAltar)tileEntity;

        /*Note that true tile entity coordinates (tileEntity.xCoord, etc) do not match to render coordinates (d, etc) that are calculated as [true coordinates] - [player coordinates (camera coordinates)]*/

        renderBlockAltar(tileEntityAltar, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Millarki.MillarkiAltar);

        GL11.glPopMatrix();

    }

    //And this method actually renders your tile entity

    public void renderBlockAltar(TileEntityAltar tl, World world, int i, int j, int k, Block block) {

        Tessellator tessellator = Tessellator.instance;

        //This will make your block brightness dependent from surroundings lighting.

        float f = block.getBlockBrightness(world, i, j, k);

        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

        int l1 = l % 65536;

        int l2 = l / 65536;

        tessellator.setColorOpaque_F(f, f, f);

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);

       

        /*This will rotate your model corresponding to player direction that was when you placed the block. If you want this to work,

        add these lines to onBlockPlacedBy method in your block class.

        int dir = MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 0.5D) & 3;

        world.setBlockMetadataWithNotify(x, y, z, dir, 0);*/

 

        int dir = world.getBlockMetadata(i, j, k);

       

        GL11.glPushMatrix();

        GL11.glTranslatef(0.5F, 0, 0.5F);

        //This line actually rotates the renderer.

        GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);

        GL11.glTranslatef(-0.5F, 0, -0.5F);

        bindTextureByName("mods/Millarki/textures/blocks/MillarkiAltar.png");

        /*

        Place your rendering code here.

        */

        GL11.glPopMatrix();

        mods.Millarki.models.AltarModel model = new mods.Millarki.models.AltarModel();

        this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

 

    }

}

 

error on this.model.render...... error quick fix = Create field 'model' in this class & create constant 'model' in this class

Probably a very nooblike fault of me. But I don't know how to fix it :(

Yes. You do need a model field (public final ModelWhatever model = new ModelWhatever();), which the tutorial, for some reason, fails to provide.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

I followed this (http://www.minecraftforge.net/wiki/Custom_Tile_Entity_Renderer) tutorial, and I got an error when putting in the last line in my renderer class:

 

package mods.Millarki.client;

 

import mods.Millarki.common.Millarki;

import mods.Millarki.common.TileEntityAltar;

import net.minecraft.block.Block;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import org.lwjgl.opengl.GL11;

 

public class TileEntityAltarRenderer extends TileEntitySpecialRenderer{

    //This method is called when minecraft renders a tile entity

    public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {

        GL11.glPushMatrix();

        //This will move our renderer so that it will be on proper place in the world

        GL11.glTranslatef((float)d, (float)d1, (float)d2);

        TileEntityAltar tileEntityAltar = (TileEntityAltar)tileEntity;

        /*Note that true tile entity coordinates (tileEntity.xCoord, etc) do not match to render coordinates (d, etc) that are calculated as [true coordinates] - [player coordinates (camera coordinates)]*/

        renderBlockAltar(tileEntityAltar, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Millarki.MillarkiAltar);

        GL11.glPopMatrix();

    }

    //And this method actually renders your tile entity

    public void renderBlockAltar(TileEntityAltar tl, World world, int i, int j, int k, Block block) {

        Tessellator tessellator = Tessellator.instance;

        //This will make your block brightness dependent from surroundings lighting.

        float f = block.getBlockBrightness(world, i, j, k);

        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

        int l1 = l % 65536;

        int l2 = l / 65536;

        tessellator.setColorOpaque_F(f, f, f);

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);

       

        /*This will rotate your model corresponding to player direction that was when you placed the block. If you want this to work,

        add these lines to onBlockPlacedBy method in your block class.

        int dir = MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 0.5D) & 3;

        world.setBlockMetadataWithNotify(x, y, z, dir, 0);*/

 

        int dir = world.getBlockMetadata(i, j, k);

       

        GL11.glPushMatrix();

        GL11.glTranslatef(0.5F, 0, 0.5F);

        //This line actually rotates the renderer.

        GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);

        GL11.glTranslatef(-0.5F, 0, -0.5F);

        bindTextureByName("mods/Millarki/textures/blocks/MillarkiAltar.png");

        /*

        Place your rendering code here.

        */

        GL11.glPopMatrix();

        mods.Millarki.models.AltarModel model = new mods.Millarki.models.AltarModel();

        this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

 

    }

}

 

error on this.model.render...... error quick fix = Create field 'model' in this class & create constant 'model' in this class

Probably a very nooblike fault of me. But I don't know how to fix it :(

Yes. You do need a model field (public final ModelWhatever model = new ModelWhatever();), which the tutorial, for some reason, fails to provide.

So now I have this:

 

package mods.Millarki.client;

 

import mods.Millarki.common.Millarki;

import mods.Millarki.common.TileEntityAltar;

import net.minecraft.block.Block;

import net.minecraft.client.renderer.OpenGlHelper;

import net.minecraft.client.renderer.Tessellator;

import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;

import net.minecraft.entity.Entity;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.world.IBlockAccess;

import net.minecraft.world.World;

import org.lwjgl.opengl.GL11;

 

public class TileEntityAltarRenderer extends TileEntitySpecialRenderer{

    //This method is called when minecraft renders a tile entity

    public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {

        GL11.glPushMatrix();

        //This will move our renderer so that it will be on proper place in the world

        GL11.glTranslatef((float)d, (float)d1, (float)d2);

        TileEntityAltar tileEntityAltar = (TileEntityAltar)tileEntity;

        /*Note that true tile entity coordinates (tileEntity.xCoord, etc) do not match to render coordinates (d, etc) that are calculated as [true coordinates] - [player coordinates (camera coordinates)]*/

        renderBlockAltar(tileEntityAltar, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Millarki.MillarkiAltar);

        GL11.glPopMatrix();

    }

    //And this method actually renders your tile entity

    public void renderBlockAltar(TileEntityAltar tl, World world, int i, int j, int k, Block block) {

        Tessellator tessellator = Tessellator.instance;

        //This will make your block brightness dependent from surroundings lighting.

        float f = block.getBlockBrightness(world, i, j, k);

        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);

        int l1 = l % 65536;

        int l2 = l / 65536;

        tessellator.setColorOpaque_F(f, f, f);

        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2);

       

        /*This will rotate your model corresponding to player direction that was when you placed the block. If you want this to work,

        add these lines to onBlockPlacedBy method in your block class.

        int dir = MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 0.5D) & 3;

        world.setBlockMetadataWithNotify(x, y, z, dir, 0);*/

 

        int dir = world.getBlockMetadata(i, j, k);

       

        GL11.glPushMatrix();

        GL11.glTranslatef(0.5F, 0, 0.5F);

        //This line actually rotates the renderer.

        GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);

        GL11.glTranslatef(-0.5F, 0, -0.5F);

        bindTextureByName("mods/Millarki/textures/blocks/MillarkiAltar.png");

        /*

        Place your rendering code here.

        */

        GL11.glPopMatrix();

    }

    public final mods.Millarki.models.AltarModel model = new mods.Millarki.models.AltarModel();

   

        this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

   

}

 

And there is an error on  public final mods.Millarki.models.AltarModel model = new mods.Millarki.models.AltarModel();

The error fix = Syntax error on token ';', invalid AssignmentOperator

And I've tried to fix the error, but it keeps giving me another error.

Link to comment
Share on other sites

  • 4 weeks later...

Updated the code to 1.6.2 (using another mod now)

The TileEntityRenderer:

package assets.blutricity.common;

import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;

import assets.blutricity.models.solarpanel;

public class TileEntitySolarPanelRenderer extends TileEntitySpecialRenderer{
 private static final ResourceLocation SolarPanel = new ResourceLocation("blutricity:textures/blocks/solarpanel.png");

//This method is called when minecraft renders a tile entity
    public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {
        GL11.glPushMatrix();
         //This will move our renderer so that it will be on proper place in the world
         GL11.glTranslatef((float)d, (float)d1, (float)d2);
         TileEntitySolarPanel tileEntitySolarPanel = (TileEntitySolarPanel)tileEntity;
         /*Note that true tile entity coordinates (tileEntity.xCoord, etc) do not match to render coordinates (d, etc) that are calculated as [true coordinates] - [player coordinates (camera coordinates)]*/
         renderBlockSolarPanel(tileEntitySolarPanel, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Mainclass.SolarPanel);
        GL11.glPopMatrix();
    }
    //And this method actually renders your tile entity
    public void renderBlockSolarPanel(TileEntitySolarPanel tl, World world, int i, int j, int k, Block block) {
        Tessellator tessellator = Tessellator.instance;
        //This will make your block brightness dependent from surroundings lighting.
        float f = block.getBlockBrightness(world, i, j, k);
        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
        int l1 = l % 65536;
        int l2 = l / 65536;
        tessellator.setColorOpaque_F(f, f, f);
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2); 
        
        /*This will rotate your model corresponding to player direction that was when you placed the block. If you want this to work, 
        add these lines to onBlockPlacedBy method in your block class.
        int dir = MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 0.5D) & 3;
        world.setBlockMetadataWithNotify(x, y, z, dir, 0);*/

        int dir = world.getBlockMetadata(i, j, k);
        
        GL11.glPushMatrix();
         GL11.glTranslatef(0.5F, 0, 0.5F);
         //This line actually rotates the renderer.
         GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);
         GL11.glTranslatef(-0.5F, 0, -0.5F);
         func_110628_a(SolarPanel);
         /*
         Place your rendering code here.
         */
       public final solarpanel [b]model [/b]= new solarpanel();
         this.[b]model[/b].render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
         GL11.glPopMatrix();
       
    }
    
}

It gives me errors on the bold ones.

the first error says as a fix: remove invalid modifiers, which removes the public statement, and it fixes the first error. but somehow I don't think that is the correct way of fixing the bug

the secon error says as a fix: create fiel/constant in type TileEntitySolarPanelRenderer

 

What did I do wrong?

Link to comment
Share on other sites

allll right...im going to explain whats wrong but also why its wrong and what the compiler is understanding

 

public class simpleclass{
    public Object o;

    public void simplemethod(){
        //here you CANNOT declare member variable
        public final static Potatoe p;
        //saying public somethign means that you intend the variable to be a member of the class, in this case simpleclass
        //basicly if this was valid i could do something like :
        //simpleclass c = new simpleclass();
        //c.simplemethod.p <- this doesnt make any sens, a method is a method and end with (args) i cannot call members of a method
        //the Object o declared earlier is member of the simpleclass class and THAT makes sens because c.o is valid, just like you can do player.username, username is MEMBER of the CLASS EntityPlayer.on the other hand method CANNOT have MEMBER 
        // now the actual answer, remove public because in the context of a method it makes no sens 
        //the final keyword CAN make sens but if you dont know what it means DONT use it. literally, never write final if you dont know why you are placing it
    }
}

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

allll right...im going to explain whats wrong but also why its wrong and what the compiler is understanding

 

public class simpleclass{
    public Object o;

    public void simplemethod(){
        //here you CANNOT declare member variable
        public final static Potatoe p;
        //saying public somethign means that you intend the variable to be a member of the class, in this case simpleclass
        //basicly if this was valid i could do something like :
        //simpleclass c = new simpleclass();
        //c.simplemethod.p <- this doesnt make any sens, a method is a method and end with (args) i cannot call members of a method
        //the Object o declared earlier is member of the simpleclass class and THAT makes sens because c.o is valid, just like you can do player.username, username is MEMBER of the CLASS EntityPlayer.on the other hand method CANNOT have MEMBER 
        // now the actual answer, remove public because in the context of a method it makes no sens 
        //the final keyword CAN make sens but if you dont know what it means DONT use it. literally, never write final if you dont know why you are placing it
    }
}

But when I remove public it still gives me the second error :/

Link to comment
Share on other sites

oh jeebus praise the lord

 

ok so now you need to understand the signification of the keyword "this" basicly "this" will make the code refer to the object your currently in.

if i take my example from earlier, using in simplemethod using this.o in simplemethod would be valid because o is a MEMBER of the CLASS simpleclass. using this.p woudl NOT be valid because p was only avaiable in the context of the method, from the object point of view p NEVER exists

in short, remove "this."

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

oh jeebus praise the lord

 

ok so now you need to understand the signification of the keyword "this" basicly "this" will make the code refer to the object your currently in.

if i take my example from earlier, using in simplemethod using this.o in simplemethod would be valid because o is a MEMBER of the CLASS simpleclass. using this.p woudl NOT be valid because p was only avaiable in the context of the method, from the object point of view p NEVER exists

in short, remove "this."

Derp from me to not think of that...

 

But it still doesn't render :(

 

Here's all my code for this block:

 

package assets.blutricity.common;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class SolarPanel extends Block
{
       public SolarPanel(int par1)
       {
             super(par1, Material.rock);
       }
      
     //This will tell minecraft not to render any side of our cube.
       public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
       {
          return false;
       }

       //And this tell it that you can see through this block, and neighbor blocks should be rendered.
       public boolean isOpaqueCube()
       {
          return false;
       }
       public TileEntity createTileEntity(World world, int metadata)
       {
          return new TileEntitySolarPanel();
       }
       }

 

package assets.blutricity.common;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.Packet132TileEntityData;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;

public class TileEntitySolarPanel extends TileEntity{
   public int customField;
@Override
public void writeToNBT(NBTTagCompound par1)
{
   super.writeToNBT(par1);
   par1.setInteger("customField", customField);
}

@Override
public void readFromNBT(NBTTagCompound par1)
{
   super.readFromNBT(par1);
   this.customField = par1.getInteger("customField");
}
public Packet getDescriptionPacket() {
        NBTTagCompound nbtTag = new NBTTagCompound();
        this.writeToNBT(nbtTag);
        return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag);
        }

        public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) {
        readFromNBT(packet.customParam1);
        }


}


 

package assets.blutricity.common;

import net.minecraft.block.Block;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;

import assets.blutricity.models.solarpanel;

public class TileEntitySolarPanelRenderer extends TileEntitySpecialRenderer{
 private static final ResourceLocation SolarPanel = new ResourceLocation("blutricity:textures/blocks/solarpanel.png");

//This method is called when minecraft renders a tile entity
    public void renderTileEntityAt(TileEntity tileEntity, double d, double d1, double d2, float f) {
        GL11.glPushMatrix();
         //This will move our renderer so that it will be on proper place in the world
         GL11.glTranslatef((float)d, (float)d1, (float)d2);
         TileEntitySolarPanel tileEntitySolarPanel = (TileEntitySolarPanel)tileEntity;
         /*Note that true tile entity coordinates (tileEntity.xCoord, etc) do not match to render coordinates (d, etc) that are calculated as [true coordinates] - [player coordinates (camera coordinates)]*/
         renderBlockSolarPanel(tileEntitySolarPanel, tileEntity.worldObj, tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord, Mainclass.SolarPanel);
        GL11.glPopMatrix();
    }
    //And this method actually renders your tile entity
    public void renderBlockSolarPanel(TileEntitySolarPanel tl, World world, int i, int j, int k, Block block) {
        Tessellator tessellator = Tessellator.instance;
        //This will make your block brightness dependent from surroundings lighting.
        float f = block.getBlockBrightness(world, i, j, k);
        int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
        int l1 = l % 65536;
        int l2 = l / 65536;
        tessellator.setColorOpaque_F(f, f, f);
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)l1, (float)l2); 
        
        /*This will rotate your model corresponding to player direction that was when you placed the block. If you want this to work, 
        add these lines to onBlockPlacedBy method in your block class.
        int dir = MathHelper.floor_double((double)((player.rotationYaw * 4F) / 360F) + 0.5D) & 3;
        world.setBlockMetadataWithNotify(x, y, z, dir, 0);*/

        int dir = world.getBlockMetadata(i, j, k);
        
        GL11.glPushMatrix();
         GL11.glTranslatef(0.5F, 0, 0.5F);
         //This line actually rotates the renderer.
         GL11.glRotatef(dir * (-90F), 0F, 1F, 0F);
         GL11.glTranslatef(-0.5F, 0, -0.5F);
         func_110628_a(SolarPanel);
         /*
         Place your rendering code here.
         */
       final solarpanel model = new solarpanel();
         model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
         GL11.glPopMatrix();
       
    }
    
}

 

package assets.blutricity.client;

import assets.blutricity.common.CommonProxy;
import assets.blutricity.common.TileEntitySolarPanelRenderer;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;

public class ClientProxy extends CommonProxy
{
@Override
public void registerRendering()
{
	ClientRegistry.bindTileEntitySpecialRenderer(assets.blutricity.common.TileEntitySolarPanel.class, new TileEntitySolarPanelRenderer());

}
}

 

The model itself (.java):

// Date: 23-7-2013 19:56:03
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX

package assets.blutricity.models;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;

public class solarpanel extends ModelBase
{
  //fields
    ModelRenderer Shape1;
  
  public solarpanel()
  {
    textureWidth = 64;
    textureHeight = 32;
    
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(0F, 0F, 0F, 16, 4, 16);
      Shape1.setRotationPoint(-8F, 20F, -8F);
      Shape1.setTextureSize(64, 32);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
  }
  
  public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
  {
    super.render(entity, f, f1, f2, f3, f4, f5);
    setRotationAngles(f, f1, f2, f3, f4, f5, entity);
    Shape1.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity ent)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, ent);
  }

}

Link to comment
Share on other sites

debugging 101 how to use the overpowered println

 

System.out.println(Object); <- that method? yeah its op as F***

 

 

in the method TileEntitySolarPanelRendere.renderTileEntityAt(args) if you do a println() does anythgin show up at all in your console ?

 

NOTE: try to do thsi before coming to ask question because then I wont have to ask you to do it and youll get an answer faster. it can also tell you whats going on roughly, if nothing shows up that mean the code never calls this method (maybe its not registered correctly?) if it does print something it means your render code is wrong somehow

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I'm developing a dimension, but it's kinda resource intensive so some times during player teleporting it lags behind making the player phase down into the void, so im trying to implement some kind of pregeneration to force the game loading a small set of chunks in the are the player will teleport to. Some of the things i've tried like using ServerLevel and ServerChunkCache methods like getChunk() dont actually trigger chunk generation if the chunk isn't already on persistent storage (already generated) or placing tickets, but that doesn't work either. Ideally i should be able to check when the task has ended too. I've peeked around some pregen engines, but they're too complex for my current understanding of the system of which I have just a basic understanding (how ServerLevel ,ServerChunkCache  and ChunkMap work) of. Any tips or other classes I should be looking into to understand how to do this correctly?
    • https://mclo.gs/4UC49Ao
    • Way back in the Forge 1.17 days, work started for adding JPMS (Java Platform Module Support) to ModLauncher and ForgeModLoader. This has been used internally by Forge and some libraries for a while now, but mods (those with mods.toml specifically) have not been able to take advantage of it. As of Forge 1.21.1 and 1.21.3, this is now possible!   What is JPMS and what does it mean for modders? JPMS is the Java Platform Module System, introduced in Java 9. It allows you to define modules, which are collections of packages and resources that can be exported or hidden from other modules. This allows for much more fine-tuned control over visibility, cleaner syntax for service declarations and support for sealed types across packages. For example, you might have a mod with a module called `com.example.mod` that exports `com.example.mod.api` and `com.example.mod.impl` to other mods, but hides `com.example.mod.internal` from them. This would allow you to have a clean API for other mods to use, while keeping your internal implementation details hidden from IDE hints, helping prevent accidental usage of internals that might break without prior notice. This is particularly useful if you'd like to use public records with module-private constructors or partially module-private record components, as you can create a sealed interface that only your record implements, having the interface be exported and the record hidden. It's also nice for declaring and using services, as you'll get compile-time errors from the Java compiler for typos and the like, rather than deferring to runtime errors. In more advanced cases, you can also have public methods that are only accessible to specific other modules -- handy if you want internal interactions between multiple of your own mods.   How do I bypass it? We understand there may be drama in implementing a system that prevents mods from accessing each other's internals when necessary (like when a mod is abandoned or you need to fix a compat issue) -- after all, we are already modding a game that doesn't have explicit support for Java mods yet. We have already thought of this and are offering APIs from day one to selectively bypass module restrictions. Let me be clear: Forge mods are not required to use JPMS. If you don't want to use it, you don't have to. The default behaviour is to have fully open, fully exported automatic modules. In Java, you can use the `Add-Opens` and `Add-Exports` manifest attributes to selectively bypass module restrictions of other mods at launch time, and we've added explicit support for these when loading your Forge mods. At compile-time, you can use existing solutions such as the extra-java-module-info Gradle plugin to deal with non-modular dependencies and add extra opens and exports to other modules. Here's an example on how to make the internal package `com.example.examplemod.internal` open to your mod in your build.gradle: tasks.named('jar', Jar) { manifest { attributes([ 'Add-Opens' : 'com.example.examplemod/com.example.examplemod.internal' 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors // (...) ]) } } With the above in your mod's jar manifest, you can now reflectively access the classes inside that internal package. Multiple entries are separated with a space, as per Java's official spec. You can also use Add-Exports to directly call without reflection, however you'd need to use the Gradle plugin mentioned earlier to be able to compile. The syntax for Add-Exports is the same as Add-Opens, and instructions for the compile-time step with the Gradle plugin are detailed later in this post. Remember to prefer the opens and exports keywords inside module-info.java for sources you control. The Add-Opens/Add-Exports attributes are only intended for forcing open other mods.   What else is new with module support? Previously, the runtime module name was always forced to the first mod ID in your `mods.toml` file and all packages were forced fully open and exported. Module names are now distinguished from mod IDs, meaning the module name in your module-info.java can be different from the mod ID in your `mods.toml`. This allows you to have a more descriptive module name that doesn't have to be the same as your mod ID, however we strongly recommend including your mod ID as part of your module name to aid troubleshooting. The `Automatic-Module-Name` manifest attribute is now also honoured, allowing you to specify a module name for your mod without needing to create a `module-info.java` file. This is particularly useful for mods that don't care about JPMS features but want to have a more descriptive module name and easier integration with other mods that do use JPMS.   How do I use it? The first step is to create a `module-info.java` file in your mod's source directory. This file should be in the same package as your main mod class, and should look something like this: open module com.example.examplemod { requires net.minecraftforge.eventbus; requires net.minecraftforge.fmlcore; requires net.minecraftforge.forge; requires net.minecraftforge.javafmlmod; requires net.minecraftforge.mergetool.api; requires org.slf4j; requires logging; } For now, we're leaving the whole module open to reflection, which is a good starting point. When we know we want to close something off, we can remove the open modifier from the module and open or export individual packages instead. Remember that you need to be open to Forge (module name net.minecraftforge.forge), otherwise it can't call your mod's constructor. Next is fixing modules in Gradle. While Forge and Java support modules properly, Gradle does not put automatic modules on the module path by default, meaning that the logging module (from com.mojang:logging) is not found. To fix this, add the Gradle plugin and add a compile-time module definition for that Mojang library: plugins { // (...) id 'org.gradlex.extra-java-module-info' version "1.9" } // (...) extraJavaModuleInfo { failOnMissingModuleInfo = false automaticModule("com.mojang:logging", "logging") } The automatic module override specified in your build.gradle should match the runtime one to avoid errors. You can do the same for any library or mod dependency that is missing either a module-info or explicit Automatic-Module-Name, however be aware that you may need to update your mod once said library adds one. That's all you need to get started with module support in your mods. You can learn more about modules and how to use them at dev.java.
    • Faire la mise à jour grâce à ce lien m'a aider personnellement, merci à @Paint_Ninja. https://www.amd.com/en/support 
    • When I came across the 'Exit Code: I got a 1 error in my Minecraft mods, so I decided to figure out what was wrong. First, I took a look at the logs. In the mods folder (usually where you'd find logs or crash reports), I found the latest.log file or the corresponding crash report. I read it through carefully, looking for any lines with errors or warnings. Then I checked the Minecraft Forge support site, where you can often find info on what causes errors and how to fix them. I then disabled half of my mods and tried running the game. If the error disappeared, it meant that the problem was with the disabled mod. I repeated this several times to find the problem mod.
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.