Jump to content

Recommended Posts

Posted

Hello, fellow modders! I've encountered an issue with a depricated tag, .onBlockPlaced. What could I replace it with? I'm modding on 1.10.2 version of Forge in Eclipse. Any help would be appreciated!

Quote

@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ,
int meta, EntityLivingBase placer) {
return super.onBlockPlaced(worldIn, pos, BlockPistonBase.getFacingFromEntity(pos, placer), hitX, hitY, hitZ, meta, placer);
}

The ".onBlockPlaced" is crossed out, meaning it is depricated. (Not sure what to replace the code with)

Many thanks in advance,
- archieab

Posted

Ignore it. It's deprecated because you aren't supposed to call it. Overriding is fine.

  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Okay Draco18s, do you know why I'm receiving this error?

Quote

[20:25:55] [Client thread/ERROR] [FML/]: Could not load vanilla model parent 'and:block/block_drill_basic' for 'net.minecraft.client.renderer.block.model.ModelBlock@78e8594a
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model and:block/block_drill_basic with loader VanillaLoader.INSTANCE, skipping
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError(ModelLoaderRegistry.java:203) [ModelLoaderRegistry.class:?]
    at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.getTextures(ModelLoader.java:489) [ModelLoader$VanillaModelWrapper.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:163) [ModelLoaderRegistry.class:?]
    at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:328) [ModelLoader.class:?]
    at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) [ModelBakery.class:?]
    at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:148) [ModelLoader.class:?]
    at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
    at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 4
    at com.google.gson.internal.Streams.parse(Streams.java:56) ~[Streams.class:?]
    at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[TreeTypeAdapter.class:?]
    at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:429) ~[JsonUtils.class:?]
    at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:51) ~[ModelBlock.class:?]
    at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:315) ~[ModelBakery.class:?]
    at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
    at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:879) ~[ModelLoader$VanillaLoader.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
    ... 23 more
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 4
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[JsonReader.class:?]
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:480) ~[JsonReader.class:?]
    at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:403) ~[JsonReader.class:?]
    at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:666) ~[TypeAdapters$25.class:?]
    at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:667) ~[TypeAdapters$25.class:?]
    at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:642) ~[TypeAdapters$25.class:?]
    at com.google.gson.internal.Streams.parse(Streams.java:44) ~[Streams.class:?]
    at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[TreeTypeAdapter.class:?]
    at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:429) ~[JsonUtils.class:?]
    at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:51) ~[ModelBlock.class:?]
    at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:315) ~[ModelBakery.class:?]
    at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
    at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:879) ~[ModelLoader$VanillaLoader.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
    ... 23 more
[20:25:55] [Client thread/ERROR] [FML/]: Could not load vanilla model parent 'and:block/block_drill_advanced' for 'net.minecraft.client.renderer.block.model.ModelBlock@7015b29b
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model and:block/block_drill_advanced with loader VanillaLoader.INSTANCE, skipping
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError(ModelLoaderRegistry.java:203) [ModelLoaderRegistry.class:?]
    at net.minecraftforge.client.model.ModelLoader$VanillaModelWrapper.getTextures(ModelLoader.java:489) [ModelLoader$VanillaModelWrapper.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:163) [ModelLoaderRegistry.class:?]
    at net.minecraftforge.client.model.ModelLoader.loadItemModels(ModelLoader.java:328) [ModelLoader.class:?]
    at net.minecraft.client.renderer.block.model.ModelBakery.loadVariantItemModels(ModelBakery.java:170) [ModelBakery.class:?]
    at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:148) [ModelLoader.class:?]
    at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
    at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:122) [SimpleReloadableResourceManager.class:?]
    at net.minecraft.client.Minecraft.startGame(Minecraft.java:540) [Minecraft.class:?]
    at net.minecraft.client.Minecraft.run(Minecraft.java:386) [Minecraft.class:?]
    at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
    at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
    at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 4
    at com.google.gson.internal.Streams.parse(Streams.java:56) ~[Streams.class:?]
    at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[TreeTypeAdapter.class:?]
    at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:429) ~[JsonUtils.class:?]
    at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:51) ~[ModelBlock.class:?]
    at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:315) ~[ModelBakery.class:?]
    at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
    at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:879) ~[ModelLoader$VanillaLoader.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
    ... 23 more
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 4
    at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1505) ~[JsonReader.class:?]
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:480) ~[JsonReader.class:?]
    at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:403) ~[JsonReader.class:?]
    at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:666) ~[TypeAdapters$25.class:?]
    at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:667) ~[TypeAdapters$25.class:?]
    at com.google.gson.internal.bind.TypeAdapters$25.read(TypeAdapters.java:642) ~[TypeAdapters$25.class:?]
    at com.google.gson.internal.Streams.parse(Streams.java:44) ~[Streams.class:?]
    at com.google.gson.TreeTypeAdapter.read(TreeTypeAdapter.java:54) ~[TreeTypeAdapter.class:?]
    at net.minecraft.util.JsonUtils.gsonDeserialize(JsonUtils.java:429) ~[JsonUtils.class:?]
    at net.minecraft.client.renderer.block.model.ModelBlock.deserialize(ModelBlock.java:51) ~[ModelBlock.class:?]
    at net.minecraft.client.renderer.block.model.ModelBakery.loadModel(ModelBakery.java:315) ~[ModelBakery.class:?]
    at net.minecraftforge.client.model.ModelLoader.access$1100(ModelLoader.java:118) ~[ModelLoader.class:?]
    at net.minecraftforge.client.model.ModelLoader$VanillaLoader.loadModel(ModelLoader.java:879) ~[ModelLoader$VanillaLoader.class:?]
    at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
    ... 23 more
