Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Across all my mods, it seems like all my TESRs are sharing a tile entity instances, that are bound to the same tile entity. The solar panel and wind turbines are sharing one.

For instance, in LabStuff, if more one wind turbine entity is in view, they both start spinning faster, or if one is in no-spin conditions, but the others are, they all start spinning. Regardless of y-position or ability to see the sky.

In DLStuff, if you right click while holding left-control and are holding an unprogrammed d-pad on a laptop, you plug it in to download the os. But if you do it again, you get it back. This also renders a d-pad and cord plugged into the back of the laptop. But if you take the d-pad out, or destroy the block and replace it even, the d-pad is still being rendered.

Any ideas?

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

I'm currently focusing on DLStuff so here you go

github.com/KeeganDeathman/DeathmanLabsStuff

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

So I don't need a separate instance of the model for every instance of the block?

Okay...

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

When I do that I have to change my two render methods and the part fields in my model class to static. Should I be doing this?

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

Because when I remove the variable for the model, I have to start referencing the class directly when it comes time to render.

When I do that it says I have to make renderModel static.

When I do that it says I need to make Screen, Keys, Cord, and Tablet static as well.

Those are the parts BTW.

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

Well that fixed the problem of getting the tablet back.

But in my testing world, both laptops show the tablet. Im not sure if they share the tablet tough. Like you can put it one and take it out another.

The tile entity is located in the tileentity package, duh.

And if you ask me why I have the tablet stored in a custom variable, yet still have a container set up. I used to have a whole different setup for putting the tablet in, so theres where the container comes from. And the other thing, I forgot.

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

Well now the tablet doesn't render, and sometimes I can't get it back from the laptop.

What about the tablet boolean in the TE, should that be static or no?

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

What about the boolean in the tile entity?

Should that be static or no, cause currently I can't get the renderer to get it to be true, even if I put in a tablet

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

The renderer always gets it as false. Therefore the tablet extension doesn't render

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

Oh your right. I think I remember doing this with the power furnace. Off to do that!

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

I fixed it but you have to open the gui to update it.

I tried adding the call to open the gui to the statements in the block where I check to see if I'm taking out or putting in a tablet, but that didnt work.

Help?

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

to be specific I get this error:

java.lang.NullPointerException: Ticking memory connection
at net.minecraft.network.NetHandlerPlayServer.processPlayerBlockPlacement(NetHandlerPlayServer.java:620)

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

If the lcontrol is pressed and your not sneaking when you right click the laptop, it checks to see if it is false(I found a weird bug where i had to change the boolean to reflect if there wan't a tablet, so to render it needs to be false) and if it is it adds the tile entities store tablet item to your inventory and sets the TEs to null. It then sets noTablet to true. If noTablet was true(meaning the port is open) it takes the dPad from you, sets the tablet item, and sets noTablet to false.

I also have a addCraftingToCrafters and releated methods setup in the container, but to call it the GUI must be opened. I can't send a packet because server to client packets don't work because you said I'd never need them.

 

//no lcontrol if statement
else if(!player.isSneaking() && Keyboard.isKeyDown(Keyboard.KEY_LCONTROL))
        	{
        		TileEntityDLLaptop te = (TileEntityDLLaptop)world.getTileEntity(x, y, z);
        		if(!te.noTablet)
        		{
        			player.inventory.addItemStackToInventory(te.tabletItem);
        			te.noTablet = true;
        			te.setTabletItem(null);
        			world.markBlockForUpdate(x, y, z);
            		player.openGui(DLStuff.instance, 0, world, x, y, z);

        			return true;
        		}
        		else if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().isItemEqual(new ItemStack(DLStuff.itemUnProgrammedDPad)))
        		{
        			player.inventory.decrStackSize(player.inventory.currentItem, 1);
        			te.setTabletItem(new ItemStack(DLStuff.itemUnProgrammedDPad));
            		te.noTablet = false;
            		world.markBlockForUpdate(x, y, z);
            		player.openGui(DLStuff.instance, 0, world, x, y, z);
            		return true;
        		}
        		return false;
        	}

 

public void detectAndSendChanges()
    {
        super.detectAndSendChanges();

        for (int i = 0; i < this.crafters.size(); ++i)
        {
            ICrafting icrafting = (ICrafting)this.crafters.get(i);

            if (this.lastTablet != this.tile.isTablet())
            {
            	int tabletInt;
            	if(this.tile.isTablet())
            		tabletInt = 1;
   			 	else
   			 		tabletInt = 0;
                icrafting.sendProgressBarUpdate(this, 0, tabletInt);
            }
        }
        this.lastTablet = tile.isTablet();
    }
    

	@SideOnly(Side.CLIENT)
    public void updateProgressBar(int p_75137_1_, int p_75137_2_)
    {
        if (p_75137_1_ == 0)
        {
        	boolean tablet;
        	if(p_75137_2_ == 0)
        		tablet = true;
        	else
        		tablet = false;
            this.tile.setTablet(tablet);
            System.out.println("Updated client tablet, " + tablet);
        }
    }

	 public void addCraftingToCrafters(ICrafting p_75132_1_)
	 {
		 super.addCraftingToCrafters(p_75132_1_);
		 int tabletInt;
		 if(this.tile.isTablet())
			 tabletInt = 1;
		 else
			 tabletInt = 0;
		 p_75132_1_.sendProgressBarUpdate(this, 0, tabletInt);
	 }

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

Oh, right.

Gonna have to find a work around then,

but wait, if I cant why does it work?

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

  • Author

Oh yeah,

I originally had a whole gui for the drives of the computer but scratched it due to, problems.

Maybe I'll have it so if your holding a tablet, it gets put in. And then if I can get it to be able to call the gui from the tablet if block, I should be good.

[shadow=gray,left][glow=red,2,300]KEEGAN[/glow][/shadow]

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.