Jump to content

Recommended Posts

Posted

Hey guys, I am trying to send a packet to the client when he enters the server to update his config files. In 1.12.2 it was rather easy with the @Config annotation, however I am having difficulty finding ways to change ForgeConfigSpec values in the packet handler I just made. I am a new programmer and I am not really sure of the most efficient way to do so. 

    final ForgeConfigSpec.BooleanValue overworld_ores;
    final ForgeConfigSpec.BooleanValue nether_ores;
    final ForgeConfigSpec.BooleanValue end_ores;
    
    ServerConfig(final ForgeConfigSpec.Builder builder) {
        
        builder.comment("Note that almost all config changes require a server restart. Dimensional Ore Configuration").push("dimensional_ore");
        
        overworld_ores = builder
                .comment("Spawn ores in the overworld? Default = true")
                .define("overworld_ores", true);
        
        nether_ores = builder
                .comment("Spawn ores in the nether? Default = false")
                .define("nether_ores", false);
        
        end_ores = builder
                .comment("Spawn ores in the end? Default = false")
                .define("end_ores", false);



        builder.pop();

}

 

Here's a snippet of the way I created the values. It writes the default value in the config value, but how do I set the value to something other than the default without manually going to the .toml file and rewriting new ones? Is there any way to do it within the code? Thanks for any help.

 

Posted
2 minutes ago, Squidsword said:

Is there any way to do it within the code?

What's the point of having a configuration file if you want to change the variables within the code itself? Just create a temporary variable for testing purposes and change it to the config version once you have finished.

Posted

I do want the user to be able to customize their own config values as normal. For more details, when the player joins a minecraft server with the mod enabled, I want the client config to change to the servers values so the player can see the changes the server has made. I have config values that can change the damage and armor values of the items in my mod (which a minecraft restart to take effect or so I believe). I'm not sure if there is a simpler way to do this other than sending a packet and changing the values using the packet message. The problem I'm not sure how to change it from within the packet handler because I'm not sure how to set the values from within the code.

Quote

Just create a temporary variable for testing purposes and change it to the config version once you have finished.

I am not sure what you mean by change it to the config version, do you mean set the default value to the packet values from the server in the ForgeConfigSpec builder .define method?

Posted
10 minutes ago, Squidsword said:

do you mean set the default value to the packet values from the server in the ForgeConfigSpec builder .define method?

I was saying that originally because I misunderstood your original intention. So, let's address it. If I understand this right, you want the dedicated server config to match the users own personal config file?

 

I'm not sure why you would need to send a packet from server to client to recognize the change. My understanding of the config file is based in logical sides. There are two kinds of servers: IntegratedServer and DedicatedServer. The server uses the config file adjusted for common and server based code ignoring client (for obvious reasons). The need for updating the specific user is irrelevant since data such as what you are describing would be handled on the server side. If there is something that needs to require Minecraft to restart, then you would need to restart minecraft again to change them. You would need some instance of reflection to override that. Moreover, code would be handled by the server itself leaving only rendering details to be handled by the client making the whole point of a packet update seem quite useless especially since they're final values.

 

I would recommend testing your mod using a server with a different configuration than the user and test it and see what results. If my understanding of config files is right, the server should reign over the user on a multiplayer world and only in a singleplayer world would the user's config be needed.

Posted

You're absolutely right, the config file on the server side will still take effect on all the clients. The only problem is that the players can't see some of the changes in their HUD since their own config file is different. The packet is for a client-side only change that will update the HUDs of the items by registering the proper config values so they will render properly after the restart, as you already said. I am not familiar with how ForgeConfigSpec works or how to change the file values in an efficient way, so I'm having a problem actually changing the values within the code itself.

Posted
1 hour ago, Squidsword said:

The only problem is that the players can't see some of the changes in their HUD since their own config file is different

Then yes, you would sync those values in a packet, except you're not changing the config variables. You're storing the result in wherever you are using the HUD. Basically, when turning on the hud, send a packet to the client from the server side containing the variables stored in the config. Then, store those values inside the HUD to be rendered. This way you are getting the variables from the server rather than the client. That's how I see it anyways.

  • Thanks 1
