Jump to content

[1.7.2-10.12.1.1082] My Tile Entities seem to be running each method twice.


navybofus

Recommended Posts

I've been writing new code for the LittleHelpers mod for a few weeks, but just recently I've added another new block with a TileEntity (like all the others). BUT, every time I try to run any method, it's running twice. I used System.out.println(); and every message appears twice. I added the delay variable that I've set and it displays two different values (the delay is random) so I believe that each method within my tile entity is running twice. This is really messing with the functionality of my blocks.

 

What am I doing different? Should I be using @SideOnly? I haven't had to use it so far and all other blocks work just fine. Just updated to 1082, but I only did that because the problem was happening in 1060. HALP!

Link to comment
Share on other sites

@SideOnly won't do anything for you; only use it if you @Override a method that already uses it.

 

Instead use world.isRemote in an if statement or some-such so that you can check if the method is just running once on the client side and once on the server side.

Link to comment
Share on other sites

Maybe Forge has changed, but if seriously don't use @SideOnly unless you now what it does exactly.

 

You should like MoxEmerald said use world.isRemote.

If world.isRemote returns true that means it's on the client side.

If it's returns false then that means it's on the server side.

 

I hope you are experienced enough to figure this out.

Good luck c:

Link to comment
Share on other sites

How did you even notice that it was running twice? Just from the System.out? What do the methods even do?

It might just be that your other tilentities are running twice but you didn't notice. Without complete information I'm just throwing darts.

Something that might be useful is to System.out the words "client" or "server" based on the outcome of world.isRemote.

Link to comment
Share on other sites

I would probably recommend double-checking everything, seeing if there are mistakes or differences between your other tile-entities.

It shouldn't happen if you construct them identically.

 

Like said, you should go ahead and try the "println" methods, but remember one thing check whether it is coming from the client or the server.

It should run twice if it's being called on both the client and the server.

Link to comment
Share on other sites

Should a modder be using @SideOnly ever? NO

Why is your code running twice: It's either two instances, or the client and server are ticking it.

Depends on what 'code' you're talking about.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

I'm often confused by topics like this.  If you are debugging this in eclipse, it has a different window for client and server.  It should be pretty clear if it is running once on each or you are somehow running it twice on one side (highly unlikely).

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

I knew that it was ticking on both sides but when The tile entity called the item storage method I received a stack overflow. I thought this was caused by my method recycling the extra items from an item stack that was too large. I've got everything working but I still get the error if the items inherent max stack size is 16 (eggs).

 

About the @SideOnly, through tutorials I was taught to use this for graphics. Is this no longer the case? I do understand that I was confusing side only and isRemote checks when I wrote this post.

Link to comment
Share on other sites

I'm often confused by topics like this.  If you are debugging this in eclipse, it has a different window for client and server.  It should be pretty clear if it is running once on each or you are somehow running it twice on one side (highly unlikely).

 

