Jump to content

Recommended Posts

Posted

Ok, so I recently switched from using an Item for my gun to a dummy Block, so that I could have a 3D model. Now, when I right click it, it doesn't spawn the ammo, and prints the following error in to console:

http://paste.ubuntu.com/10971581/

Here is my code:

ItemBlockCoalGun: http://paste.ubuntu.com/10947721/

ItemCoalGun(The dummy block): http://paste.ubuntu.com/10947733/

EntityCoal: http://paste.ubuntu.com/10947748/

(doubt the code in the next 2 files is necessary to fix the problem, but here, in case it is)

ExtendedPlayer: http://paste.ubuntu.com/10947750/

EnumAmmo: http://paste.ubuntu.com/10947768/

And I may as well include that I have this in my FMLPreInitializationEvent:

GameRegistry.registerBlock(coal_gun, ItemBlockCoalGun.class, "coal_gun");

If you need any more code or details, let me know.

 

EDIT: I have made the mod open source(for now), here is the full source.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

The error is line 29 of ItemBlockCoalGun which, I think, the entity is hitting the player and it doesn't know what to do. Check if the entity hit is not the player? I'm not really sure but, I think maybe the entity is being spawned incorrectly.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

The error is line 29 of ItemBlockCoalGun which, I think, the entity is hitting the player and it doesn't know what to do. Check if the entity hit is not the player? I'm not really sure but, I think maybe the entity is being spawned incorrectly.

Don't get me wrong, I appreciate your attempt to help, but, quite frankly, everything you just said was either unhelpful or stupid wrong. I will leave it to you to decide what was unhelpful and what was wrong.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

Typically you see that kind of error when you do not correctly register your entity via EntityRegistry#registerModEntity - can you show that code as well?

 

So, ItemCoalGun is a Block with a TileEntityCoalGun... can your names get any more confusing? I don't understand your logic here - you can render a 3D model with an Item just fine, so why switch to a block, let alone one with a TileEntity? I highly advise against this kind of 'solution' - much better to actually learn how to properly handle rendering.

Posted

Thank you for that quite insulting way of putting it. O.o No matter that, the error is line 29 of ItemBlockCoalGun which is the closing bracket of hitEntity. With that in mind, it seems that you're spawning your entity wrong or. perhaps, you registering it as a block is affecting it? I don't want you to take what I am saying as a cold cut way of immediatly fixing your problem. I am just throwing suggesting on what may be CAUSING the error.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

Oh dear God! I did screw up my last response quite a lot. I didn't realize it was the block class. coolAlias is right though, I render 3D models to my items just fine so that is a very good question.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

"you can render a 3D model with an Item just fine"

Could I see an example of that? Last time I tried finding out all I got was to make a dummy block.

http://www.minecraftforge.net/forum/index.php/topic,29471.msg152198.html#msg152198

"Thank you for that quite insulting way of putting it"

Sorry, I have dealt with a few too many stupid people today.

 

As for the code example, it is in this file somewhere, I am on my phone right now, so it is easier just to post the file without narrowing it down. Here: https://dl.dropboxusercontent.com/s/t6307cffhs1flf1/The_Fireplace_unlogic-ii_master_src_main_java_the_fireplace_unlogicii_UnLogicII.java?dl=0

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

Aren't you the rude one. :P I made a mistake when looking at it just like everyone does. I do not appreciate being called "stupid" based upon one post.

I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.

Posted

Aren't you the rude one. :P I made a mistake when looking at it just like everyone does. I do not appreciate being called "stupid" based upon one post.

Yes, everyone makes mistakes, as I did when wording that last post. I did not intend to call you stupid, but the people I had a discussion with earlier, but that was on a different, completely unrelated website, so I won't get in to that.

And if you were referring to my first response, saying something stupid does not make you stupid. There are many smart people who say stupid things from time to time.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

Ok, first: You are not checking if you're on the server when spawning the entity. That will leave ghost entities behind.

The actual issue is further down the exception chain: Some entry in your Entity's DataWatcher contains an invalid ItemStack.

Ok, I see what you are saying, and have since fixed the ghost entities.

As for the main issue, how would I go about finding and fixing it? I have looked and looked and can't find where it could be.

 

