Jump to content

Recommended Posts

Posted (edited)

RESOLVED:

 

I was so focused on looking for errors in my classes and methods that I overlooked a simple misplaced parameter that made my code use the wrong class. The issue is essentially a duplicate of  this, despite what I said in my post below. Apologies.

 

I'm making  pretty standard StairsBlock, and it's basically just a re-skin of the acacia stairs. When Minecraft loads, I get a bunch of exceptions in the debug log:

  Reveal hidden contents

I've never had this issue before. I've checked multiple times, and my JSON is basically an exact copy of the acacia stairs JSON. The same is true of the model JSONS:
 

  Reveal hidden contents

At first glance, this seems like the same issue found here, but while I am adding the StairsBlock to my DeferredRegister in an odd way, I am initializing StairsBlock, and the method I've used to add it to my DeferredRegister has proven successful for SlabBlocks. I've listed all my code below. There's quite a bit there, so... sorry about that. Feedback is greatly appreciated.

 

  Reveal hidden contents

Template class:

  Reveal hidden contents

Extension class:

  Reveal hidden contents

AbstractBaseBlock class:

  Reveal hidden contents

BaseBlock class:

  Reveal hidden contents

BaseStairs class is listed below. The BaseSlab class is the same, except that blockConstructor() returns a SlabBlock, as expected.

  Reveal hidden contents

Here's the main class:

  Reveal hidden contents

 

Edited by Dubius
Found issue
Posted

Howdy

I'd suggest you put a few breakpoints into the vanilla code as well as your Block's blockstate setup methods to see where the problem is.

