Jump to content

Recommended Posts

Posted

Hello! I've learned how to create a block, but there are no errors in the console detaining to my problem. The block texture will load when you place it on the ground, which rules out the blockstates json and models/block json, leaving only the item parts of my code. I've been searching around now and I have yet to find a method, so I've come here.

 

(Yes, I called my InitBlocks from MainRegistry and the rendering in my proxies)

 

MainRegistry

package com.fire.testmod;

import org.apache.logging.log4j.Logger;

import com.fire.testmod.Init.InitBlocks;
import com.fire.testmod.Init.InitItems;
import com.fire.testmod.Proxy.ServerProxy;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;

@Mod(modid = Strings.ModID, name = Strings.Name, version = Strings.Version)
public class MainRegistry {

@SidedProxy(clientSide = Strings.ClientProxy, serverSide = Strings.ServerProxy)
public static ServerProxy proxy;

@Instance(Strings.ModID)
public static MainRegistry Instance;

public static Logger logger;

@EventHandler
public void PreInitiation(FMLPreInitializationEvent event){
	logger = event.getModLog();
	InitBlocks.Main();
	InitItems.Main();
	proxy.registerRenderInfo();
}

@EventHandler
public void Initiate(FMLInitializationEvent event){

}

@EventHandler
public void PostInitiation(FMLPostInitializationEvent event){

}
}

 

InitBlocks.java

package com.fire.testmod.Init;

import com.fire.testmod.Blocks.test_block;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class InitBlocks {

public static Block test_block;

public static void Main(){
	test_block = new test_block(Material.ROCK, "test_block", CreativeTabs.BUILDING_BLOCKS);
	Register();
}

public static void Register(){
	RegisterBlock(test_block);
}

public static void Render(Item item){
	ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}

public static void RegisterBlock(Block block){
	GameRegistry.register(block);
	GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}

}

 

test_block.java

package com.fire.testmod.Blocks;

import com.fire.testmod.Strings;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class test_block extends Block {

public test_block(Material materialIn, String name, CreativeTabs tab) {
	super(materialIn);
	this.setUnlocalizedName(name);
	this.setRegistryName(Strings.ModID, name);
	this.setCreativeTab(tab);
}

}

 

blockstates/test_block.json

{
    "variants": {
        "normal": { "model": "testmod:test_block"}
    }
}

 

models/block/test_block.json

{
    "parent": "block/cube_all",
    "textures": {
        "all": "testmod:blocks/test_block"
    }
}

 

models/item/test_block.json

{
    "parent": "testmod:block/test_block",
    "display": {
        "thirdperson": {
            "rotation": [ 10, -45, 170],
            "translation": [ 0, 1.5, -2.75 ],
            "scale": [ 0.375, 0.375, 0.375]
        }
    }
}

 

Log