I'll have to find out how to setup my perspective this way because mine is merged.

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Slot Bank BNI adalah pilihan tergacor untuk memulai bermain slot judi Online dimuka bumi saat ini. Jika anda mempunyai Bank BNI, Anda berkesempatan mendapatkan Akun Pro atau ID pro untuk bermain slot. Tunggu apa lagi? Segera daftarkan diri anda sekarang dan dapatkan kemewahan menang maxwin di Museumbola.
    • Halo para penggemar slot online! Apakah Anda mencari pengalaman bermain slot yang seru dan menguntungkan? Apakah Anda ingin menikmati slot gacor dari server Thailand sambil melakukan deposit melalui Mandiri dengan kesempatan meraih kemenangan besar? Anda telah sampai di tempat yang tepat! Kami di WINNING303 siap memberikan Anda pengalaman bermain yang mengasyikkan dan menguntungkan. Mengapa Memilih WINNING303? WINNING303 telah dikenal sebagai salah satu platform terbaik untuk bermain slot dengan berbagai keunggulan yang kami tawarkan kepada para pemain kami. Berikut adalah beberapa alasan mengapa Anda harus memilih WINNING303: Slot Gacor dari Server Thailand Kami menyajikan koleksi slot gacor terbaik dari server Thailand yang pastinya akan memberikan Anda pengalaman bermain yang menarik dan menguntungkan. Nikmati berbagai jenis permainan slot dengan tingkat kemenangan yang tinggi dan jackpot yang menarik. Deposit Mudah Melalui Mandiri Kami memahami pentingnya kemudahan dalam bertransaksi bagi para pemain kami. Oleh karena itu, kami menyediakan layanan deposit melalui bank Mandiri, salah satu bank terbesar di Indonesia. Proses depositnya cepat, mudah, dan aman, sehingga Anda dapat langsung memulai petualangan bermain tanpa hambatan. Peluang Maxwin Besar Di WINNING303, kami selalu memberikan peluang untuk meraih kemenangan besar. Dengan berbagai promosi dan bonus menarik yang kami sediakan, Anda memiliki kesempatan untuk memenangkan hadiah-hadiah yang fantastis dan meraih maxwin dalam bermain slot.  
    • SLOT Ratubet77 adalah bocoran slot gacor rekomendasi dari Ratubet77 yang bisa anda temukan di SLOT Ratubet77. Situs SLOT Ratubet77 hari ini yang kami bagikan di sini adalah yang terbaik dan bersiaplah untuk mengalami sensasi tak terlupakan dalam permainan slot online. Temukan game SLOT Ratubet77 terbaik dengan 100 pilihan provider ternama yang dipercaya akan memberikan kepuasan dan kemenangan hari ini untuk meraih x500. RTP SLOT Ratubet77 merupakan SLOT Ratubet77 hari ini yang telah menjadi pilihan utama bagi pemain judi online di seluruh Indonesia. Setiap harinya jutaan pemain memasuki dunia maya untuk memperoleh hiburan seru dan kemenangan besar dalam bermain slot dengan adanya bocoran RTP SLOT Ratubet77. Tidak ada yang lebih menyenangkan daripada mengungguli mesin slot dan meraih jackpot x500 yang menggiurkan di situs SLOT Ratubet77 hari ini yang telah disediakan SLOT Ratubet77. Menangkan jackpot besar x500 rajanya maxwin dari segala slot dan raih kemenangan spektakuler di situs Ratubet77 terbaik 2024 adalah tempat yang menyediakan mesin slot dengan peluang kemenangan lebih tinggi daripada situs slot lainnya. Bagi anda yang mencari pengalaman judi slot paling seru dan mendebarkan, situs bo SLOT Ratubet77 terbaik 2024 adalah pilihan yang tepat. Jelajahi dunia slot online melalui situs SLOT Ratubet77 di link SLOT Ratubet77. DAFTAR SEKARANG DAFTAR SEKARANG DAFTAR SEKARANG
    • I am currently running the 1.20.1 Occultcraft modpack in Curseforge and am having numerous troubles making a mob farm with the apotheosis mod. When trying to modify the stats of the spawners specific stats such as the range, spawn count, and max entities reset to default after every spawn. When the spawners spawn boss mobs with certain attributes, that I'm not sure of, the building it is in explode even with mob griefing turned off. This has happened multiple times with varying sizes for the explosions. I was wonder if there is any way to disable these explosions from happening or disable boss abilities with something in the game. I also wanted to know a fix for the resetting stats on spawners and why this is happening.
    • SLOT Bank BSI adalah pilihan terbaik untuk Anda yang ingin merasakan sensasi bermain slot dengan layanan dari Bank BSI. Dengan keamanan terjamin, beragam pilihan permainan, kemudahan deposit via Bank BSI, dan berbagai bonus menarik, kami siap memberikan Anda pengalaman bermain yang tak terlupakan. Bergabunglah dengan kami sekarang dan mulailah petualangan seru Anda!    
  • Topics

×
×
  • Create New...

Important Information

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