Jump to content

Help With Custom TP Command


jredfox

Recommended Posts

Edit Solved Issues 1 and 2:
CMD Code:
https://gist.github.com/jredfox/6108a45efc52e6e214d8161a0ed693a3

 

Goal teleport player to x dimension specified including other players.

 

Issues With CMD:
after teleportation a couple times @p no longer works
after teleporting from the end to nether then dying the ender dragon bar doesn't go away.

 

Steps to reproduce Issue 1:

/tpdim @p ~ ~ ~ -1
/tpdim @p ~ ~ ~ 1
/tpdim @p ~ ~ ~ -1
/tpdim @p ~ ~ ~ 1 > errors here cannot find @p
/tp @p ~ ~ ~+1 > errors here cannot find @p vanilla test

Steps to reproduce Issue 2:
go to end dimension

go to nether dimension observe ender dragon bar

/kill and observe both fog and the ender dragon bar
 

Code:

https://gist.github.com/jredfox/9b81f4f26ebb81a9398618e330a7abae

Edited by jredfox
Link to comment
Share on other sites

I think I figured out the dragon/wither it's setup hard coded and stupid at least via server side. The entity contains the boss info server necessary to send a packet to the client to add/remove boss bar.but, the thing is you need that instance to begin with. I don't see why the server is handling client only code. It should be only packets and then handled via client side and clients then have an array of bars. I will test my hypothesis by caching all boss mobs then on world change remove boss bars and then clear the cache.

I still need help with not being able to find @p bug? please help. Why can't the vanilla command not be able to find the nearest player?

Edit: the objects for the dragon/wither boss data doesn't get updated and no longer exist after traveling to another dimension so I am thinking of a tick handler client only where if the data doesn't update in so many ticks to remove the bar. How could I do this?

Edited by jredfox
Link to comment
Share on other sites

15 hours ago, diesieben07 said:

Once again you insist on doing things completely ass-backwards.

Vanilla manages cross-dimension teleports just fine: Via portals. No hacks or tick handlers or whatever the fuck needed.

You need to do the same thing and it will work.

I didn't do anything backwards and no it doesn't work. Take a look at mist craft which did the same thing the ender dragon bug still occurs when doing as I said above just with their command. So how do I fix this?

Why can't the command find @p is what I need to know

And if you took a look at my code I call a vanilla handler for changing dimensions so....

Edited by jredfox
Link to comment
Share on other sites

I got the dragon manager to update as the player leaves the world. It appears this bug is only 1.9+ I never heard of it occurring in 1.7 especially since it use to be client only and we had mods to transfer to other dimensions lots of them some only calling vanilla methods. It appears this issue doesn't exist for withers and it also appears that dragon bars do not appear and dragons do not work unless they are in their specified dimension unlike < 1.9 versions

Now I need to know why the @p cannot find nearest player. Something isn't syncing when the player goes from the end dimension to the nether dimension. I need to know what hashmap isn't populated

Edited by jredfox
Link to comment
Share on other sites

    /**
     * Must be only called if player is at end dim this is because vanilla is hard coded and no longer displays bars outside of end dim
     */
    public void removeDragonBars(EntityPlayerMP p,World end) 
    {
    	try
    	{
    		DragonFightManager fightManager = ((WorldProviderEnd)end.provider).getDragonFightManager();
    		if(fightManager != null)
    		{
    			FieldAcess.method_dragonManager.invoke(fightManager);
    		}
    	}
    	catch(Throwable t)
    	{
    		t.printStackTrace();
    	}
	}

 

Link to comment
Share on other sites

23 hours ago, diesieben07 said:

Once again you insist on doing things completely ass-backwards.

Vanilla manages cross-dimension teleports just fine: Via portals. No hacks or tick handlers or whatever the fuck needed.

You need to do the same thing and it will work.

Not to spam or anything but, this is weird when teleportation from my command from end to nether it doesn't add it to any of the word's new hash maps like loaded entities and loaded players I would even guess the chunk hash maps. 