2016-06-03 10:29:21,633 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-06-03 10:29:21,635 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[10:29:21] [main/INFO] [GradleStart]: Extra: []
[10:29:21] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/FireController1847/.gradle/caches/minecraft/assets, --assetIndex, 1.9, --accessToken{REDACTED}, --version, 1.9.4, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[10:29:21] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker
[10:29:21] [main/INFO] [FML]: Forge Mod Loader version 12.17.0.1937 for Minecraft 1.9.4 loading
[10:29:21] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_91, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_91
[10:29:21] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[10:29:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[10:29:21] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin
[10:29:21] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[10:29:21] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker
[10:29:21] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[10:29:22] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
[10:29:23] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
[10:29:23] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper
[10:29:23] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker
[10:29:24] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[10:29:24] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker
[10:29:24] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker
[10:29:24] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
2016-06-03 10:29:24,953 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-06-03 10:29:24,988 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
2016-06-03 10:29:24,989 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
[10:29:25] [Client thread/INFO]: Setting user: Player737
[10:29:28] [Client thread/INFO]: LWJGL Version: 2.9.4
[10:29:30] [Client thread/INFO] [sTDOUT]: [net.minecraftforge.fml.client.SplashProgress:start:202]: ---- Minecraft Crash Report ----
// Hi. I'm Minecraft, and I'm a crashaholic.

Time: 6/3/16 10:29 AM
Description: Loading screen debug info

This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
Minecraft Version: 1.9.4
Operating System: Windows 8.1 (amd64) version 6.3
Java Version: 1.8.0_91, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 894026056 bytes (852 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 364.72' Renderer: 'GeForce GTX 960/PCIe/SSE2'
[10:29:30] [Client thread/INFO] [FML]: MinecraftForge v12.17.0.1937 Initialized
[10:29:30] [Client thread/INFO] [FML]: Replaced 232 ore recipes
[10:29:30] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
[10:29:30] [Client thread/INFO] [FML]: Searching E:\Desktop\Minecraft Mod Making\Workspace\run\mods for mods
[10:29:31] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load
[10:29:32] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, testmod, tutorialmod] at CLIENT
[10:29:32] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, testmod, tutorialmod] at SERVER
[10:29:32] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod, FMLFileResourcePack:Tutorial Mod
[10:29:32] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
[10:29:32] [Client thread/INFO] [FML]: Found 418 ObjectHolder annotations
[10:29:32] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
[10:29:32] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
[10:29:32] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
[10:29:32] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[10:29:32] [Client thread/INFO] [FML]: Applying holder lookups
[10:29:32] [Client thread/INFO] [FML]: Holder lookups applied
[10:29:32] [Client thread/INFO] [FML]: Injecting itemstacks
[10:29:32] [Client thread/INFO] [FML]: Itemstack injection complete
[10:29:33] [Forge Version Check/INFO] [ForgeVersionCheck]: [Forge] Found status: BETA_OUTDATED Target: 12.17.0.1940
[10:29:36] [sound Library Loader/INFO]: Starting up SoundSystem...
[10:29:37] [Thread-8/INFO]: Initializing LWJGL OpenAL
[10:29:37] [Thread-8/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[10:29:37] [Thread-8/INFO]: OpenAL initialized.
[10:29:37] [sound Library Loader/INFO]: Sound engine started
[10:29:42] [Client thread/INFO] [FML]: Max texture size: 16384
[10:29:42] [Client thread/INFO]: Created: 16x16 textures-atlas
[10:29:43] [Client thread/INFO] [FML]: Injecting itemstacks
[10:29:43] [Client thread/INFO] [FML]: Itemstack injection complete
[10:29:43] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods
[10:29:43] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Test Mod, FMLFileResourcePack:Tutorial Mod
[10:29:49] [Client thread/INFO]: SoundSystem shutting down...
[10:29:49] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
[10:29:49] [sound Library Loader/INFO]: Starting up SoundSystem...
[10:29:49] [Thread-10/INFO]: Initializing LWJGL OpenAL
[10:29:49] [Thread-10/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
[10:29:49] [Thread-10/INFO]: OpenAL initialized.
[10:29:50] [sound Library Loader/INFO]: Sound engine started
[10:29:53] [Client thread/INFO] [FML]: Max texture size: 16384
[10:29:54] [Client thread/INFO]: Created: 1024x512 textures-atlas
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: The following texture errors were found.
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:   DOMAIN tutorialmod
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: --------------------------------------------------
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:   domain tutorialmod is missing 1 texture
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:     domain tutorialmod has 2 locations:
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:       mod testmod resources at E:\Desktop\Minecraft Mod Making\Workspace\bin
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:       mod tutorialmod resources at E:\Desktop\Minecraft Mod Making\Workspace\bin
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:     The missing resources for domain tutorialmod are:
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:       textures/items/itemTest.png
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: -------------------------
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]:     No other errors exist for domain tutorialmod
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: ==================================================
[10:29:55] [Client thread/ERROR] [TEXTURE ERRORS]: +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
[10:29:55] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[10:30:03] [server thread/INFO]: Starting integrated minecraft server version 1.9.4
[10:30:03] [server thread/INFO]: Generating keypair
[10:30:03] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance
[10:30:03] [server thread/INFO] [FML]: Found a missing id from the world tutorialmod:test_block
[10:30:03] [server thread/INFO] [FML]: Found a missing id from the world tutorialmod:test_block
[10:30:03] [server thread/ERROR] [FML]: There are unidentified mappings in this world - we are going to attempt to process anyway
[10:30:03] [server thread/ERROR] [FML]: Unidentified block: tutorialmod:test_block, id 213
[10:30:03] [server thread/ERROR] [FML]: Unidentified item: tutorialmod:test_block, id 4098
[10:30:05] [server thread/INFO] [FML]: World backup created at E:\Desktop\Minecraft Mod Making\Workspace\run\saves\TestWorld-20160603-103004.zip.
[10:30:05] [server thread/WARN] [FML]: This world contains block and item mappings that may cause world breakage
[10:30:05] [server thread/INFO] [FML]: Applying holder lookups
[10:30:05] [server thread/INFO] [FML]: Holder lookups applied
[10:30:05] [server thread/INFO] [FML]: Loading dimension 0 (TestWorld) (net.minecraft.server.integrated.IntegratedServer@6b11f4ab)
[10:30:05] [server thread/INFO] [FML]: Loading dimension 1 (TestWorld) (net.minecraft.server.integrated.IntegratedServer@6b11f4ab)
[10:30:05] [server thread/INFO] [FML]: Loading dimension -1 (TestWorld) (net.minecraft.server.integrated.IntegratedServer@6b11f4ab)
[10:30:05] [server thread/INFO]: Preparing start region for level 0
[10:30:06] [server thread/INFO]: Preparing spawn area: 16%
[10:30:07] [server thread/INFO]: Changing view distance to 12, from 10
[10:30:09] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 2
[10:30:09] [Netty Server IO #1/INFO] [FML]: Client protocol version 2
[10:30:09] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : [email protected],testmod@NULL,[email protected] Beta,[email protected],[email protected]
[10:30:09] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established
[10:30:09] [server thread/INFO] [FML]: [server thread] Server side modded connection established
[10:30:09] [server thread/INFO]: Player737[local:E:fc9afa22] logged in with entity id 299 at (-157.1656585018771, 69.0, 252.5314552716783)
[10:30:09] [server thread/INFO]: Player737 joined the game
[10:30:09] [server thread/INFO]: Saving and pausing game...
[10:30:10] [server thread/INFO]: Saving chunks for level 'TestWorld'/Overworld
[10:30:10] [server thread/INFO]: Saving chunks for level 'TestWorld'/Nether
[10:30:10] [server thread/INFO]: Saving chunks for level 'TestWorld'/The End
[10:30:11] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@74eb7ac[id=25887e3a-1ce2-3acf-9352-3d844017a709,name=Player737,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [YggdrasilMinecraftSessionService$1.class:?]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:165) [YggdrasilMinecraftSessionService.class:?]
at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:3041) [Minecraft.class:?]
at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:131) [skinManager$3.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_91]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_91]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_91]
[10:30:11] [server thread/INFO]: Player737 has just earned the achievement [Taking Inventory]
[10:30:11] [Client thread/INFO]: [CHAT] Player737 has just earned the achievement [Taking Inventory]
[10:30:30] [server thread/INFO]: Saving and pausing game...
[10:30:30] [server thread/INFO]: Saving chunks for level 'TestWorld'/Overworld
[10:30:30] [server thread/INFO]: Saving chunks for level 'TestWorld'/Nether
[10:30:30] [server thread/INFO]: Saving chunks for level 'TestWorld'/The End
[10:30:37] [server thread/INFO]: Saving and pausing game...
[10:30:37] [server thread/INFO]: Saving chunks for level 'TestWorld'/Overworld
[10:30:37] [server thread/INFO]: Saving chunks for level 'TestWorld'/Nether
[10:30:37] [server thread/INFO]: Saving chunks for level 'TestWorld'/The End
[10:30:38] [server thread/INFO]: Stopping server
[10:30:38] [server thread/INFO]: Saving players
[10:30:38] [server thread/INFO]: Saving worlds
[10:30:38] [server thread/INFO]: Saving chunks for level 'TestWorld'/Overworld
[10:30:38] [server thread/INFO]: Saving chunks for level 'TestWorld'/Nether
[10:30:38] [server thread/INFO]: Saving chunks for level 'TestWorld'/The End
[10:30:38] [server thread/INFO] [FML]: Unloading dimension 0
[10:30:38] [server thread/INFO] [FML]: Unloading dimension -1
[10:30:38] [server thread/INFO] [FML]: Unloading dimension 1
[10:30:38] [server thread/INFO] [FML]: Applying holder lookups
[10:30:38] [server thread/INFO] [FML]: Holder lookups applied
[10:30:39] [Client thread/INFO]: Stopping!
[10:30:39] [Client thread/INFO]: SoundSystem shutting down...
[10:30:39] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

