Coder Social home page Coder Social logo

Comments (12)

Mr-Rixa avatar Mr-Rixa commented on September 2, 2024 2

@ahjsrhj Well I have very limited knowledge of coding and it was a bit hit and miss. You'll take all responsibility of what might happen if you do this. I recommend taking a manual backup of your world before doing this. (so far I've had no problems 😅)

  1. You'll need to put this source into Mod Sources folder
    (windows location: %userprofile%\Documents\My Games\Terraria\ModLoader\Mod Sources )
    note: it might not exist, you probably need to make the folder!
  2. make sure the extracted folder is called MagicStorage ( Mod Sources\MagicStorage )
  3. File you'll be editing is CraftingGUI.cs
  4. after editing go in-game mod sources menu and hit build+reload.
line code
change 80 private static UIText capacityText;
change 92 private static UIText reqObjText2;

and then add this after line 312

// hacky test fix that didn't lag
if (reqObjText2 == null)
{
	reqObjText2 = new UIText(Language.GetText("LegacyInterface.22"));
}
if (capacityText == null)
{
	capacityText = new UIText(Language.GetText("LegacyInterface.22"));
}

Like I stated earlier this was a bit hit and miss and if anybody has a better or more elegant way to fix it please correct my horrible hacky ways 😅

from magicstorage.

vcepela avatar vcepela commented on September 2, 2024 1

real exception is:

System.NullReferenceException: Object reference not set to an instance of an object
  at Terraria.GameContent.UI.Elements.UIText.InternalSetText (System.Object text, System.Single textScale, System.Boolean large) [0x0002b] in <3e6851c102b24f3c9b5479ac02ec4b1e>:0
  at Terraria.GameContent.UI.Elements.UIText..ctor (System.String text, System.Single textScale, System.Boolean large) [0x00071] in <3e6851c102b24f3c9b5479ac02ec4b1e>:0
  at MagicStorage.CraftingGUI..cctor () [0x000fb] in <0fc9a6de5748445e9737694c16bb02e9>:0

that is getting called from List<Item> items = CraftingGUI.DoCraft(heart, toWithdraw, result); in NetHelper.ReceiveCraftRequest().

CraftingGUI fails to initialize static UIText() because
DynamicSpriteFont.MeasureString thats used in its constructor returns null when running on dedicated server (tested on Linux).

Quick fix was to move static constructors of UIText() to static method CraftingGUI.Initialize() for those two variables:

private static UIText capacityText;
private static UIText reqObjText2;

from magicstorage.

ahjsrhj avatar ahjsrhj commented on September 2, 2024 1

@Mr-Rixa Thank you very much!

from magicstorage.

RunicPixels avatar RunicPixels commented on September 2, 2024

Can confirm the same happening to me.
Also running magic storage 0.4.0.2 and tModLoader 0.10.0.2.
All of the above listed mods as well.

from magicstorage.

blushiemagic avatar blushiemagic commented on September 2, 2024

Does the error have any more details, or is it only that one line?

from magicstorage.

chvolkmann avatar chvolkmann commented on September 2, 2024

Nope, that's all information the console spits out

from magicstorage.

Reprisal35 avatar Reprisal35 commented on September 2, 2024

Having the same issue. Works just fine in single player, doesnt work in multiple player. Throwing the same message as Freemanium. Running the following Mods on tModLoader 0.10.0.1 and Terraria 1.3.5.2.

  • Magic Storage v0.4.1.1
  • Boss Materials Plus v1.1.2
  • Loot Bags v0.10.2
  • Thorium Mod v1.4.0.5

from magicstorage.

Infinoid avatar Infinoid commented on September 2, 2024

I can reproduce this in a new (clean) world without any other mods enabled.

Terraria Server v1.3.5.2 - tModLoader v0.10.1
MagicStorage 0.4.2

The Storage Heart works great, in both single-player and multi-player. The Storage Crafting Interface opens and looks normal in both single-player and multi-player. But in multi-player, the "Craft" button doesn't actually craft anything. It makes the crafting noise, but no crafting happens... the new item doesn't appear and the ingredients aren't subtracted. This happens regardless of whether the recipe required a crafting station. It seems to happen for mana crystals, iron bars, everything.

[I also posted on the forum about this. Apologies for the redundancy.]

from magicstorage.

AssassinsKeeper avatar AssassinsKeeper commented on September 2, 2024

I'm getting it as well. The storage itself works fine, but like everyone else here says it's 1 line, no other errors show up in any logs. It was working just fine for probably about a week, but only a few hours after we went into Hardmode and it's broken.

Terraria Server v1.3.5.2 - tModloader v0,10.1 w/ MagicStorage 0.4.2

from magicstorage.

Mr-Rixa avatar Mr-Rixa commented on September 2, 2024

Quick fix was to ...

Now if I only knew how to do that and build it 😅

Ok I got it built and crafting works on server for now so ain't complaining. 👍

from magicstorage.

ahjsrhj avatar ahjsrhj commented on September 2, 2024

Ok I got it built and crafting works on server for now so ain't complaining. 👍

@Mr-Rixa Can you share this mod? thanks a lot

from magicstorage.

chvolkmann avatar chvolkmann commented on September 2, 2024

@Mr-Rixa If you feel like it, you can even issue a pull request, so others can quickly import your changes.

from magicstorage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.