On a side note, it looks to me like it is expecting to place it as a block and can't, and that could be why.

at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:607) [NetHandlerPlayServer.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:67) [C08PacketPlayerBlockPlacement.class:?]
at net.minecraft.network.play.client.C08PacketPlayerBlockPlacement.processPacket(C08PacketPlayerBlockPlacement.java:114) [C08PacketPlayerBlockPlacement.class:?]

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

It has nothing to do with placing a block. It's simple the name of the packet for "right click" (you right-click your item, this packet is sent and tells the server you right-clicked).

 

For finding the issue, put a conditinoal breakpoint in DataWatcher.writeTo (only break if it's your entity, otherwise you get notified for every entity that's spawned). Then check which slot is null and find out why.

Alright, did that(again and again and again), and I can't find any reason for it to be doing that. The itemstack in DataWatcher.writeTo is ItemBlockCoalGun, not null, and I have tried putting waypoints in various other spots mentioned in the error, all look like they should be working fine.

 

Perhaps it just needs a fresh set of eyes. Anyways, I have made the mod open source for now, so it is easier to fix. Here is the link to the source. Any help is very much appreciated, and I will keep looking, and will let you know if I find the issue.

EDIT: Here is the link to the error now, I renamed and moved the dummy block appropriately: http://paste.ubuntu.com/10971581/

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

