Jump to content

Please!! Help with inventory gui


opssemnik

Recommended Posts

Hi guys The mod which im trying to make it for smp uses a new inventory so on client side i use

the void renderInvBlocks and use onTickInGame but i dont know ho to make for smp here is the code for client (only these things)

 

 

package net.minecraft.src;

import net.minecraft.src.forge.DimensionManager;

import net.minecraft.src.forge.NetworkMod;

import java.util.Map;
import java.util.Random;
import net.minecraft.server.MinecraftServer


public class mod_Lord extends NetworkMod 
{
    private static World world;
    private static World nbtWorld;
    private static long clock;
    private boolean cloudPara = false;
    private Random rand = new Random();
    private float zLevel = -90.0F;
    private int updateCounter;
    


        PlayerAPI.register("Lord", PlayerBaseLord.class);
        DimensionManager.registerDimension(4, dim, true);
        
   
        ModLoader.setInGameHook(this, true, false);
    }

    
    public void renderInvBlock(RenderBlocks var1, Block var2, int var3, int var4)
    {
        if (var4 == renderID)
        {
            Tessellator var5 = Tessellator.instance;
            var5.startDrawingQuads();
            var5.setNormal(0.0F, -1.0F, 0.0F);
            var1.overrideBlockTexture = 49;
            var1.drawCrossedSquares(var2, var3, -0.5D, -0.5D, -0.5D);
            var5.draw();
            var1.overrideBlockTexture = -1;
            var2.setBlockBoundsForItemRender();
            GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
            var5.startDrawingQuads();
            var5.setNormal(0.0F, -1.0F, 0.0F);
            var1.renderBottomFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(0, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(0.0F, 1.0F, 0.0F);
            var1.renderTopFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(1, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(0.0F, 0.0F, -1.0F);
            var1.renderEastFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(2, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(0.0F, 0.0F, 1.0F);
            var1.renderWestFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(3, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(-1.0F, 0.0F, 0.0F);
            var1.renderNorthFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(4, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(1.0F, 0.0F, 0.0F);
            var1.renderSouthFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(5, var3));
            var5.draw();
            GL11.glTranslatef(0.5F, 0.5F, 0.5F);
        }
    }

    
    public boolean onTickInGame(float var1, Minecraft var2)
    {
        
                if (!world.isRemote && var2.currentScreen instanceof GuiInventory)
                {
                    var2.displayGuiScreen(new GuiInventoryMoreSlots(var2.thePlayer));
                }

 

 

 

Link to comment
Share on other sites

Hi guys The mod which im trying to make it for smp uses a new inventory so on client side i use

the void renderInvBlocks and use onTickInGame but i dont know ho to make for smp here is the code for client (only these things)

 

 

package net.minecraft.src;

import net.minecraft.src.forge.DimensionManager;

import net.minecraft.src.forge.NetworkMod;

import java.util.Map;
import java.util.Random;
import net.minecraft.server.MinecraftServer


public class mod_Lord extends NetworkMod 
{
    private static World world;
    private static World nbtWorld;
    private static long clock;
    private boolean cloudPara = false;
    private Random rand = new Random();
    private float zLevel = -90.0F;
    private int updateCounter;
    


        PlayerAPI.register("Lord", PlayerBaseLord.class);
        DimensionManager.registerDimension(4, dim, true);
        
   
        ModLoader.setInGameHook(this, true, false);
    }

    
    public void renderInvBlock(RenderBlocks var1, Block var2, int var3, int var4)
    {
        if (var4 == renderID)
        {
            Tessellator var5 = Tessellator.instance;
            var5.startDrawingQuads();
            var5.setNormal(0.0F, -1.0F, 0.0F);
            var1.overrideBlockTexture = 49;
            var1.drawCrossedSquares(var2, var3, -0.5D, -0.5D, -0.5D);
            var5.draw();
            var1.overrideBlockTexture = -1;
            var2.setBlockBoundsForItemRender();
            GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
            var5.startDrawingQuads();
            var5.setNormal(0.0F, -1.0F, 0.0F);
            var1.renderBottomFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(0, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(0.0F, 1.0F, 0.0F);
            var1.renderTopFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(1, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(0.0F, 0.0F, -1.0F);
            var1.renderEastFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(2, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(0.0F, 0.0F, 1.0F);
            var1.renderWestFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(3, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(-1.0F, 0.0F, 0.0F);
            var1.renderNorthFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(4, var3));
            var5.draw();
            var5.startDrawingQuads();
            var5.setNormal(1.0F, 0.0F, 0.0F);
            var1.renderSouthFace(var2, 0.0D, 0.0D, 0.0D, var2.getBlockTextureFromSideAndMetadata(5, var3));
            var5.draw();
            GL11.glTranslatef(0.5F, 0.5F, 0.5F);
        }
    }

    
    public boolean onTickInGame(float var1, Minecraft var2)
    {
        
                if (!world.isRemote && var2.currentScreen instanceof GuiInventory)
                {
                    var2.displayGuiScreen(new GuiInventoryMoreSlots(var2.thePlayer));
                }

 

 

 

Maybe... IDK, learn Java? I can see a LOT of syntax errors in this file. You are placing methods outside classes and stuff like that, things Java doesn't like at all...

Second of all, the server shouldn't use GUI's at all; GUI's are Client only.

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.



×
×
  • Create New...

Important Information

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