jredfox
Members-
Posts
660 -
Joined
-
Last visited
Everything posted by jredfox
-
PlayerEvent.LoadFromFile Data Not Syncing De-Serialization
jredfox replied to jredfox's topic in Modder Support
where does it state no skin and cape urls? this mod seemed to not be closed out https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/2300380-1-7-10-advanced-capes-mod-664000-downloads I do use my IDE but, I am having difficulty finding the class out of thousands which one creates the player on server side -
PlayerEvent.LoadFromFile Data Not Syncing De-Serialization
jredfox replied to jredfox's topic in Modder Support
ok is there anything else hard coded data before the PlayerList.initializeConnectionToPlayer()? I know hooks are going to be needed not a problem. I already had to hook to get my skins/capes working without replacing the player model for my new mod so I don't have an issue with ASM. Where is the EntityPlayerMP constructed anyways? -
My goal is to manipulate data on PlayerEvent.LoadFromFile to always change the spawn dimension to the overworld. The issue I change the player spawn dimension via nbt and player.readFromNBT() but, the client is saying it's still renders previous nether dimension's sky. I thought PlayerEvent.LoadFromFile was for parsing data including parsing the dimension so if this isn't an early enough event for de-serialization for the client then what is? Before you go I need packets well the regular nbt doesn't get any packet updates until after the forge event and their dimension may change. I doubt it's packets there is probably something wrong with the world. I would also like to manipulate other data on this event but, it appears even though vanilla "parses data there" it doesn't appear to be syncing with anything. I am using this event as it's suppose to parse stuff from the disk so packets shouldn't be needed but, tell me what I am doing wrong. otherwise I need to teleport the player across dimensions and lag up load time even more when it should just be able to say he this data parsed from the disk is this packets get sent automatically after and I am planing on data manipulation of other data so player login event is simply not an option
-
has nothing to do with that. It wasn't half written it was the simple fact of java x method() doesn't work they way you thought it did because x method needs y() to happen first to your vars
-
read above if you read anything my original code should have worked it was x+-radius z+-radius and that's what everyone else said as well but, bounding boxes need an extra +1 because they are not meant to be in radius they are meant to be in a box so it doesn't quite work that way. So yes I know java but, the method doesn't do what everyone else said it does the way it said it did that's why I made this forum. I forgot about the mob spawner till the very last post and fixed mine
-
if you read the code I was using what other people gave me and it should have made sense. And no it's not always my fault when it's broken or nobody knows how to use it or it's not made to be used that way. my original code was x-radius 0,z-radius, x+radius,255,z+radius which should have worked but, for some reason bounding boxes need an extra +xz on their end or it won't work properly and will find entities where it shouldn't be finding them.
-
I copied and pasted the mob spawner code seemed to fix it although I don't understand why there is a +1 on everything. The only thing I changed was the y: public List<Entity> getEnts(World w,int x, int z,int radius) { return w.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x,0,z,x+1,257,z+1).grow(radius)); }
-
this isn't solved still now I am having the opposite problem with having the 0.999+ it's now killing stuff it shouldn't be. if I set it to anything like +0.1 it fixes it but then the older issue of it not killing stuff is back. I think w.getEntitiesWithinAABB() is bugged. Steps to reproduce: place armor stands all around you place one inside of you do /butcher armor_stand 0 it kills your one and several others a block a way If you change the 0.9 to 0.1 then it won't kill them all in 1 block radius with /butcher armor_stand 1 Code: https://github.com/jredfox/lanessentials/blob/master/src/main/java/com/EvilNotch/lanessentials/commands/CommandButcher.java
-
I did I printed it said on 0,0 with radius of one -x:-1 +x:1 -z:-1 +z:1 I think they were it's just it uses double values which was < -1 as double and which was > 1 as double. So I used -1.999 and 1.999 to get to the very edge of the block. That seemed to fix all of my errors
-
Edit still not working I put 4 pigs beside me with a block radius of one did my butcher command and it only found 2 out of the 4 pigs in a 1 block radius:it seems to occur going twords -x and postive z
-
nevermind
-
is there a way to get the min and max y dynamically? public List<Entity> getEnts(World w,int x, int z,int radius) { return w.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x-radius,0,z-radius,x+radius,255,z+radius)); }
-
Here is my code my goal is to get all entities withing the radius of 10,000 public List<Entity> getEnts(World w,int x, int z,int radius) { return w.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x,0,z,x+radius,255,z+radius)); } There are lots of pigs and slimes yet it only outputed this list: [06:48:25] [Server thread/INFO] [STDOUT]: [com.EvilNotch.lanessentials.commands.CommandButcher:execute:65]: [EntityPlayerMP['Player52'/298, l='New World', x=172.76, y=4.64, z=-1269.33], EntityItem['item.item.beetroot'/295, l='New World', x=202.14, y=4.94, z=-1258.86], EntityItem['item.item.beetroot_seeds'/296, l='New World', x=202.08, y=5.00, z=-1259.44], EntityItem['item.item.beetroot_seeds'/297, l='New World', x=201.01, y=5.00, z=-1259.89]] Solved: public List<Entity> getEnts(World w,int x, int z,int radius) { return w.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(x,0,z,x+1,257,z+1).grow(radius)); }
-
[1.12.2] @SubscribeEvent seems to be not working as it in 1.7.10 did
jredfox replied to nocot's topic in Modder Support
you register you said class rather then an object. Take a look here at my code: MinecraftForge.EVENT_BUS.register(new com.EvilNotch.lanessentials.events.EventHandler()); In that class we created a new object so we must keep the @SubsribeEvent methods object methods meaning no static in the method name. To learn more about java objects methods either use youtube or take a class on computer science. This has nothing to do with forge. Basically static can be called from everywhere and object methods are used object.method() style. The benefit being that you can use the objects own variables in said method to do the said function of that method. @SubscribeEvent public void skinNo(PlayerLoggedOutEvent e) { System.out.println("event player logout fired"); } if you do it the new way the methods need to be static and I am unsure if you register it with an object or class. -
so In nbtedit it says commands are allowed is true. Note I am getting the info on client side could this be the issue I thought it would have it synced on both sides???? boolean allowCheats = mc.world.getWorldInfo().areCommandsAllowed(); Edit: Needs to be called on server side only if you absolutely need it on the client you are going to have to request a packet for it. I was already on the server side so I just changed my method a little bit and split the client gui version.
-
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
No need for ASM changing the port when opening to lan. Changing the port isn't the issue it's port forwarding telling the internet box hey TCP allow this port through the firewall right after minecraft says hey open this to lan on a server socket. Yes I also removed /publish command as it was completely broken. I close the lan and re-open it with my command openToLan or openToInternet. Of course removing anything now in days or editing anything requires alot of reflection You seem to know ASM good would you be interested in helping us out with our mod that is going to change everything for both lan and dedicated servers? Please MSG me if your interested. If you need to see the code dev first here you go: https://github.com/jredfox/lanessentials -
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
hamichi is getting into the dangerzone and it doesn't support all of your data you need severe block lag. Utorrent is also getting into the danger zone it's a torrenting malicious program thus you cannot safely use it to port forward. Also if you read my post people < 18 usually can't mess with the internet box itself with my mod you don't have to just opens up your port just like xbox does. So yeah I don't even trust myself to mess with my box just use UPNP to add a port entry and close when the game is done and if close ports is configed(remove entry from router). The difference is the port entry will be there on the box still just will get no reply until minecraft is open to lan. I wouldn't recommend the config option unless your server is dedicated and you have changed your port. I would also tell people to disable port forwarding if they want to throw the mod in one of those virtual dedicated servers so it doesn't break them I use a java library it's not that sophisticated so if someone knows something that isn't cling(requires android and looks unsafe as well) then I would like to hear about it. I found one it works on my internet box I can't verify if it works with all routers supporting UPNP. I hear NAT-PMP (or something like that) is a protocol I should also support but, I can't find a java library that does support it and works. I also Noticed PCP or something like that newer routers are supporting. So please help me find a more updated library that supports all of them. Currently I only Support UPNP with (TCP and UDP) I am not sure how to support NAT-PMP or any newer protocols to make 99% routers compatible not just mine. -
[1.12.2] @SubscribeEvent seems to be not working as it in 1.7.10 did
jredfox replied to nocot's topic in Modder Support
no static if you use subscribe event the new option has to be static but, the old has to be object oriented(no static). Also if you use the old you have to create an object from it not registering the class -
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
5 seconds is highly unoptimized utorrent can do it in less then a second but, again it's an unsafe program to use so I found a safe one and am working on making it mc compatible. It is a good idea for people who want an actual server and cannot mess with the internet box aka anyone < 18 which is who plays minecraft. I looked at the code all it does it add an entry it takes too long due to it calling wait for stuff on pausing the thread way too much rather then just once. I am going to modify it later on my fork: https://github.com/jredfox/WaifUPnP -
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
I did take a look at exactly where the sockets are instantiated on client it's a ping thing that's client only and on server it's like 3 separate threads. The threads are to keep it up on lan side the actual port forwarding process is unclear as nobody seems to know how to make upnp work except for one library I recently found and had to modify it a bit(currently still unoptimzied takes 5 whole seconds to port forward): https://github.com/adolfintel/WaifUPnP On Share to Lan: Port forward if applicable on gui or command only On Server Start: Port forward if applicable on dedicated only Port forwarding is just telling your internet box it's ok to put your port through the firewall the sockets already make it connection themselves it's you just need to tell the box to open up a port entry -
Ok from what I understand: DatagramSocket is UDP > I need to know it's function ServerSocket might be TCP? I found this at: net.minecraft.network.rcon.RConThreadBase net.minecraft.client.multiplayer.ThreadLanServerPing I don't really know what the difference is nor why the server is running both when opening to lan. Also it appears my attempt to re-instantiate a lan port has failed on server side. I don't know what else I am missing here to change the port of the connection: DedicatedServer server = (DedicatedServer) FMLCommonHandler.instance().getMinecraftServerInstance(); InetAddress inet = InetAddress.getByName(server.getServerHostname()); server.getNetworkSystem().addLanEndpoint(inet, port); server.setServerPort(port);
-
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
Look at here: public static String getPublicIp() throws IOException { URL whatismyip = new URL("http://checkip.amazonaws.com"); BufferedReader in = new BufferedReader(new InputStreamReader(whatismyip.openStream())); String ip = in.readLine(); //you get the IP as a String return ip; } public static String getIpv4() throws UnknownHostException { InetAddress inetAddress = InetAddress.getLocalHost(); return inetAddress.getHostAddress(); } For this command it's going to use public ip in my JavaUtil.class -
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
store the ip once gotten once to the right side and keep it there till re-launch since ips can and will change -
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
the server port returns -1 if it's not dedicated. A server should know it's public ip I guess I have the right code then maybe I could do a cached variables so it's not getting it every time online I just won't store it to the disk. I expected the server to cache it's own public ip in a variable somewhere My question is for lan servers where is the port stored at properly or did I already do it right? -
Method Not Found From MinecraftServer.getPort()
jredfox replied to jredfox's topic in Modder Support
but, I don't want dedicated server I want it working on lan servers to. So I got some code in my proxy to get it working for lan servers but, I am unsure if this is proper way to get it???? public static String getPort() { IntegratedServer server = Minecraft.getMinecraft().getIntegratedServer(); ThreadLanServerPing ping = (ThreadLanServerPing) ReflectionUtil.getObject(server, IntegratedServer.class, LanFeildsClient.lanServerPing); if(ping == null) return "-1"; return (String)ReflectionUtil.getObject(ping, ThreadLanServerPing.class, LanFeildsClient.address); } and on dedicated server side: public static String getServerPort(MinecraftServer server) { return "" + server.getServerPort(); } putting it together: String port = MainJava.isClient ? ClientProxy.getPort() : ServerProxy.getServerPort(server); Now I still am hard coding the ip to dynamically get it from a website rather the the mc servers cached version. Where is the mc servers cached ip for both lan and dedicated