Ok, to set it up, what I do is clone it, download the latest version of Minecraft Forge, open the zip and delete the arc folder, then extract it over my existing files, replacing any that are the same. Then, I run setupforge.bat(a simple batch file, it runs gradlew setupDecompWorkspace then gradlew eclipse. Then, open eclipse and set it to the workspace as normal, and make sure to add the 2 jarslibsthe libs folder to the build path, as they are Fireplace Core sources and deobf.

 

To reproduce the issue, run the client, make a new world in creative, get a Coal Gun out of the UnLogic II creative tab. Right click while holding it to make the error.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

Ok, to set it up, what I do is clone it, download the latest version of Minecraft Forge, open the zip and delete the arc folder, then extract it over my existing files, replacing any that are the same. Then, I run setupforge.bat(a simple batch file, it runs gradlew setupDecompWorkspace then gradlew eclipse. Then, open eclipse and set it to the workspace as normal, and make sure to add the 2 jarslibsthe libs folder to the build path, as they are Fireplace Core sources and deobf.

Yeah, no that's not how to make a repo.

Clone + setupDecompWorkspace is enough if you provide the wrapper. See here for an example.

Ok, should work now

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Posted

The issue is that you extend EntityItem (which is the entity used when you drop an Item on the ground) but never tell it what ItemStack it should represent.

Thanks.

Also: Your code is a giant mess full of lurking errors, but I am not in the mood to go over them all. But you should seriously consider learning Java more in-depth.

I know, and I am working on it.

 

Thanks for taking the time to look in to this and help, I appreciate it.

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

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

    • When i try to join my friends server with mods it just says failed to log in: the authentication servers are currently not reachable. I've been having this issue for a while now and no method I've tried to fix it works. I've seen a lot of people fixing it by modifying the host.txt file and removing anything related to Mojang but when I open mine there's nothing related to Mojang there. I also tried flushing DNS cache, and changing my IPV6 to 8888, but nothing works.  It only happens when the mods are on too. When I join my friends server on vanilla it works, but not with mods. I can join multiplayer servers like hypixel. I can also play singleplayer with the mods and it works perfectly. The mods are up to date with the versions and the servers, but it just never gets past "Logging in" when i try to join their server. I use Curseforge to launch my mods, so that could maybe have something to do with it because it's technically a third party server, but it hasn't given me any trouble besides this one issue. I do not have MCLeaks and don't know what that is, but how can i search for it anyway to make sure? I have uninstalled minecraft launcher, updated my microsoft and my videocard drivers, reset my wifi and checked my parental settings (I am the owner on my computer), flushed my dns, modifying my host file to delete mojang but there's nothing with mojang on there, disabled my firewall, changed my IPV6 domain to 8888, restarted my router, and none of that works. I have researched this issue thoroughly and tried every solution I have came across and nothing is fixing the problem so i have come here as a last ditch effort. All i want to do is play mods with my friend. My friend has no issues with the server or mods and he has it through curseforge too. I would like further assistance in any way you think could help or even refer me to another forum that could help with this. Genuinely I cannot figure out why it doesn't work I would love any sort of further help.  
    • been getting this error and followed the old tick loop post however i cant figure out what file to delete Description: Exception in server tick loop java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.LevelAccessor.m_7654_()" because the return value of "net.minecraftforge.event.level.LevelEvent$Unload.getLevel()" is null     at com.lion.graveyard.platform.forge.HordeSpawner.onWorldUnload(HordeSpawner.java:41) ~[The_Graveyard_3.1_(FORGE)_for_1.20.1.jar%23196!/:?] {re:classloading}     at com.lion.graveyard.platform.forge.__HordeSpawner_onWorldUnload_Unload.invoke(.dynamic) ~[The_Graveyard_3.1_(FORGE)_for_1.20.1.jar%23196!/:?] {re:classloading,pl:eventbus:B}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.mehvahdjukaar.moonlight.api.platform.forge.PlatHelperImpl.invokeLevelUnload(PlatHelperImpl.java:279) ~[moonlight-1.20-2.13.66-forge.jar%23185!/:?] {re:classloading}     at net.mehvahdjukaar.moonlight.api.platform.PlatHelper.invokeLevelUnload(PlatHelper.java) ~[moonlight-1.20-2.13.66-forge.jar%23185!/:?] {re:mixin,re:classloading}     at net.mehvahdjukaar.moonlight.core.misc.FakeLevelManager.invalidate(FakeLevelManager.java:29) ~[moonlight-1.20-2.13.66-forge.jar%23185!/:?] {re:classloading}     at net.mehvahdjukaar.supplementaries.common.utils.fake_level.BlockTestLevel.invalidate(BlockTestLevel.java:34) ~[supplementaries-1.20-3.1.13.jar%23192!/:?] {re:classloading}     at net.mehvahdjukaar.supplementaries.common.block.faucet.FaucetBehaviorsManager.onReloadWithLevel(FaucetBehaviorsManager.java:129) ~[supplementaries-1.20-3.1.13.jar%23192!/:?] {re:classloading}     at net.mehvahdjukaar.supplementaries.common.events.ServerEvents.onServerStart(ServerEvents.java:160) ~[supplementaries-1.20-3.1.13.jar%23192!/:?] {re:mixin,re:classloading}     at net.mehvahdjukaar.supplementaries.common.events.forge.ServerEventsForge.onServerStart(ServerEventsForge.java:119) ~[supplementaries-1.20-3.1.13.jar%23192!/:?] {re:classloading}     at net.mehvahdjukaar.supplementaries.common.events.forge.__ServerEventsForge_onServerStart_ServerStartedEvent.invoke(.dynamic) ~[supplementaries-1.20-3.1.13.jar%23192!/:?] {re:classloading,pl:eventbus:B}     at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2352!/:?] {}     at net.minecraftforge.server.ServerLifecycleHooks.handleServerStarted(ServerLifecycleHooks.java:115) ~[forge-1.20.1-47.3.29-universal.jar%23212!/:?] {re:classloading}     at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:638) ~[server-1.20.1-20230612.114412-srg.jar%23207!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:APP:unionlib.mixins.json:MinecraftServerMixin,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23207!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraftserver,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:APP:unionlib.mixins.json:MinecraftServerMixin,pl:mixin:APP:citadel.mixins.json:MinecraftServerMixin,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A}     at java.lang.Thread.run(Thread.java:833) ~[?:?] {}  
    • Online forums in general seem to be declining in popularity imo. There’s still value here for certain types of content, such as written tutorials and blog posts which would otherwise get lost in the chat history fairly quickly on Discord. Also for those that prefer the forums format ofc. But for faster support related topics, I agree that the Discord is probably your best bet at the moment. The speed of responses is also down to the ratio of volunteers - the player support forum still seems pretty active, but the coding ones much less so. Once you’re feeling more confident in your modding skills, be the change you want to see
    • try the same link, i swapped logs after sitting in the world for a few minutes then leaving. Lmk if it keeps happening then ill just send a video of the live log on modrinth
    • It is an issue with chimes
  • Topics

×
×
  • Create New...

Important Information

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