p0t4t0sandwich / TaterLib

A cross API code library that allows developers to write code that works across multiple modding platforms, and across a wide range of Minecraft versions, all with one JAR file. If TaterLib runs on it, so can your plugin/mod.
GNU General Public License v3.0
8 stars 1 forks source link

Implement Player#getIPAddress #11

Closed wolflord212312 closed 6 months ago

wolflord212312 commented 6 months ago

Started adding getPlayerIP as getIPAddress

Am Unable to build at this time, Potato will need to build and make sure its good.

wolflord212312 commented 6 months ago

This is only for legacy!

wolflord212312 commented 6 months ago

not hard to add to newer Versions either to my knowledge but done messing with it.

wolflord212312 commented 6 months ago
     /**
     * {@inheritDoc}
     */
    @Override
    public String getIPAddress(){
        return ((EntityPlayerMP) player).getPlayerIP();
    }

Copy to 1.12 Copy to 1.13

1.14 moves to net.minecraft.entity.player.ServerPlayerEntity from net.minecraft.entity.player.EntityPlayerMP

    /** {@inheritDoc} */
    @Override
    public String getIPAddress(){
        return ((ServerPlayerEntity) player).getPlayerIP();
    }
wolflord212312 commented 6 months ago

@p0t4t0sandwich Should be good to go.

wolflord212312 commented 6 months ago

Only doing forge for now as i dont use other Modding API's will look at bukkit when i need to but if im using bukkit i still dont need it for my stuff, But for taterUtils you may want to add it

wolflord212312 commented 6 months ago

Why not doing fabric too wont touch sponge

wolflord212312 commented 6 months ago
@Override
public String getIPAddress(){
    return ((ServerPlayerEntity) player).getip();
}

for some reason this is not useablee in 1.14+ even tho it is in all javadocs to latest
wolflord212312 commented 6 months ago

Ok that is all i will do for this Feel free to merge

p0t4t0sandwich commented 6 months ago

I'll finish the implementations, then merge