[02:38:20] [Server thread/INFO] [STDOUT]: [com.EvilNotch.lib.minecraft.content.CMDDim:execute:94]: Ent List:[]
[02:38:20] [Server thread/INFO] [STDOUT]: [com.EvilNotch.lib.minecraft.content.CMDDim:execute:95]: EntHasPlayer:false

I call the vanilla method transfer player to dimension what else should I be calling?
https://gist.github.com/jredfox/9b81f4f26ebb81a9398618e330a7abae

I fire forge's respawn event since the respawn packet is there on vanilla player list travel player to dimension. Is this wrong should this not be considered as a respawn since the player is being transferred?

I will take a look at the entity method transfer to dimension but, the player list should be all I have to call for players.

Edited by jredfox
Link to comment
Share on other sites

19 minutes ago, diesieben07 said:

So far no you didn't. But your approach when something doesn't work is completely wrong.

You refuse to take a step back and figure out why what you are doing doesn't work and instead insist on tacking on quick fixes and hacks to make your initial solution work no matter what.

 

Things like this is what I mean. You do not need to care about any hash maps internal to Minecraft. Do not hack around internals.

 

Things I observed about your code (can't test it because you have not provided a working repository):

  • Why the f*** are you firing FML's respawn event? You are not respawning anything. And if you did, you would not have to fire the event manually.
  • You are setting the location first, then teleporting to the target dimension. This is broken.
  • Traveling to a dimension happens via Entity::travelToDimension, this is what portals use for example.

Entity travelToDimension seems to be non existent but, I did eventually find changeDimension which I don't see called anywhere in playerlist guess it's bugged going to give this a try or vanilla always expects that to fire first which means it's called elsewhere either way going to give it a try soon.

Edit: that method I found above doesn't do what I need it to do it doesn't even add them to the hashmaps.

Setting the location without packets it's a set of varibles. If I transfered the player to the dimension then set the location it lags alot so I set the location first therefore only loading the chunks your xyz is suppose to be at. And if I detect it's still not re positioned then I do it again this time with networks being involved

Edited by jredfox
Link to comment
Share on other sites

4 minutes ago, diesieben07 said:

Yeah, I meant changeDimension, sorry.

Why would playerlist call it? The only thing in Minecraft that teleports across dimensions are portals. And they use changeDimension. Why would you expect PlayerList to use this? What for? Why do you think it's bugged? You just blurt out random statements without anything to back them up. This is not helpful.

 

WHAT?

 

WHAT! WHAT WHAT WHWAHTAHHH

I give up.

Look at my method call:
 

p.getServer().getPlayerList().transferPlayerToDimension(p,traveldim, new EntityTeleporter(p.getServer().getWorld(traveldim)));



That is what I call to change dimensions and it does work but, the world hashmaps and possibly other data isn't synced right? What other thing should I be calling?

That method is what perfect spawn calls and what vanilla calls is my guess somewhere. 

Edited by jredfox
Link to comment
Share on other sites

1 minute ago, diesieben07 said:

What the fuck are "world hashmaps"?

sorry arraylists very tired right now.

loadedEntities, playerEntities that's the first two things I checked and were blank after calling my tp command from end to nether

Link to comment
Share on other sites

3 minutes ago, diesieben07 said:

Why are you checking them? Why do you care? As far as I know it would take a few ticks for the player to fully transfer over.

I checked them after the dimension change. I care because the @p command no longer works and it's going to cause mod incompatibilities when it can't find the player. 

I gave it a full 2 seconds before trying to transfer from the nether back to the end but, couldn't find @p. you probably are right on the arraylists taking a couple ticks to update but, what is causing it then?

going to have a tick checker firing every second will post resaults

Edited by jredfox
Link to comment
Share on other sites

After 5 seconds with this code on tick this was still printing and didn't print until I teleported straight from the end to the nether. I tried teleporting from the nether to end before and it didn't print so it only occurs from end to nether then it bugs out.
 

		if(!event.player.world.loadedEntityList.contains(event.player))
			System.out.println("ERR:" + event.player.getName() );

 

It appears player list has some broken if statements that will never fire because they say if false && method() well it's never going to fire.

Edited by jredfox
Link to comment
Share on other sites

9 minutes ago, diesieben07 said:

And I don't know why that is nor can I test it since you did not include a working repository.

Ok I am currently using evil notch lib for the command. It will be in a separate mod eventually
https://github.com/jredfox/evilnotchlib

I found a fix but, I know it's not proper since the entity player could already be added to the chunk list and it's not calling the proper method in the first place that I know of.

                	if(!newWorld.loadedEntityList.contains(p) || !newWorld.playerEntities.contains(p))
                	{
                		System.out.println("ERR Player Not Added To World:" + p.getName());
                		newWorld.spawnEntity(p);
                	}

 

Link to comment
Share on other sites

1 hour ago, diesieben07 said:

Did you borrow your commit names from Reika?

Your repository is also completely broken, it contains duplicate classes.

And I doubt you own evilnotch.com.

dupe classes well I will take a look at that.

Of course I own evil notch lib just go to curseforge then take a look at evil notch lib the owner says it was me if it wasn't it would have been a fork which is detectable on github. I am in the middle of a huge update and I am not going to say this is 2.0 it's just a huge update so I could do builds or snapshots this time I decided snapshots since each stage had little to no bugs.

Wow that's alot of dupes I wonder how src wound up there. Fixing it now new repository should be same link.
https://github.com/jredfox/evilnotchlib

So you going to test why the entity player gets added to the world arrays sometimes and not others by calling player list travel to dimension?

evilnotch.com no I don't It's the failed team's name that originally planned on updating evil minecraft mod but, I got way too busy with utility mods and the rest of the team quit on me. But, I did succeed in writing a legacy mod to fix minecraft to be more like 1.2.5 in 1.7.10 called evil notch core. The code was rushed and although the code looked clean in most areas had bugs since I didn't understand how everything worked. I plan on making evil notch core re-write once the lib nessary for it has been done as well as silkspawners and mob spawnage updates and dungeon tweaks

 

the original coding team for evil notch quit( evil notch himself didn't and was constantly asking for a new team of coders all the way up to early 2014 sad nobody responded)

Edited by jredfox
Link to comment
Share on other sites

15 minutes ago, diesieben07 said:

Why did you kill your complete commit history? Do you not know how Git works?!

You are now missing your build.gradle.

 

This is not at all what I said. Package names are domain names. If you do not own the domain evilnotch.com you should not use that as your package name.

no it's com.evilnotch.lib  most programs have their package base retaliative to their program name. And in all previous versions of how to make a mod and even program tatorials for java say use three packages com(program option),org(library and api only),net(don't remember second option). Then it says what is the author usually and the third dot is what is the program used for. This rules out package and classes getting overridden by other java programs in memory.

No I don't own mc user EvilNotch but, I do own the Team EvilNotch do you know what I am saying? I was trying to revive old ideas but, all the other coders quit on me so the actual source plan me and another agreed we would do (update evil minecraft) never happened.

I forgot about the build.gradle I just reset the repository so I forgot to add it back thanks. It's up now. The only thing I edited though was options.encoding = "UTF-8" under compile java

Edited by jredfox
Link to comment
Share on other sites

10 minutes ago, diesieben07 said:

That's not how package names work.

 

You still do way too much crap in your teleport method. Why are you firing the respawn event? Clean this up.

I could comment out the respawn method even though the packet for respawn is there in the player list transfer dimension aka vanilla respawns but, not forge. So I thought why not fire it on forges side to. It could mess up things either way so I just left it there. But, I will comment it out for the tp command.

What other crap is there? I told you why I had the code to re position the entity before changing dimensions because the way the transfer works is set the players location on the connection from the players current position thus alot more chunks would load. If you got a better idea for doing this or a manual method idea I am all ears. Also if you looked I didn't say player.connection.setlocation meaning that it's not going to send any packets and before the tick is even up the player changes to that specified dimension at that location.

The package name is named right:
The prefix is com:
the domain is evilnotch

the function aka program is lib


So team evil notch has a lib. I know it's only three chars but, I didn't want any more then I had to name and com.evilnotch.library sounded wrong and unprofessional 

Edited by jredfox
Link to comment
Share on other sites

this is an improper fix this is what I am worried about please help me on this.
Line 86:

                	if(!newWorld.loadedEntityList.contains(p) || !newWorld.playerEntities.contains(p))
                	{
                		System.out.println("ERR Player Not Added To World:" + p.getName());
                		newWorld.spawnEntity(p);
                	}

 

Link to comment
Share on other sites

Ok I think I might have figured out why it's only bugging out if your tping from the end to any other dim it's because they have a hard coded if statement if it's not the end dim spawn entity into new world. What the heck? This is garbage it should always do that and they should have a different teleporter for the end instead of always trying to use the nether teleporter instead they give you garbage so you either code around it or make your own method because you can't use it as is since it don't work.

Vanilla hard coded if is end do nothing:

        if (lastDimension != 1)
        {
            oldWorldIn.profiler.startSection("placing");
            d0 = (double)MathHelper.clamp((int)d0, -29999872, 29999872);
            d1 = (double)MathHelper.clamp((int)d1, -29999872, 29999872);

            if (entityIn.isEntityAlive())
            {
                entityIn.setLocationAndAngles(d0, entityIn.posY, d1, entityIn.rotationYaw, entityIn.rotationPitch);
                teleporter.placeInPortal(entityIn, f);
                toWorldIn.spawnEntity(entityIn);
                toWorldIn.updateEntityWithOptionalForce(entityIn, false);
            }

            oldWorldIn.profiler.endSection();
        }



Work Around:

                	if(oldWorld.provider.getDimension() == 1)
                	{
                		System.out.println("End to Another Dim Patching Vanilla:" + p.getName());
                		tele.placeInPortal(p, p.rotationYaw);
                                newWorld.spawnEntity(p);
                                newWorld.updateEntityWithOptionalForce(p, false);
                	}



Vanilla needs to have proper object orientation for teleportation shouldn't have to do that work around myself but, you know....

Link to comment
Share on other sites

tumblr_ljh0puClWT1qfkt17.gif

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.

Link to comment
Share on other sites

18 hours ago, diesieben07 said:

That's not how package names work.

 

You still do way too much crap in your teleport method. Why are you firing the respawn event? Clean this up.

Ok I figured out the two issues but, I have a new one. Players don't update to other players once either teleported from another dimension.

What packet should I send to what players to update them?

Edit nevermind vanilla's transfer player to dimension is highly bugged copied code from another mod worked perfect no syncing issues.

Edited by jredfox
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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • so my minecraft crashes when opening my world, i played without any troubles for about 5 days and today it started tweaking.. pls help me
    • Hi guys! I am having some issues with the server crashing over and over and I was hoping to get some guidance.  Thanks in advance! Crash 1: java.lang.Error: ServerHangWatchdog detected that a single server tick took 60.00 seconds (should be max 0.05)     at net.minecraft.server.dedicated.ServerWatchdog.run(ServerWatchdog.java:43) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading}     at java.lang.Thread.run(Thread.java:840) ~[?:?] { Crash 2: java.lang.IllegalStateException: Capability missing for eeb7f026-34b4-42f5-9164-e7736461df83     at me.lucko.luckperms.forge.capabilities.UserCapabilityImpl.lambda$get$0(UserCapabilityImpl.java:66) ~[?:?] {re:classloading,re:classloading,re:classloading}     at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:261) ~[forge-1.20.1-47.3.10-universal.jar%23222!/:?] {re:mixin,re:classloading}     at me.lucko.luckperms.forge.capabilities.UserCapabilityImpl.get(UserCapabilityImpl.java:66) ~[?:?] {re:classloading,re:classloading,re:classloading}     at me.lucko.luckperms.forge.util.BrigadierInjector$InjectedPermissionRequirement.test(BrigadierInjector.java:143) ~[?:?] {}     at me.lucko.luckperms.forge.util.BrigadierInjector$InjectedPermissionRequirement.test(BrigadierInjector.java:129) ~[?:?] {}     at com.mojang.brigadier.tree.CommandNode.canUse(CommandNode.java:65) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parseNodes(CommandDispatcher.java:359) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:349) ~[brigadier-1.1.8.jar%2376!/:?] {}     at com.mojang.brigadier.CommandDispatcher.parse(CommandDispatcher.java:317) ~[brigadier-1.1.8.jar%2376!/:?] {}     at net.minecraft.commands.Commands.m_230957_(Commands.java:237) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:classloading}     at net.mcreator.boh.procedures.TeleportbenProcedure.lambda$execute$2(TeleportbenProcedure.java:65) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at net.mcreator.boh.BohMod.lambda$tick$2(BohMod.java:96) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?] {re:mixin}     at net.mcreator.boh.BohMod.tick(BohMod.java:96) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {re:classloading}     at net.mcreator.boh.__BohMod_tick_ServerTickEvent.invoke(.dynamic) ~[boh-0.0.6.1-forge-1.20.1_2.jar%23165!/:?] {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.event.ForgeEventFactory.onPostServerTick(ForgeEventFactory.java:950) ~[forge-1.20.1-47.3.10-universal.jar%23222!/:?] {re:classloading}     at net.minecraft.server.MinecraftServer.m_5705_(MinecraftServer.java:835) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:661) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:251) ~[server-1.20.1-20230612.114412-srg.jar%23217!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,re:classloading,pl:accesstransformer:B,xf:fml:xaerominimap:xaero_minecraftserver,pl:mixin:A}     at java.lang.Thread.run(Thread.java:840) ~[?:?] {}
    • Hello there! I am trying to make custom dimensions for a modpack I am making in an older minecraft version, 1.16.5. I like that version and it has a few other mods that have not been updated that I would still like to use. Anyway, I am having a terrible time with getting my dimension to work and have tried using code from other peoples projects to at least figure out what I'm supposed to be doing but it has not been as helpful as I would have liked. If anyone could help that would be greatly appreciated! Here is my github with all the code as I am using it: https://github.com/BladeColdsteel/InvigoratedDimensionsMod I have also included the last log, https://pastebin.com/zX9vsDSq, I had when I tried to load up a world, let me know if there is anything else I should send though, thank you!
    • Whether you are a fan of Hypixel Bedwars, SkyWars and PvP gamemodes like that, well you would enjoy this server! We have a very fun and unique style of PvP that a lot of our players really enjoy and we want to bring this server to more players like you! Yes you reading this post haha. Introducing, the Minezone Network, home of SUPER CRAFT BLOCKS. We've been working on this server for over 4 years now. Here is what we have to offer: SUPER CRAFT BLOCKS: This has 3 different gamemodes you can play, Classic, Duels and Frenzy. Each mode offers over 60 kits to choose from, along with a total of over 60 maps, allowing for various different playstyles on each map. There are also random powerups that spawn on the map which can include Health Pots, Bazookas, Nukes, Extra Lives and way way more! There is also double jump in this gamemode as well, which makes PvP a lot more fun & unique. You only need a minimum of 2 players to start any mode! Classic: Choose a kit, 5 lives for each player, fight it out and claim the #1 spot! Look out for lightning as they can spawn powerups to really give you an advantage in the game! Duels: Fight against another random player or one of your friends and see who is the best! Frenzy: Your kit is randomly selected for you, each life you will have a different kit. You can fight with up to 100 players in this mode and lets see who will be the best out of that 100! All the other stuff from Classic/Duels apply to this mode as well like powerups. We have 2 ranks on this server too, VIP and CAPTAIN which has a bunch of different perks for SCB and other things like Cosmetics and more.   SERVER IP: If this server has caught your interest in any way, please consider joining and you will NOT regret it! Bring some of your friends online for an even better experience and join in on the fun at: IP: minezone.club Hope to see you online!   SERVER TRAILER: https://www.youtube.com/watch?v=0phpMgu1mH0
  • Topics

×
×
  • Create New...

Important Information

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