ClientProxy

package com.fire.testmod.Proxy;

public class ClientProxy extends ServerProxy {
public void registerRenderInfo(){

}
}

 

CommonProxy

package com.fire.testmod.Proxy;

public class ServerProxy {
public void registerRenderInfo(){

}
}

I am on my journey of making a remake of matmos, as explained here.

Posted

Post your proxies as well.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

ClientProxy

never calls

InitBlocks.Render

.

 

Side note: I recommend following Java naming conventions (

lowercase

for packages;

PascalCase

for classes, interfaces and enums;

camelCase

for methods, fields, parameters and local variables;

UPPER_CASE

for constants) and annotating override methods with

@Override

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

I've done this but it's still not working....

 

MainRegistry

package com.fire.testmod;

import org.apache.logging.log4j.Logger;

import com.fire.testmod.Init.InitBlocks;
import com.fire.testmod.Init.InitItems;
import com.fire.testmod.Proxy.ServerProxy;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;

@Mod(modid = Strings.ModID, name = Strings.Name, version = Strings.Version)
public class MainRegistry {

@SidedProxy(clientSide = Strings.ClientProxy, serverSide = Strings.ServerProxy)
public static ServerProxy proxy;

@Instance(Strings.ModID)
public static MainRegistry Instance;

public static Logger logger;

@EventHandler
public void PreInitiation(FMLPreInitializationEvent event){
	logger = event.getModLog();
	InitBlocks.Main();
	InitItems.Main();
	proxy.registerRenderInfo();
}

@EventHandler
public void Initiate(FMLInitializationEvent event){

}

@EventHandler
public void PostInitiation(FMLPostInitializationEvent event){

}
}

 

