Jump to content

DarkGuardsman

Forge Modder
  • Posts

    1479
  • Joined

  • Last visited

Posts posted by DarkGuardsman

  1. As the author of a large Forge mod I can tell you that upgrading to MC 1.3 / Forge 4 is not easy and takes quite a while. So have some patience ;)

    i'm not so sure i've watch most of the modder over in the UE section update very fast with only minor bugs.  Then again though some of the big mod makers could be wait for more stable versions. Another reason for the slow updating is school just started for a lot of people. Also i know build Craft has overly complex code for its API system.

  2. place it in your src or if you use eclipse drag and drop into a package folder. Then return the location and file name "/file/file/texture.png"

    Here is an example

    "GSM/textures/blocks/blocks.png"

    Wait, i don't have to put it in the jar?  :o

    i've always had my textures in my src or eclipse bin folder not sure why you would have to stick them into the jar?

  3. Original Post

     

    I've made a suggestion like this before so sorry if i didn't revive that post. i'm looking for a way i can access var12 in renderName method in RenderPlayer.class. My suggestion is too move the variable out of renderName method and in to the class itself. This way name tag render range can be accessed and changed.  Also so i no longer conflict with other mods like smart moving when i edit the class. If there is a better way than listed bellow do make changes.

     

     protected void renderName(EntityPlayer par1EntityPlayer, double par2, double par4, double par6)
        {
            if (Minecraft.isGuiEnabled() && par1EntityPlayer != this.renderManager.livingPlayer)
            {
                float var8 = 1.6F;
                float var9 = 0.016666668F * var8;
                double var10 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer);
               [b] float var12 = par1EntityPlayer.isSneaking() ? 32.0F : 64.0F;[/b]
    
                if (var10 < (double)(var12 * var12))
                {

    to

    [b]public static float RenderRange1 =  32.0F;
    public static float RenderRange2 =  64.0F;[/b]
    protected void renderName(EntityPlayer par1EntityPlayer, double par2, double par4, double par6)
        {
            if (Minecraft.isGuiEnabled() && par1EntityPlayer != this.renderManager.livingPlayer)
            {
                float var8 = 1.6F;
                float var9 = 0.016666668F * var8;
                double var10 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer);
               [b] float var12 = par1EntityPlayer.isSneaking() ? RenderRange1 : RenderRange2;[/b]
    
                if (var10 < (double)(var12 * var12))
                {

    I would make a pull request on forge github but i don't understand how to add it to the patch folder correctly.

     

    I finally figured out how to make a patch and made the changes i original asked for. So could a forge dev pull my request or implement the changes. I really would love to use this in my ComeCloser mod so its compatible with several mods. Also thank you in advance :)

    https://github.com/MinecraftForge/MinecraftForge/pull/174

    Also if i messed up making the patch file do tell me so i can fix it and know what to look for next time i make one.

  4. not sure if i can use that but i'll toy with the ideal

    Here is the code section i want to edit

       protected void renderName(EntityPlayer par1EntityPlayer, double par2, double par4, double par6)
        {
            if (Minecraft.isGuiEnabled() && par1EntityPlayer != this.renderManager.livingPlayer)
            {
                float var8 = 1.6F;
                float var9 = 0.016666668F * var8;
                double var10 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer);
                float var12 = par1EntityPlayer.isSneaking() ? 32.0F : 64.0F;
    
                if (var10 < (double)(var12 * var12))
                {
    Cut.................................Cut

    var12 is what i want changed to my own numbers

  5. For my mod comeCloser i edit RenderPlayer class in order to change a few lines of code to make seeing a player's name tag harder. This works find if my mod is the only one doing so but if another mod editing this file is installed both mods fail to work. So what i'm asking is there a way i can change those lines without editing the file? I've heard there is a way but have no clue what it is or how to do it. 

  6. Get me a mod to test, and reproduceable way to test this error. This should not be happening. Unless you're using a block > 256 and you're using a build that is old.

    Most people trying to connect to my server get this error right off the back or another related to something modification. However with almost no mods installed this error will still happen. Though for some reason i no longer crash on log in but will when running around mining, other users still crash off the back.

  7. At first i was getting this while loggin into my server then i started too only get it while breaking blocks, now i just get it randomly. I've update my forge to the latest version,which allowed me to actual log int, but i getting this error on other stables version. I've also removed all mods and readded each mod one at time but still get this every so often while playing. The server also only has forge installed in the jar and in the mods UE v5.1, ICBM v5,and (myMod)Guardsman v1.3.2r1.

     

    crash log

     

     

     

    Time: 8/19/12 9:19 AM

    Description: Unexpected error

     

    java.lang.ArrayIndexOutOfBoundsException

    at java.lang.System.arraycopy(Native Method)

    at wl.a(Chunk.java:1309)

    at asv.a(NetClientHandler.java:580)

    at cn.a(Packet51MapChunk.java:152)

    at bb.b(TcpConnection.java:438)

    at asv.d(NetClientHandler.java:99)

    at atd.b(SourceFile:51)

    at net.minecraft.client.Minecraft.l(Minecraft.java:1774)

    at net.minecraft.client.Minecraft.J(Minecraft.java:831)

    at net.minecraft.client.Minecraft.run(Minecraft.java:761)

    at java.lang.Thread.run(Unknown Source)

     

     

     

    Also when my client crashes the server thinks i'm still logged in for at least 5 mins

  8. If you want to add a command, don't use the event bus, use the CommandHandler. This allows for your command to get in the help list,....

    If you want/need an example, look at this. I use the bus because I want to block vanilla commands too, but I don't think that's what you want.

    was hoping to find a method that gave me the player who issued the command.

  9. For one of my mods i'm working on updating i use chat command to change cfg settings on the fly.

    In 1.2.5 i used

    public boolean onChatCommand(EntityPlayer player, boolean isOp, String command)

    inorder to get each command used in game and exicute anything attached to that command. However in 1.3.1 i can't find anything similar to is besides

    public boolean handleCommand(String command, Object... data);

    which only gives me command string. Is there another way to get commands issued by the player.

  10. bad idea to use  my code its not 100% stable. Also most of that error has to do with minecraft not downloading the skin for player13. Also where is your code that receives that packet because that might be the error. Currently i'm having issue in my code where the data stream is being read past the actual length of the stream. Which causes an error reading the packet but no crash.

     

    I quess this have nothing todo with the 503-error (it appears everytime on startup), the actual error is this:

    2012-08-17 01:57:30 [sEVERE] [ForgeModLoader] A critical server error occured handling a packet, kicking net.minecraft.src.NetServerHandler@6ee7e2ec

     

    But I could figured out, after I started client and server seperatly, there was a "real" error-code (NPE).

    (I was opening the gui on server too (forgot world.isRemote)).

     

     

    For your length-of-stream-problem I'm sending the length too ;)

    1. type-id

    2. length

    3. actual data

     

    It's a great help, if you are sending arrays with different lengths.

    lol that would cuase that. Anyways thank for the tip i forgot i can send the packet length with it.

  11. bad idea to use  my code its not 100% stable. Also most of that error has to do with minecraft not downloading the skin for player13. Also where is your code that receives that packet because that might be the error. Currently i'm having issue in my code where the data stream is being read past the actual length of the stream. Which causes an error reading the packet but no crash.

  12. Try using PacketManager.sendTileEntityPacket from UE...

     

    Also, you can read doubles and then cast the read doubles into int after reading so it doesn't mess the stream data up.

    i am using a recoded version of your code for my packetHandler. only issue is i can't figure out how to send the settings packet to the server to be saved. I've got sending to the player done just fine and gui gets the old settings. However if i go into the gui and change all the vars in the textboxes, it only keep the new setting as long as game stays on. Which means i need to update the server's TileEntity with the new settings.

     

    I'll look into it and tell you if I got any insight on it.

    ty without being able to update the Barrack settings the block doesn't work past looking good. Other than that my Guardsman are rendering now :), well except for weapons but that an old error that crops up every update.

     

    Edit: i see the modloader.sendPacket now does something instead of being empty. Anyways is the onPackData version for the server side?

    Edit2: Fixed it turns out i was not getting the right world so when the packet got there it didn't know which world to send it too.

  13. Try using PacketManager.sendTileEntityPacket from UE...

     

    Also, you can read doubles and then cast the read doubles into int after reading so it doesn't mess the stream data up.

    i am using a recoded version of your code for my packetHandler. only issue is i can't figure out how to send the settings packet to the server to be saved. I've got sending to the player done just fine and gui gets the old settings. However if i go into the gui and change all the vars in the textboxes, it only keep the new setting as long as game stays on. Which means i need to update the server's TileEntity with the new settings.

  14. Right.. thats retarded.

    When you write a double to the stream

    It write 8 bytes

    When you read a int from the stream

    you read 4 bytes

    see an issue here?

    at least you can be nice about my f' up, it was a copying error from a tut and i forgot to code it to write ints. anyways back to the original issue how to i get the packet to the local server. I'll try the sendPacket it just seem to be too simple seeing as i had to set up a packetManager.class just to send packets to the client.

     

    Edit:

    is it me or maybe sendPacket is missing/ not added. I'll  keep looking for something to send a packet too the server but tbh i'm not 100% sure what i'm looking for.

     public static void sendPacket(Packet packet) {
            // TODO
    //        FMLClientHandler.instance().sendPacket(packet);
        }

  15. Not going to dig through all of your code, so linking to specific files would help.

    But I dont get the 'merging together' part, seems to me like you're fucking something up if things are getting merged together.

    its not difficult to transfer something over the network and pick it up on the other side.

    found the issue with the vars merging, end up too do something with writing the int to dataStream as a double. which i don't understand why it cause the variables to start to merge together but telling to write as an int fix that issue. Also by merge i meant there should be 8 vars for example 37xA 15yA 100zA  48xT 45yT 113zT 13W 10C. what i was getting was 3715100xA 0yA 1001527zA 0W 0C.

     

    to fix the not saving on restart what i think i need to do is send a packet with the new info too the server. However, i don't know how to send a packet too the local server.

     

    Here is the code just involving the tileEntity and gui

    https://github.com/DarkGuardsman/GSM-Guardsman/blob/master/1.3.1/common/GSM/barrack/TileEntityBarrack.java

    https://github.com/DarkGuardsman/GSM-Guardsman/blob/master/1.3.1/common/GSM/Network/PacketManager.java

    changing line 78 on the above fixed the merge issue

    https://github.com/DarkGuardsman/GSM-Guardsman/blob/master/1.3.1/minecraft/GSMClient/GuiBarrackSettings.java

  16. In 1.2.5 i made a GUI to change settings in my tileEntity. It worked 100% fine saving and recalling the data when i closed/reopened the gui and restart the game. In 1.3.1 it open just fine, i can change the settings, and they keep as long as i do not restart the game. Which i think has too do with the tileEntity not getting the varables client side. I've set up a packet system but can't really tell if its working. I'm going to keep toying with it till i get it working but just in case i don't can someone check out my code and see what is wrong.

    Edit: toyed with it more found the data is making its way to the client but all messed up. However the GUI itself doesn't seem to be saving the data to the server side/keeps vars on client. Which i think i can fix with a packet to the server. Though there is now an issue with the packet data getting all messed up. instead of the 8 separate ints getting assigned to there own varables there merging together.

    Pic of GUI

     

    BarrackSettings.png

     

     

    Code is on gitHub easier to read than to post here gitHub

  17. Spread it over multiple ticks?

    hmm i have it setup to wait 2 ticks every y level it scans which has reduced the lag some. I'm trying to reduce it further so i can scan areas like 40x40x256 without lagging the player at all. though i might break the areas up into 10x10x10 then scan and move to the next area.

  18. Time to do a search of one at a time.  ;)

    already doing one by one search just from the corner of a search box that was expanded from the target location. Was hoping there might be a hidden easier way to get the closest block to a location. My method works just causes a ton of lag if searching anything over 20x20x20 area.

  19. For a mod i'm working on i have a function that scans from a start location out so many blocks. This works fine for getting the first instance of a block in from the corner of the scan area; However, it doesn't work for getting the closest block to a location. How would i program it so it will find the closest block too the location. Which the location is going to be an entity which moves.

     

     

    Also another question how would i find the closest instanceof a tileEntity

    Here is the code i'm using to find it but it doesn't seem to be working

     /**
      * used to find the closest controller
      * @param par1 - x
      * @param par3 - y
      * @param par5 - z
      * @param par7 - range in blocks
      * @return the nearest controller
      */
    	 public TileEntityComp getClosestControler(double par1, double par3, double par5, double par7)
        {
    	 double var9 = -1.0D;
    	    TileEntityComp var11 = null;
    	    List itemList = worldObj.getEntitiesWithinAABB(TileEntityComp.class, this.boundingBox.expand(par7, 4.0D, par7));
    	    for (int var12 = 0; var12 < itemList.size(); ++var12)
    	    {
    	    	TileEntityComp var13 = (TileEntityComp)itemList.get(var12);
    	        double var14 = var13.getDistanceFrom(par1, par3, par5);
    
    	        if ((par7 < 0.0D || var14 < par7 * par7) && (var9 == -1.0D || var14 < var9))
    	        {
    	            var9 = var14;
    	            var11 = var13;
    	        }
    	    }
    
    	    return var11;
        }
     /**
      * used to find the closest controller with an empty slot mainly used to find and add a robot to the controller
      * @param par1 - x
      * @param par3 - y
      * @param par5 - z
      * @param par7 - range in blocks
      * @return the nearest controller block with an empty control slot
      */
     public TileEntityComp getEmptyControler(double par1, double par3, double par5, double par7)
        {
    	 double var9 = -1.0D;
    	    TileEntityComp var11 = null;
    	    List itemList = worldObj.getEntitiesWithinAABB(TileEntityComp.class, this.boundingBox.expand(par7, 4.0D, par7));
    	    for (int var12 = 0; var12 < itemList.size(); ++var12)
    	    {
    	    	TileEntityComp var13 = (TileEntityComp)itemList.get(var12);
    	        double var14 = var13.getDistanceFrom(par1, par3, par5);
    
    	        if ((par7 < 0.0D || var14 < par7 * par7) && (var9 == -1.0D || var14 < var9))
    	        {
    	        	for(int c = 0; c < 4; c++)
    	        	{
    	        	if(var13.BotList[c]==null)
    	        	{
    	        		 var11 = var13;
    	        	}
    	        	}
    	            var9 = var14;		           
    	        }
    	    }
    
    	    return var11;
        }

×
×
  • Create New...

Important Information

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