Posted

Thanks, that sounds like a more efficient solution but I feel like I'm going to have to put a lot of work for my level of programming, I'm not sure if I'll be able to do it or not. 

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

    • Extra 30% off for new and existing customers + Up to $100 % off & more.   Is Temu $100 Off Coupon Legit?  
    • Temu is known for offering incredible savings, and with the updated coupon codes acx211521 or acw373230, you can now save up to $100 on your next purchase! Additionally, Temu provides an affiliate discount of up to 40%—making it easier than ever to get high-quality products at a fraction of the price. Whether you're a new user or returning customer, these codes unlock significant savings, and I'll show you how to make the most out of them. New users at Temu receive a $100 discount on orders over $100 Use the code ["acx211521 & acw373230"] during checkout to get Temu Discount $100 Off For New Users. You n save $100 Off your first order with the coupon code available for a limited time only. The Temu promo code ACX211521 is a fantastic way for existing customers to enjoy significant savings. With a $100 discount, free shipping, and the flexibility to combine with other offers, this code ensures a rewarding shopping experience every time. Earning a Temu coupon code $100 off as a new customer is straightforward and rewarding. The easiest way is to use our $100 off Temu coupon code acx211521 "OR" acw373230 when making your first purchase. Beyond that, Temu often offers various ways for new customers to earn additional coupons. Temu Coupon Code (acx211521) $100 Off for New Users: If you’re new to Temu, you can apply acx211521 to receive $100 off your first purchase. Temu Coupon Code (acx211521) $100 Off for Existing Users: Existing customers aren’t left out! Use the same code to enjoy $100 off on your next order. By using the Temu coupon code (acx211521), you can save $100 off your first order. Temu's extensive range of products includes the latest gadgets, fashion, home decor, and more— all at fantastic prices. codes available in January 2025 Extra 30% off for new and existing customers + Up to $100 % off & more. Temu coupon codes for New users- ["acx211521 & acw373230"] Temu discount code for New customers- ["acx211521 & acw373230"] Temu $100 coupon code- ["acx211521 & acw373230"] what are Temu codes- "acx211521 & acw373230" does Temu give you $100 - ["acx211521 & acw373230"] Yes Verified Temu coupon code October 2024- {"acx211521 & acw373230"} Temu New customer offer {"acx211521 & acw373230"} Temu discount code 2025 {"acx211521 & acw373230"} 100 off coupon code Temu {"acx211521 & acw373230"} Temu 100% off any order {"acx211521 & acw373230"} 100 dollar off Temu code {"acx211521 & acw373230"} Temu coupon $100 Off for New customers There are a number of discounts and deals shoppers n take advantage of with the Teemu Coupon Bundle ["acx211521 & acw373230"]. Temu coupon $100 Off for New customers""acx211521 & acw373230"" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. You n think of it as a supercharged savings pack for all your shopping needs Temu coupon code 80% off – ["acx211521 & acw373230"] Free Temu codes 50% off – [acw373230] Temu coupon $100 Off – ["acx211521 & acw373230"] Temu buy to get £39 – ["acx211521 & acw373230"] Temu 129 coupon bundle – ["acx211521 & acw373230"] Temu buy 3 to get €99 – ["acx211521 & acw373230"] Exclusive $100 Off Temu Discount Code Temu $100 Off Coupon Code : ("acx211521 & acw373230") Temu Discount Code $100 Bundle alt=""data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAAC NiR0NAAAABGdBTUEAANbY1E9YMgAAAu9JREFUeNq9lNtLFGEYx t81AlcLM1RQK2wJTdddu4iIriIPdRFBYEn5J0QHCboNlEgFo65 CAq2LsCw8JLSGa4gSYi1ppitpmWfX1XZ1d93ZndPb+30720wS4 ZUf82PemXme33xzM7Ajq+J0opk4QVQTg4Sfoc3V2jPzdmUHiLq b5XuwrSET3W8sGHIdxeBQHo61HsJXNRl4/WIysgzL/k9kIo4RY013MzA4WoDSZCHKPzg0WzHqLsCwKw/XeizYWJWKLKt1TP8S5laWmFc+tuTwsjJrw+Lj+xAXixAXilCdt 6MyU8jvCcN5uPHegn0NGVh5JnGZdbfKkommzodZKE1ZUZ2zx2W EXYek6gx/Ee00F/2OHGy5w3f6hEgyCk/drtiLwtcCVGIFXbIQxxZjzobKtJVngv0W9LzMxhsXkpj0pFFY2/Egk3+qOm+LS3iJS+bj8E+mXVpRmsjHzcEj+KvzID6vSmHCe8yV oDlL7flmMJkA6KCFdBB8RP1au0U5AsGUAIQJ8rN2A61io9CStn +XVtIlmpthfIme0XIpSXwbh41CE8oqoIqE+kfibMvWi5rE+TqL ZQgA6nBAJWgZhT/XvBKoEgUUFvhLosOWiiRBUEWFQFAiKvg2uHDWKOwZHRdACVMoy goGKehSLlOQMiooggJyWObnb0syS/UahZ39n8MQ3ZBADlGICmy3JeVLMS4tx7i8DKVXPFwkBRWQAgqI dP40x4VdRuHIkk952jsQBHFdpKAEZVc90N2cAe+epTNoToe3jW nQ9SgVzl/zgeiXQFqXYGBCBE8Im8nxxSjcJGrbP4RXh4dpp2sidNSlkFwiZ A6f/SJ/1nIrEUSfBGPTIjgmJS/rcgcX6mtSVqHssSM0/sIRgMBiFCJeggSRVcIrgrASm0M0tw8J0OQSx6lzlrpTBGwVIjF CnOtzi/X3WwPQ3R+C724BBE+UMz0VAadLgAanAAOzSj3Lah3c7g+2hhgi AgxtrtGemXfkb/8bXdk/me2idugAAAAASUVORK5CYII=[/img]"acx211521 & acw373230")"acx211521 & acw373230" Temu $100 Off coupon code for Exsting users : ("acx211521 & acw373230") Temu coupon code $100 Off Temu $100 % OFF promo code ""acx211521 & acw373230"" will save you $100 on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu offers $100 Off coupon code “"acx211521 & acw373230"” for first time users. You n get a $100 bonus plus 30% off any purchase at Temu with the $100 Coupon Bundle at Temu if you sign up with the referral code ["acx211521 & acw373230"] and make a first purchase of $100 or more. Temu coupon code 100 off-{"acx211521 & acw373230"} Temu coupon code -{"acx211521 & acw373230"} Temu coupon code $100 Off-{"acx211521 & acw373230"} kubonus code -{"acx211521 & acw373230"} Are you looking for incredible savings on your next Temu purchase? Look no further! We've got the ultimate Temu coupon code $100 Off that will make your shopping experience even more rewarding. Our exclusive coupon code ["acx211521 & acw373230"] offers maximum benefits for shoppers in the USA, Australia, and European nations. Don't miss out on this opportunity to save big with our Temu coupon $100 Off and Temu 100 off coupon code. Whether you're a new customer or a loyal Temu shopper, we've got you covered with amazing discounts and perks. What Is The Coupon Code For Temu $100 Off? Both new and existing customers can enjoy fantastic benefits by using our $100 coupon code on the Temu app and website. Take advantage of this Temu coupon $100 Off and $100 Off Temu coupon to maximize your savings. Here are some of the incredible offers you can unlock with our coupon code ["acx211521 & acw373230"]: ["acx211521 & acw373230"]: Flat $100 Off on your purchase ["acx211521 & acw373230"]: $100 coupon pack for multiple uses ["acx211521 & acw373230"]: $100 flat discount for new customers ["acx211521 & acw373230"]: Extra $100 promo code for existing customers ["acx211521 & acw373230"]: $100 coupon for USA/Australia users Temu Coupon Code $100 Off For New Users In 2025 New users can reap the highest benefits by using our coupon code on the Temu app. Don't miss out on this Temu coupon $100 Off and Temu coupon code $100 Off opportunity. Here are the exclusive offers for new customers: ["acx211521 & acw373230"]: Flat $100 discount for new users ["acx211521 & acw373230"]: $100 coupon bundle for new customers ["acx211521 & acw373230"]: Up to $100 coupon bundle for multiple uses ["acx211521 & acw373230"]: Free shipping to 68 countries ["acx211521 & acw373230"]: Extra 30% off on any purchase for first-time users How To Redeem The Temu Coupon $100 Off For New Customers? Redeeming your Temu $100 coupon is quick and easy. Follow this step-by-step guide to use the Temu $100 Off coupon code for new users: Download the Temu app or visit their website Create a new account Browse through the wide selection of products Add your desired items to the cart Proceed to checkout Enter the coupon code ["acx211521 & acw373230"] in the designated field Apply the code and watch your total decrease by $100 Complete your purchase and enjoy your savings! Temu Coupon $100 Off For Existing Customers Existing users can also enjoy great benefits by using our coupon code on the Temu app. Take advantage of these Temu $100 coupon codes for existing users and Temu coupon $100 Off for existing customers free shipping offers: ["acx211521 & acw373230"]: $100 extra discount for existing Temu users ["acx211521 & acw373230"]: $100 coupon bundle for multiple purchases ["acx211521 & acw373230"]: Free gift with express shipping all over the USA/Australia ["acx211521 & acw373230"]: Extra 30% off on top of the existing discount ["acx211521 & acw373230"]: Free shipping to 68 countries How To Use The Temu Coupon Code $100 Off For Existing Customers? Using your Temu coupon code $100 Off as an existing customer is simple. Follow these steps to apply your Temu coupon $100 Off code: Open the Temu app or visit their website Log in to your existing account Add your desired products to your cart Go to the checkout page Locate the promo code field Enter the coupon code ["acx211521 & acw373230"] Click "Apply" to see your $100 discount Complete your purchase and enjoy your savings! Latest Temu Coupon $100 Off First Order Customers can get the highest benefits by using our coupon code during their first order. Don't miss out on these Temu coupon code $100 Off first order, Temu coupon code first order, and Temu coupon code $100 Off first time user offers: ["acx211521 & acw373230"]: Flat $100 discount for the first order ["acx211521 & acw373230"]: $100 Temu coupon code for the first order ["acx211521 & acw373230"]: Up to $100 coupon for multiple uses ["acx211521 & acw373230"]: Free shipping to 68 countries ["acx211521 & acw373230"]: Extra 30% off on any purchase for the first order How To Find The Temu Coupon Code $100 Off? Looking for the latest Temu coupon $100 Off or browsing Temu coupon $100 Off Reddit threads? We've got you covered with some insider tips on finding the best deals: Sign up for the Temu newsletter to receive verified and tested coupons directly in your inbox. Follow Temu's social media pages to stay updated on the latest coupons and promotions. Visit trusted coupon sites (like ours!) to find the most recent and working Temu coupon codes. By following these steps, you'll never miss out on amazing Temu discounts and offers! Is Temu $100 Off Coupon Legit? You might be wondering, "Is the Temu $100 Off Coupon Legit?" or "Is the Temu 100 off coupon legit?" We're here to assure you that our Temu coupon code ["acx211521 & acw373230"] is absolutely legitimate. Any customer can safely use our Temu coupon code to get $100 Off on their first order and subsequent purchases. Our code is not only legit but also regularly tested and verified to ensure it works flawlessly for all our users. What's more, our Temu coupon code is valid worldwide and doesn't have an expiration date, giving you the flexibility to use it whenever you're ready to make a purchase.  
    • Der Gutscheincode für 100€ Rabatt auf Temu lautet [acx211521] [acx211521] und bietet erhebliche Einsparungen bei einer breiten Produktpalette, darunter Mode, Elektronik und Haushaltswaren. Wenn Sie diesen Code [acx211521] an der Kasse eingeben, können Sie einen großzügigen Rabatt auf Ihre Bestellung erhalten, was Ihr Einkaufserlebnis erschwinglicher macht. Lesen Sie unbedingt die Bedingungen des Codes, um sicherzustellen, dass er für Ihren Einkauf gilt, und maximieren Sie Ihre Einsparungen bei Temu!  Acx211521 ist ein gültiger Temu-Gutscheincode für Deutschland, mit dem Sie 100 € Rabatt und 30 % Rabatt auf Ihre erste Bestellung erhalten. Dieser TEMU-Gutscheincode „acw373230“ für Deutschland mit 40 € Rabatt bietet einen beeindruckenden anfänglichen Rabatt von 100 € und 90 % Rabatt auf den Kauf jedes Artikels für neue und bestehende Kunden. Hier ist eine kurze Antwort zum Finden eines Temu-Gutscheincodes in Deutschland: • Verfügbarer Code: Verwenden Sie acx211521 für einen Rabatt auf Temu in Deutschland. • Offizielle Quellen: Besuchen Sie die Temu-Website oder -App für exklusive Angebote. • Newsletter: Abonnieren Sie Temus E-Mails für die neuesten Codes. • Soziale Medien: Folgen Sie Temu auf sozialen Plattformen für Sonderaktionen. • Empfehlungsprogramme: Laden Sie Freunde ein, Temu beizutreten und Rabattcodes zu erhalten. Geben Sie acx211521 an der Kasse ein, um Ihre Ersparnisse zu genießen.   So können Sie den 100-€-Rabatt-Gutscheincode [ACX211521] [acw373230] von Temu optimal nutzen, egal ob Sie ein neuer oder bestehender Benutzer sind! Temu ist bekannt für seine unschlagbaren Preise, schnelle Lieferung und Rabatte von bis zu 90 %. Um einen Rabatt auf Ihre erste Bestellung bei Temu zu erhalten, verwenden Sie einen der folgenden Empfehlungscodes: • Acx211521 • acw373230 Durch die Anwendung dieser Empfehlungscodes beim Bezahlvorgang können Neukunden besondere Rabatte wie 100 € Rabatt, kostenlosen Versand oder andere exklusive Angebote genießen. Geben Sie den Code einfach ein, wenn Sie beim Bezahlvorgang auf der Temu-Website oder -App dazu aufgefordert werden, um Ihre Ersparnisse freizuschalten. Schauen Sie sich unbedingt die neuesten Aktionen von Temu an, um weitere Angebote zu erhalten! Vorteile der Verwendung des Temu-Gutscheincodes [ACX211521] [acw373230],   • Bis zu 90 % Rabatt auf ausgewählte Artikel durch exklusive neue Angebote von Temu. • Pauschal 60 % Rabatt auf bereits reduzierte Produkte auf der gesamten Website.   • Zusätzliche 30 % Rabatt auf Ihren Gesamteinkauf mit dem Temu-Rabattcode.   Ja, es gibt einen Temu-Gutscheincode für Kunden aus Deutschland! Sie können den exklusiven Code [acx211521] verwenden, um einen großzügigen Rabatt auf Ihre Einkäufe zu erhalten. Dieser Gutschein bietet 100 € Rabatt plus 30 % Rabatt und ist damit eine großartige Gelegenheit, bei einer großen Auswahl an Produkten von Temu deutlich zu sparen. Geben Sie beim Bezahlvorgang einfach [acx211521] [acw373230] ein, um dieses Angebot zu nutzen und Ihr Einkaufserlebnis zu verbessern. Lassen Sie sich diese Ersparnisse nicht entgehen!   Der Gutscheincode für 100 € Rabatt bei Temu lautet [acx211521] und bietet erhebliche Ersparnisse bei einer großen Auswahl an Produkten, darunter Mode, Elektronik und Haushaltswaren. Wenn Sie diesen Code [acx211521] beim Bezahlvorgang eingeben, können Sie einen großzügigen Rabatt auf Ihre Bestellung erhalten und so Ihr Einkaufserlebnis erschwinglicher gestalten. Überprüfen Sie unbedingt die Bedingungen des Codes, um sicherzustellen, dass er für Ihren Einkauf gilt, und maximieren Sie Ihre Ersparnisse bei Temu!   Das 100-€-Gutscheinpaket bei Temu ist ein Werbeangebot, das Benutzern erhebliche Ersparnisse bei ihren Einkäufen bietet. Durch Eingabe des Codes [acx211521] oder [acx211521] in der Temu-App können Benutzer auf eine Sammlung von Rabattgutscheinen zugreifen, die auf verschiedene Artikel in ihrem Warenkorb angewendet werden können.   Dieses Paket enthält normalerweise mehrere Gutscheine mit unterschiedlichen Rabattschwellen, z. B. 15 € Rabatt auf Bestellungen über 40 €, 20 € Rabatt auf Bestellungen über 60 € usw., sodass Benutzer ihre Ersparnisse je nach Gesamtbestellwert maximieren können.   So können Sie den Temu-Gutscheincode für 100 € Rabatt [ACX211521] [acw373230] optimal nutzen, egal ob Sie ein neuer oder bestehender Benutzer sind! Temu ist bekannt für seine unschlagbaren Preise, schnelle Lieferung und Rabatte von bis zu 90 %.   Vorteile der Verwendung des Temu-Gutscheincodes [ACX211521] [acw373230],   • Bis zu 90 % Rabatt auf ausgewählte Artikel durch exklusive neue Temu-Angebote.   • Pauschal 60 % Rabatt auf bereits reduzierte Produkte auf der gesamten Site.   • Zusätzliche 30 % Rabatt auf Ihren Gesamteinkauf mit dem Temu-Rabattcode.   [acx211521] [acw373230], an der Kasse, um dieses Angebot zu nutzen und Ihr Einkaufserlebnis zu verbessern. Lassen Sie sich diese Ersparnisse nicht entgehen!   Am einfachsten ist es, unseren 100 € Rabatt Temu-Gutscheincode ACX211521 „OR“ [acw373230], bei Ihrem ersten Einkauf zu verwenden. Darüber hinaus bietet Temu Neukunden oft verschiedene Möglichkeiten, zusätzliches Geld zu verdienen   ACX211521 „OR“ [acw373230],: Neue Benutzer können bis zu 80 % extra Rabatt erhalten. • ACX211521 „OR“ ACX211521: Erhalten Sie satte 100 € Rabatt auf Ihre erste Bestellung! • ACX211521 „OR“ [acw373230],: Erhalten Sie 20 % Rabatt auf Ihre erste Bestellung; kein Mindestumsatz erforderlich. • ACX211521 „OR“ ACX211521: Erhalten Sie zusätzlich zu bestehenden Rabatten weitere 15 % Rabatt auf Ihre erste Bestellung. • ACX211521 „OR“ [acw373230],: Temu UK Genießen Sie 100 € Rabatt auf Ihren gesamten ersten Einkauf. Mit unserem exklusiven Temu-Gutscheincode 100 € Rabatt wird das Einkaufen bei Temu jetzt noch spannender. Dieses unglaubliche Angebot soll Ihnen erhebliche Einsparungen bei Ihrem nächsten Einkauf ermöglichen, egal ob Sie Neu- oder Bestandskunde sind. Für Kunden in den USA, Kanada und europäischen Ländern bietet der Gutscheincode ACX211521 „OR“ ACX211521 maximale Vorteile.   Mit dem Temu-Gutscheincode {acx211521} erhalten Sie 100 € Rabatt. [acw373230] Dieses exklusive Angebot gilt für Bestandskunden und kann für eine Ermäßigung von 100 € auf Ihren Gesamteinkauf genutzt werden. Geben Sie beim Bezahlvorgang den Gutscheincode {acx211521} ein, um den Rabatt zu erhalten.    
    • I have recently released my first ever Minecraft mod, it adds an overpowered sword with an insane grind to craft. More info on the CurseForge page: https://www.curseforge.com/minecraft/mc-mods/destroyer-of-worlds   I'd love to hear your thoughts.
    • Hi there, I am trying to run a forge server using debian with no mods in it and have been able to follow all the steps to setup the server, I am on java version 17 and run time environment 17, I have accepted the eula etc... but when I run I get this error: https://pastebin.com/h3CTQUsp Any help would be appreciated.
  • Topics

×
×
  • Create New...

Important Information

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