Jump to content

[SOLVED] [1.12.2] How to devide vanilla block with their variant


K10

Recommended Posts

Hi.

 

I want to rename vanilla prismarine block.

In vanilla, prismarine's metadata is 1, prismarine bricks' metadata is 2, dark prismarine's metadata is 3.

I want to remove these metadata and rename them new block name such as prismarine -> "prismarine", prismarine bricks -> "prismarine_block", dark prismarine -> "dark_prismarine".

Anyone help me please.

 

I think I should override vanilla prismarine block, so I tried this code but error occoured.

@ObjectHolder(Reference.MODID)
public class HamaBlocks {
	@ObjectHolder("minecraft:prismarine")
	public static Block prismarine = null;
	@ObjectHolder("minecraft:prismarine_bricks")
	public static Block prismarineBricks = null;
	@ObjectHolder("minecraft:dark_prismarine")
	public static Block darkPrismarine = null;

	public static void onBlockRegister(RegistryEvent.Register<Block> event) {
		event.getRegistry().registerAll(//
				new Block(Material.ROCK).setCreativeTab(CreativeTabs.BUILDING_BLOCKS)//
				.setRegistryName(new ResourceLocation("minecraft", "prismarine"))//
				.setUnlocalizedName("prismarine"),//
				new Block(Material.ROCK).setCreativeTab(CreativeTabs.BUILDING_BLOCKS)//
				.setRegistryName(new ResourceLocation("minecraft", "prismarine_bricks"))//
				.setUnlocalizedName("prismarine_bricks"),//
				new Block(Material.ROCK).setCreativeTab(CreativeTabs.BUILDING_BLOCKS)//
				.setRegistryName(new ResourceLocation("minecraft", "dark_prismarine"))//
				.setUnlocalizedName("dark_prismarine")//
				);
	}
}
Spoiler

[22:25:14] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// Oops.

Time: 6/10/19 10:25 PM
Description: Initializing game

java.lang.NullPointerException: Initializing game
    at net.minecraft.block.properties.PropertyEnum.getName(PropertyEnum.java:53)
    at net.minecraft.block.properties.PropertyEnum.getName(PropertyEnum.java:14)
    at net.minecraft.client.renderer.block.statemap.StateMap.removeName(StateMap.java:60)
    at net.minecraft.client.renderer.block.statemap.StateMap.getModelResourceLocation(StateMap.java:42)
    at net.minecraft.client.renderer.block.statemap.StateMapperBase.putStateModelLocations(StateMapperBase.java:56)
    at net.minecraft.client.renderer.block.statemap.BlockStateMapper.getBlockstateLocations(BlockStateMapper.java:62)
    at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:221)
    at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150)
    at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121)
    at net.minecraft.client.Minecraft.init(Minecraft.java:559)
    at net.minecraft.client.Minecraft.run(Minecraft.java:421)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)


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

-- Head --
Thread: Client thread
Stacktrace:
    at net.minecraft.block.properties.PropertyEnum.getName(PropertyEnum.java:53)
    at net.minecraft.block.properties.PropertyEnum.getName(PropertyEnum.java:14)
    at net.minecraft.client.renderer.block.statemap.StateMap.removeName(StateMap.java:60)
    at net.minecraft.client.renderer.block.statemap.StateMap.getModelResourceLocation(StateMap.java:42)
    at net.minecraft.client.renderer.block.statemap.StateMapperBase.putStateModelLocations(StateMapperBase.java:56)
    at net.minecraft.client.renderer.block.statemap.BlockStateMapper.getBlockstateLocations(BlockStateMapper.java:62)
    at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:221)
    at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:150)
    at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28)
    at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121)
    at net.minecraft.client.Minecraft.init(Minecraft.java:559)

-- Initialization --
Details:
Stacktrace:
    at net.minecraft.client.Minecraft.run(Minecraft.java:421)
    at net.minecraft.client.main.Main.main(Main.java:118)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    at GradleStart.main(GradleStart.java:25)

-- System Details --
Details:
    Minecraft Version: 1.12.2
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_192, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 99420064 bytes (94 MB) / 603455488 bytes (575 MB) up to 1901592576 bytes (1813 MB)
    JVM Flags: 0 total;
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP 9.42 Powered by Forge 14.23.5.2768 5 mods loaded, 5 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

    | State | ID        | Version      | Source                           | Signature |
    |:----- |:--------- |:------------ |:-------------------------------- |:--------- |
    | UCH   | minecraft | 1.12.2       | minecraft.jar                    | None      |
    | UCH   | mcp       | 9.42         | minecraft.jar                    | None      |
    | UCH   | FML       | 8.0.99.99    | forgeSrc-1.12.2-14.23.5.2768.jar | None      |
    | UCH   | forge     | 14.23.5.2768 | forgeSrc-1.12.2-14.23.5.2768.jar | None      |
    | UCH   | hamacraft | 0.00         | bin                              | None      |

    Loaded coremods (and transformers):
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 418.81' Renderer: 'GeForce GTX 1050/PCIe/SSE2'
    Launched Version: 1.12.2
    LWJGL: 2.9.4
    OpenGL: GeForce GTX 1050/PCIe/SSE2 GL version 4.6.0 NVIDIA 418.81, NVIDIA Corporation
    GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

    Using VBOs: Yes
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Resource Packs:
    Current Language: 日本語 (日本)
    Profiler Position: N/A (disabled)
    CPU: 4x Intel(R) Pentium(R) CPU G4560 @ 3.50GHz

 

Edited by K10
Link to comment
Share on other sites

Thanks for your advice. I want to change not item name but registry name. Otherwise, I want to add variant as other 15 colored prismarine block.

In my ideal, my mod have "prismarine block" and "prismarine bricks block" and "colored prismarine block" registry name.

Link to comment
Share on other sites

Thanks, I see.

 

However, How can I add other 15 prismarine metadata? Are there any way to add block metadata over 16? I thisk it is not able.

Do you have any idea for adding other 15 blocks in existing prismarine block?

Must I add block which has 15 other metadata in my mod?

Edited by K10
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.

Announcements



×
×
  • Create New...

Important Information

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