You could try using manual registration instead of Deferred  in order to narrow it down eg

  @SubscribeEvent
  public static void onBlocksRegistration(final RegistryEvent.Register<Block> blockRegisterEvent) {

 

-TGG

Posted
  On 5/13/2020 at 8:15 AM, diesieben07 said:

Show your block code and how you register it.

And please format it properly (not like your JSON file).

Expand  

Added additional info and re-pasted the JSON. not sure why it was jumbled like that to begin with, apologies.

Posted (edited)
  On 5/14/2020 at 7:49 AM, diesieben07 said:

That is not what I meant by showing your registration code. Small snippets like that don't tell anything about what is actually going on.

Expand  

Here's the class that declares my blocks and such. Other classes will be listed below. They are probably necessary to understand how this class works.

 

  Reveal hidden contents

Template class:

  Reveal hidden contents

Extension class:

  Reveal hidden contents

AbstractBaseBlock class:

  Reveal hidden contents

BaseBlock class:

  Reveal hidden contents

BaseStairs class is listed below. The BaseSlab class is the same, except that blockConstructor() returns a SlabBlock, as expected.

  Reveal hidden contents

Here's the main class:

  Reveal hidden contents

 

Edited by Dubius
Clarification, spoilers for navigation
Posted
  On 5/17/2020 at 2:39 AM, Dubius said:

public static void onRegisterItems(final RegistryEvent.Register<Item> event) { final IForgeRegistry<Item> registry = event.getRegistry(); Registrar.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block -> {

Expand  

 

  On 5/17/2020 at 2:39 AM, Dubius said:

public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<>(ForgeRegistries.BLOCKS, "examplemod");

Expand  

Why are you using both a deferred register and a RegistryEvent handler? You only need one.

 

Second, BlockBase is an antipattern. Do not use it. There is already a base block class, its called Block.

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 (edited)

Thank you for pointin

  On 5/17/2020 at 3:20 AM, Draco18s said:

 

Why are you using both a deferred register and a RegistryEvent handler? You only need one.

 

Second, BlockBase is an antipattern. Do not use it. There is already a base block class, its called Block.

Expand  

Thanks for pointing that out, I'll change the names of my classes. In other news, I found the issue, and feel very stupid. Minor error. Thanks for putting up with me. I'll update the main question to reflect what I found.

 

I'll be frank, I'm not familiar enough with DeferredRegistries to really understand what the issue with having both is. I think the main thing here is that it lets me register BlockItems without having to declare them myself? Unless I can do that without the handler...

Edited by Dubius
Posted (edited)
  On 5/17/2020 at 3:23 AM, Dubius said:

I'll be frank, I'm not familiar enough with DeferredRegistries to really understand what the issue with having both is.

Expand  

DeferredRegister is a wrapper around the RegistryEvent system to allow people to create their blocks and items in a static block without breaking everything.

 

  On 5/17/2020 at 3:23 AM, Dubius said:

I think the main thing here is that it lets me register BlockItems without having to declare them myself?

Expand  

Uh, you still are. What do you think this code does?

  On 5/17/2020 at 2:39 AM, Dubius said:

Registrar.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block -> {

    final Item.Properties properties = new Item.Properties().group(ItemGroup.MISC);

    final BlockItem blockItem = new BlockItem(block, properties);

    blockItem.setRegistryName(block.getRegistryName());

    registry.register(blockItem);

});

Expand  

Sure, its a loop, and you aren't individually specifying things. Except you've done it in a way that forces all of your blocks to use the base implementation of BlockItem. Any block you want to be different you have to go fuck around with this code to make it not generate an item.

 

Technical blocks that don't have items, blocks that use a custom item, a block that you want to belong to a creative tab group other than "misc" (which, frankly, should be most of them: such as decoration, building blocks, or redstone).

Edited by Draco18s

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.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • wait, i just did that. why didn't it work? also it's the same. help me!!!!
    • Culprit has been located! It was Tough As Nails + (plus) which was among one of the mods *added* before re-entering, in an attempt to improve compatibility. It, for some reason or another, did not want to work!
    • "You can either try to load it with only the vanilla data pack ("safe mode"), or go back to the title screen and fix it manually." Hello! I encountered this error just now while attempting to re-enter my world for the first time. Notably, no mods were removed before encountering this error and, while being able to find this error elsewhere on the internet, in my scenario it is seemingly caused by a specific mod, of which I cannot isolate. Things I have tried: - Enter "Safe Mode" (fails) - Remove datapacks (no change) - Reverted to old save data (no change) Here is the server log: https://mclo.gs/9vJQEfN I use Modrinth mod loader so please let me know how to share my mod list, and if it is needed.
    • So, i'm hosting (or attempting to host) a port-forwarded modded server for 1.12.2. There's quite a few mods in this pack, but they all run and have no compatibility issues (besides something causing the game to crash if you go fullscreen, a problem ive given up trying to identify or fix). It can run on 6gb of ram or less, and works fine in singleplayer. All of my friends that want to join have the exact same mod/config/game setup as I do (I personally helped them set everything up). Just to be safe, we've all allocated 12 gigabytes of RAM to the installation, and I've also allocated 12GB to the server itself. I am able to join with no issue and it runs fine. However, when they try to join, it gets stuck in the 'logging in' screen before their game becomes unresponsive. When they close it, it gives them the exit code 805306369, which usually means not enough RAM, but this cant be the case. On my screen, in the server, it shows them joining, and then disconnecting, so I dont think its a port-forwarding issue. They can all run it just fine in singleplayer as well. The annoying bit about this particular issue is that it generates no crash log. Does anyone have any suggestions? Thanks! Here is my debug log, and his, starting from the same place. MINE: [132647] [Netty Client IO #5INFO] [FML] Attempting connection with missing mods [ctm, fusion] at SERVER 132653.817 [132653] [Client threadINFO] [minecraftGuiConnecting] Connecting to 0, 25565 132654.682 [132654] [Netty Client IO #9INFO] [STDOUT] [xaero.common.core.transformer.ClassNodeTransformertransform29] Transforming class brz net.minecraft.client.network.NetHandlerPlayClient 132654.684 [132654] [Netty Client IO #9INFO] [STDOUT] [xaero.map.core.transformer.ClassNodeTransformertransform29] Transforming class net.minecraft.client.network.NetHandlerPlayClient 132654.764 [132654] [Netty Client IO #9INFO] [FML] Server protocol version 2 132654.777 [132654] [Netty Client IO #9INFO] [FML] Attempting connection with missing mods [ctm, fusion] at SERVER 132656.193 [132656] [Client threadINFO] [FML] Injecting existing registry data into this client instance 132659.081 [132659] [Client threadINFO] [FML] Applying holder lookups 132659.082 [132659] [Client threadINFO] [FML] Holder lookups applied 132659.092 [132659] [Netty Client IO #9INFO] [FML] [Netty Client IO #9] Client side modded connection established HIS: [13:12:16] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [ctm, fusion] at SERVER 13:12:25.597 [13:12:25] [Client thread/INFO] [minecraft/GuiConnecting]: Connecting to (my IP address and the server port 25565) 13:12:26.805 [13:12:26] [Netty Client IO #1/INFO] [STDOUT]: [xaero.common.core.transformer.ClassNodeTransformer:transform:29]: Transforming class brz net.minecraft.client.network.NetHandlerPlayClient 13:12:26.808 [13:12:26] [Netty Client IO #1/INFO] [STDOUT]: [xaero.map.core.transformer.ClassNodeTransformer:transform:29]: Transforming class net.minecraft.client.network.NetHandlerPlayClient 13:12:26.936 [13:12:26] [Netty Client IO #1/INFO] [FML]: Server protocol version 2 13:12:27.114 [13:12:27] [Netty Client IO #1/INFO] [FML]: Attempting connection with missing mods [ctm, fusion] at SERVER 13:12:27.480 [13:12:27] [Client thread/INFO] [FML]: Injecting existing registry data into this client instance 13:12:30.669 [13:12:30] [Client thread/INFO] [FML]: Applying holder lookups 13:12:30.671 [13:12:30] [Client thread/INFO] [FML]: Holder lookups applied 13:13:04.700 Process crashed with exit code -805306369 P.S - Both mods "CTM" and "FUSION" are present in both our folders so idk what that's about.
    • Please read the FAQ (link is orange banner at top of page), and post logs as described there, to an external site such as https://mclo.gs  
  • Topics

×
×
  • Create New...

Important Information

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