Jump to content

[1.13.2] Tile Entity Missing Mapping Bug


SNGTech

Recommended Posts

So I have this issue whereby if I load a world with my Tile Entity (crate), it will crash the game and give this error:

Caused by: java.lang.RuntimeException: class cout.sngtech.beneathMod.tileentities.TileEntityOakCrate is missing a mapping! This is a bug! at net.minecraft.tileentity.TileEntity.writeInternal(TileEntity.java:72) ~[?:?] at net.minecraft.tileentity.TileEntity.write(TileEntity.java:66) ~[?:?] at cout.sngtech.beneathMod.tileentities.TileEntityCrate.write(TileEntityCrate.java:81) ~[?:?] at cout.sngtech.beneathMod.tileentities.TileEntityCrate.getUpdateTag(TileEntityCrate.java:95) ~[?:?] at net.minecraft.network.play.server.SPacketChunkData.<init>(SPacketChunkData.java:47) ~[?:?] at net.minecraft.server.management.PlayerChunkMapEntry.sendToPlayer(PlayerChunkMapEntry.java:146) ~[?:?] at net.minecraft.server.management.PlayerChunkMapEntry.addPlayer(PlayerChunkMapEntry.java:63) ~[?:?] at net.minecraft.server.management.PlayerChunkMap.addPlayer(PlayerChunkMap.java:224) ~[?:?] at net.minecraft.server.management.PlayerList.preparePlayer(PlayerList.java:261) ~[?:?] at net.minecraft.server.management.PlayerList.playerLoggedIn(PlayerList.java:331) ~[?:?] at net.minecraft.server.management.PlayerList.initializeConnectionToPlayer(PlayerList.java:162) ~[?:?] at net.minecraft.network.NetHandlerLoginServer.tryAcceptPlayer(NetHandlerLoginServer.java:114) ~[?:?] at net.minecraft.network.NetHandlerLoginServer.tick(NetHandlerLoginServer.java:65) ~[?:?] at net.minecraft.network.NetworkManager.tick(NetworkManager.java:257) ~[?:?] at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:151) ~[?:?]

 

Also loading a new world then placing the crate down then exiting and going back to the world that crashed me doesn't crash anymore for some weird reason until i restart the game.

 

This is my github: https://github.com/SNGTech/Beneath-Mod/tree/master/src/main/java/cout/sngtech/beneathMod

 

Help would be greatly appreciated! Thanks

Edited by SNGTech
Link to comment
Share on other sites

You haven't registered your tile entity.

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.

Link to comment
Share on other sites

@ObjectHolder(Main.MODID)
public class TileEntityInit 
{
	//Storage
	public static final TileEntityType<?> OAK_CRATE = null;
	public static final TileEntityType<?> SPRUCE_CRATE = null;
	public static final TileEntityType<?> BIRCH_CRATE = null;
	public static final TileEntityType<?> JUNGLE_CRATE = null;
	public static final TileEntityType<?> ACACIA_CRATE = null;
	public static final TileEntityType<?> DARK_OAK_CRATE = null;
	
	@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
	public static class RegistryEvents
	{
		@SubscribeEvent
		public static void registerTileEntities(final RegistryEvent.Register<TileEntityType<?>> e)
		{
			e.getRegistry().registerAll
			(
				//Storage
				TileEntityType.Builder.create(TileEntityOakCrate::new).build(null).setRegistryName(Main.MODID, "oak_crate"),
				TileEntityType.Builder.create(TileEntitySpruceCrate::new).build(null).setRegistryName(Main.MODID, "spruce_crate"),
				TileEntityType.Builder.create(TileEntityBirchCrate::new).build(null).setRegistryName(Main.MODID, "birch_crate"),
				TileEntityType.Builder.create(TileEntityJungleCrate::new).build(null).setRegistryName(Main.MODID, "jungle_crate"),
				TileEntityType.Builder.create(TileEntityAcaciaCrate::new).build(null).setRegistryName(Main.MODID, "acacia_crate"),
				TileEntityType.Builder.create(TileEntityDarkOakCrate::new).build(null).setRegistryName(Main.MODID, "dark_oak_crate")
			);
			
			Main.logger.debug("Registered Tile Entities");
		}
	}
}

This is not how to register tile entities in 1.13.2 Forge?

How then do I go about doing that?

Edited by SNGTech
Link to comment
Share on other sites

TileEntityType.register("oak_crate", Builder.create(TileEntityOakCrate::new)).setRegistryName(Main.MODID, "oak_crate"),
				TileEntityType.register("spruce_crate", Builder.create(TileEntitySpruceCrate::new)).setRegistryName(Main.MODID, "spruce_crate"),
				TileEntityType.register("birch_crate", Builder.create(TileEntityBirchCrate::new)).setRegistryName(Main.MODID, "birch_crate"),
				TileEntityType.register("jungle_crate", Builder.create(TileEntityJungleCrate::new)).setRegistryName(Main.MODID, "jungle_crate"),
				TileEntityType.register("acacia_crate", Builder.create(TileEntityAcaciaCrate::new)).setRegistryName(Main.MODID, "acacia_crate"),
				TileEntityType.register("dark_oak_crate", Builder.create(TileEntityDarkOakCrate::new)).setRegistryName(Main.MODID, "dark_oak_crate")

ive tried doing this but i get a registry error (so obviously thats not how to register them)

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.