ClientProxy

package com.fire.testmod.Proxy;

public class ClientProxy extends ServerProxy {
public void registerRenderInfo(){

}
}

 

ServerProxy

package com.fire.testmod.Proxy;

import com.fire.testmod.Init.InitBlocks;
import com.fire.testmod.Init.InitItems;

public class ServerProxy {
public void registerRenderInfo(){
	InitBlocks.RegisterRenders();
	InitItems.RegisterRenders();
}
}

 

InitBlocks

package com.fire.testmod.Init;

import com.fire.testmod.Blocks.test_block;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class InitBlocks {

public static Block test_block;

public static void Main(){
	test_block = new test_block(Material.ROCK, "test_block", CreativeTabs.BUILDING_BLOCKS);
	Register();
}

public static void Register(){
	RegisterBlock(test_block);
}

public static void RegisterRenders(){
	Render(Item.getItemFromBlock(test_block));
}

public static void Render(Item item){
	ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}

public static void RegisterBlock(Block block){
	GameRegistry.register(block);
	GameRegistry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}

}

 

test_block

package com.fire.testmod.Blocks;

import com.fire.testmod.Strings;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

public class test_block extends Block {

public test_block(Material materialIn, String name, CreativeTabs tab) {
	super(materialIn);
	this.setUnlocalizedName(name);
	this.setRegistryName(Strings.ModID, name);
	this.setCreativeTab(tab);
}

}

I am on my journey of making a remake of matmos, as explained here.

Posted

Rendering is client-only, why are you trying to register models from

ServerProxy

?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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