[20:25:57] [Client thread/DEBUG] [FML/]: Bar Finished: ModelLoader: items took 1.110s

 

Posted
2 minutes ago, archieab said:

Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 4

Your JSON file is broken.

  • Like 1

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted
7 minutes ago, larsgerrits said:

Your JSON file is broken.

As far as I'm concerned, all my JSON files are correctly formatted.

Blockstate json (drill.json)

Quote

{
    "variants": {
        "facing=north,type=basic": { "model": "and:block_drill_basic" },
        "facing=south,type=basic": { "model": "and:block_drill_basic", "y": 180 },
        "facing=east,type=basic": { "model": "and:block_drill_basic", "y": 90 },
        "facing=west,type=basic": { "model": "and:block_drill_basic", "y": 270 },
        "facing=up,type=basic": { "model": "and:block_drill_basic", "x": 270 },
        "facing=down,type=basic": { "model": "and:block_drill_basic", "y": 90 },
        "facing=north,type=advanced": { "model": "and:block_drill_advanced" },
        "facing=south,type=advanced": { "model": "and:block_drill_advanced", "y": 180 },
        "facing=east,type=advanced": { "model": "and:block_drill_advanced", "y": 90 },
        "facing=west,type=advanced": { "model": "and:block_drill_advanced", "y": 270 },
        "facing=up,type=advanced": { "model": "and:block_drill_advanced", "x": 270 },
        "facing=down,type=advanced": { "model": "and:block_drill_advanced", "y": 90 },
    }
}

Basic drill model (block_drill_basic.json)

Quote

{
    "parent": "block/cube",
    "textures": {
        "particle": "and:blocks/block_drill_basic_front"
        "north": "and:blocks/block_drill_basic_front"
        "south": "and:blocks/machine_frame_basic"
        "east": "and:blocks/machine_frame_basic"
        "west": "and:blocks/machine_frame_basic"
        "up": "and:blocks/block_drill_basic_top"
        "down": "and:blocks/machine_frame_basic"
    }
}

Advanced drill model (block_drill_advanced.json)

Quote

{
    "parent": "block/cube",
    "textures": {
        "particle": "and:blocks/block_drill_advanced_front"
        "north": "and:blocks/block_drill_advanced_front"
        "south": "and:blocks/machine_frame_advanced"
        "east": "and:blocks/machine_frame_advanced"
        "west": "and:blocks/machine_frame_advanced"
        "up": "and:blocks/block_drill_advanced_top"
        "down": "and:blocks/machine_frame_advanced"
    }
}

Basic drill item model (block_drill_basic.json)

Quote

{
    "parent": "and:block/block_drill_basic"
}

Advanced drill item model (block_drill_advanced.json)

Quote

{
    "parent": "and:block/block_drill_advanced"
}

 

Posted (edited)

No, they aren't. According to https://jsonlint.com/ (for drill.json):

 

Error: Parse error on line 48:
...",			"y": 90		},	}}
--------------------^
Expecting 'STRING', got '}'

Although the actual problem is not with the 90, but a few characters later.

I have to edit the tabs into 4 spaces to get the error to line up properly:

Error: Parse error on line 48:
    "y": 90        }, }}
--------------------^ Expecting 'STRING', got '}'

You have an extraneous comma.

Edited by Draco18s
  • Like 1

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Also, in the block models (block_drill_basic.json and block_drill_advanced.json) you need to use commas after each texture entry.

  • Like 1

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

I've fixed all the errors, but for some reason, the block still doesn't follow the direction when placed! Any other suggestions? (thanks for troubleshooting the errors btw)

Posted

You haven't included your entire block class. The only code you've posted (besides your JSON files) is a single method that you overrode in order to do....nothing.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted
3 minutes ago, Draco18s said:

You haven't included your entire block class. The only code you've posted (besides your JSON files) is a single method that you overrode in order to do....nothing.

I've just made a new topic including my BlockDrill.java if you'd like to continue over there.

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.