Jump to content

Recommended Posts

Posted

In my mod that I am currently working on, I have a numerous amount of identical blocks which you can texture using a texture pack. However hard coding all of these would be painful at best so I was thinking of looping over a piece of code that would create all of the jsons. How would I go about it?

Posted

Thank you! Now I don't have to have 150 separate JSON files for each of my 50 blocks. One more question though, and that's about how I would add the JSON file from my for loop in my java class?

 

Thank you,

ComputerCraze

Posted

Ok then, thanks. Sorry I've been a bit stubborn, but just to make sure:

 

Could you loop over something in one of your classes that will create all of the variants in the JSON file without typing all of that in? I'm not really looking for compact code, although that would be nice, but I'm looking for something that will create that code right there on startup.

Posted

I don't really understand why a resource pack would come into play here. Let me explain thoroughly:

 

My mod is something that adds a set amount of blocks (50 as default) that are exactly identical to each other except the texture they use. When the game first boots up, these blocks are generated and added into the game using a for loop. What I want to do is create the model files for these blocks inside the code in that same for loop, so that the user can use a texture pack to retexture them as they please.

 

Basically I want to code something that goes into the for loop of my code and generates the JSON files at the same time as the blocks. All I need is the piece of code specifying where the file needs to be written to.

Posted

Okay, hopefully this will help:

 for(i=0;i<50;i++){
String json = "blah blah mymod:blocks/dummyblock1 blah blah"; //text for the jsons, the file names for the textures, models and blocknames are incremented
//add code for adding json
} 

 

If you're asking why, as in why would I want this feature in my mod, it's supposed to be more of a utility mod for mapmakers.

 

If you're asking why, as in it would make no difference whether you put it in there or not, although I might be new to programming Minecraft mods, you do need a JSON and only a JSON to specify the attributes of how the block or item is rendered, correct? So if I want all of the attributes of my 50 blocks to be the same, except for the texture, I would either have to have tons of variants of that single block or add three separate JSON files for each block, correct? So therefore I would just need to loop over a line of code that adds the JSON files for every single block on bootup as an alternative to typing out the code for all 50 of the blocks.

 

If this doesn't make sense, I'm really sorry, but I'm trying to explain this the best I can. Hopefully you'll understand now.

Posted

Do not create the json or dynamic blocks from code.

You can create the data externally once and then ship it out.

Creating models/textures/jsons with code is bad.

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

Posted
  On 5/14/2016 at 9:12 PM, LexManos said:

Do not create the json or dynamic blocks from code.

You can create the data externally once and then ship it out.

 

Question, as I have a 1.7.10 mod that creates blocks at runtime.

 

The reason is that it's actually generating replacement blocks for an uncertain number of blocks, some of which may exist (as they are mod blocks) or may not.  The reason being that I create BlockFalling types for them and give them several runtime generated textures (as in, I have a custom TextureAtlastSprite that takes the original texture and pre-renders an overlay onto it for several variants).

 

For vanilla, it's no problem to handle this once, externally, and ship it.  But due to there being other mods that also ship blocks that I'd want to replace (and due to the overlay nature of the texturing) I did this programmatically and it even handles variant resource packs.  I even supply an API hook for someone to write a plugin that would register additional types.

 

When I do get around to updating to 1.9, how should this be handled instead?  Pre-packaged data?

 

(My number of blocks is small, vanilla would be 3 with another 3-6 from mods, so it's not an undo amount of work to generate the data externally, I'm just trying to understand the advertised method).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Prepackage the data, and in all honesty what you've described doesnt need to do anything special or replace blocks, just listen for block change events and create falling entities.

'Dynamic' mods/block are a BAD IDEA. Do not do them.

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

Posted

You misunderstand my use-case.  I'm replacing stone.  All of it.  Every single block the world as it is generated.

 

And I don't want to merely create falling entities, I am trying to provide a custom level of physics support.  Each block needs to determine whether or not it has support and not just from below.  Hence a custom block class is required.  Which includes 4 variants, each with their own rules for falling and unique texture.  BlockChangeEvent is insufficient.

 

However there are multiple kinds of stone.  Vanilla (gray) stone, basalt, granite, marble, diorite...

 

That's why I asked.  I'm interested in learning the better way.  The reason I went with code-generated textures was three fold:

(Note: this was done prior to 1.8 being supported by Forge, these were the reasons at the time)

1) providing pre-packaged textures does not allow for popular resource packs without explicit support (if a pack changes the texture of vanilla stone, my mod would be unable to utilize it).

2) using a custom model utilizing two render passes resulted in problems with rendering (falling entities and particles would only render the overlay texture, etc.)

3) manually combining an overlay with the base texture was time consuming (I did it with my ores and I regret it; 11 supported ores with 16 metadata texture variants: 176 hand-created textures with no resource pack support).

 

All you have said is "they are bad, don't do them" and I am trying to understand why.  I am trying to learn, so please be informative.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

That is called layers, you can use normal textures layered on top of each other just fine. No need for custom generated code.

It would work JUST FINE with resource packs.

As for the physics shit, you can do the substitution system we have in the registry to take control. And leave it as is.

Generating context, be it blocks, items, textures, whatever is bad because it 1) breaks the data driven design that we at forge, and mojang are trying to do

2) It breaks a lot of functionality when it comes to external modification for resource pack makers, server owners, etc..

3) It makes life hell when trying to manage data and keep worlds/servers clean and synced up

4) It opens up a PLETHORA of potential security issues depending on the routes which you go.

5) It screws with the caching and performance of the re-written rendering pipeline causing major downgrades to end user's experiences.

 

There are A LOT of issues with doing dynamic content like that.

 

If you run into issues, then you can get them addressed. 1) Fixed with multilayer models 2) Fixed with some re-working of the entities nothing hard just needs to be brought it properly. 3) Should never need to be done.

 

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

Posted
  On 5/15/2016 at 6:10 AM, LexManos said:

3) Should never need to be done.

 

Technically speaking, 3 was fixed by:

 

  Quote

That is called layers, you can use normal textures layered on top of each other just fine. No need for custom generated code.

 

That's why I said "these were the reasons behind the decision in 1.7.10."  1.7.10 did not have a concept of layers.  I understand that those issues have been addressed.  Same goes for the particles.

 

Thank you for explaining why dynamic blocks are a bad idea.  I was completely unaware of those problems because you do a terrible job of advertising "doing it this way leads to a better experience, not doing it breaks fucking everything."  Instead people try their best to figure out how to get the effect they want, get something half-working and you come along and go "don't do that."

 

  Quote

As for the physics shit, you can do the substitution system we have in the registry to take control. And leave it as is.

 

Interestingly, said system doesn't actually work as of the most recent information I've seen.  Questionable as to whether or not it works in 1.7.10 perfectly as well.  That is: no one has been able to figure out how to get it to work, even hoped you (or anyone, really) would come along and post a working example, and it's lingered without a reply.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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

    • Temu  bunch of Coupon Codes for Temu  to get FTemuREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!   Temu  coupon codes for New users 100€ Off - acy240173 Temu  discount code for New customers- acy240173 Temu  100€ coupon code- acy240173 what are Temu  codes - acy240173  does Temu  give you €300- acy240173 Yes Verified Temu  coupon code October2025- acy240173 Temu  New customer offer acy240173 Temu  discount code2025 acy240173 100 off coupon code Temu  acy240173 Temu  100 off any order acy240173 100 dollar off Temu  code acy240173 Temu  Coupon Code ( acy240173 ) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173 ) or ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173 ) at checkout!! Temu  coupon code for First Order - {acy240173} Temu  coupon code for New Users- {acy240173} Temu  coupon code for Existing Users- {acy240173} Temu  coupon code 100€ Off- {acy240173} Temu  coupon 30% Off code - {acy240173} - Temu  new user coupon code: acy240173 - Free gift on Temu : acy240173 - Temu  90% discount coupon code: acy240173 - Temu  100€ coupon code for first order: acy240173   Is the Temu  100€ Coupon Legit?  Yes, there are several legit Temu  coupon codes [ acy240173] available for 100€ off. Here are the options you can use: Code [acy240173]: This code provides a 100€ discount legit on your first order when you register and is reported to work effectively during checkout. Code [acy240173]: New users can also use this code to receive a 100€ discount on purchases over €249. Code [acy240173]: This code is available for both new and existing users, offering a 100€ discount on your order. Code [acy240173]: Another option for both new and existing users, this code allows you to save 100€ on your purchase.   Temu  Coupon code 100€ off for this month For October2025, several active Temu  coupon codes can help you save on your purchases: 40% Off Site-Wide: Use code "acy240173" to get 40% off everything. This code is widely used and verified for site-wide discounts on orders over €20. 40€ Off for New Customers: New customers can receive a €20 voucher by downloading the Temu  app and participating in an H5 page game. This voucher can be redeemed using a specific coupon “acy240173”. 40% Off Selected Items: There is also a 40% off coupon “acy240173” available for select items on the Temu  website. Remember to check the specific terms and conditions for each coupon, such as minimum purchase requirements and applicable product categories.   Temu  coupon code 100€ off for new and existing customer Temu  90% OFF promo code "acy240173 " 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 [acy240173] Temu  Coupon code [acy240173 ] for existing users can get up to 50% discount on product during checkout. Temu  Coupon Codes for Existing Customers-[acy240173 ] Temu  values its loyal customers and offers various promo codes, including the Legit Temu  Coupon Code [acy240173 ] or [acy240173 ], which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.   Temu  Coupon Code 100€ Off for all users  There are specific Temu  coupon codes [acy240173] mentioned for South Africa in the provided search results. The results focus on general Temu  coupon codes [acy240173] and discounts, as well as codes for other countries like the Germany, UK, Canada, Mexico, Kuwait, Austria, Italy, Australia, France , Switzerland, Poland, Saudi Arabia, Germany, Sweden, Portugal, New Zealand, UAE, Belgium, Germany, and France.   Temu  Coupon Code 30% Off: acy240173 Temu  Coupon Code 100€ Off: acy240173 Temu  Coupon Code 100€ Off United States : acy240173 Temu  Coupon Code 100€ Off Germany: acy240173 Temu  Coupon Code 100€ Off Sweden : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 50% : acy240173 Temu  Coupon Code 100€ Off United Kingdom : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Italy : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Belgium : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Canada : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Estonia : acy240173 Temu  Coupon Code 100€ Off Switzerland : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon 30% Off + Free Shipping & More There are a bunch of Coupon Codes for Temu  to get FREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173) \ Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!Temu  Coupon Code Mexico : acy240173 Temu  Coupon Code 100€ Off Ireland : acy240173 Temu  Coupon Code 100€ Off Norway: acy240173 Temu  Coupon Code 100€ Off New Zealand : acy240173 Temu  Coupon Code 100€ Off Poland : acy240173 Temu  Coupon Code 100€ Off Serbia : acy240173 Temu  Coupon Code 100€ Off Armenia : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Greece : acy240173 Temu  Coupon Code 100€ Off Japan : acy240173 Temu  Coupon Code 100€ Off Iceland : acy240173 Temu  Coupon Code 100€ Off Bahrain : acy240173 Temu  Coupon Code 100€ Off Philippines : acy240173 Temu  Coupon Code 100€ Off Portugal : acy240173 Temu  Coupon Code 100€ Off Romania: acy240173 Temu  Coupon Code 100€ Off Slovakia : acy240173 Temu  Coupon Code 100€ Off Malta: acy240173 Temu  Coupon Code 100€ Off France  : acy240173 Temu  Coupon Code 100€ Off South Africa : acy240173 Temu  Coupon Code 100€ Off Hungary : acy240173 Temu  Coupon Code 100€ Off Brazil : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 100€ Off Morocco : acy240173 Temu  Coupon Code 100€ Off Kazakhstan : acy240173 Temu  Coupon Code 100€ Off Colombia : acy240173 Temu  Coupon Code 100€ Off Chile : acy240173 Temu  Coupon Code 100€ Off Israel : acy240173 Temu  Coupon Code 100€ Off Qatar: acy240173 Temu  Coupon Code 100€ Off Slovenia : acy240173 Temu  Coupon Code 100€ Off Uruguay : acy240173 Temu  Coupon Code 100€ Off Latvia: acy240173 Temu  Coupon Code 100€ Off Jordan : acy240173 Temu  Coupon Code 100€ Off Ukraine : acy240173 Temu  Coupon Code 100€ Off Moldova : acy240173 Temu  Coupon Code 100€ Off Oman: acy240173 Temu  Coupon Code 100€ Off Mauritius : acy240173 Temu  Coupon Code 100€ Off Republic of Korea : acy240173 Temu  Coupon Code 100€ Off Dominican Republic: acy240173 Temu  Coupon Code 100€ Off Czech Republic : acy240173 Temu  Coupon Code 100€ Off United Arab Emirates : acy240173 Temu  Coupon Code 100€ Off Peru : acy240173 Temu  Coupon Code 100€ Off Azerbaijan : acy240173 Temu  Coupon Code 100€ Off Saudi Arabia : acy240173 Temu  Coupon Code 100€ Off Croatia : acy240173   Conclusion The Temu  Coupon Code 100€ Off "acy240173" provides a significant discount of 100€ for users in Bahrain. This offer is available for both new and existing customers, allowing them to save substantially on their purchases.In addition to the 100€ discount, customers can also enjoy a 50% off on their orders. To redeem this coupon, simply sign up for a Temu  account, add items worth 100€ or more to your cart, and enter the code during checkout to apply the discounts automatically.   FAQs about the 100€ Off Coupon Code Q1: Who can use the 100€ off coupon? A: The coupon is available for both new and existing users, although different codes may apply to each group. Q2: Can multiple coupon codes be used at once? A: Generally, only one coupon code can be applied per transaction. However, some codes may offer bundled benefits. Q3: Do these coupons expire? A: Many Temu  coupons do not have an expiration date, making them convenient for users to redeem at their leisure. Q4: Are there specific conditions for using these coupons? A: Yes, some coupons may require a minimum purchase amount or specific item categories to be eligible for the discount. Q5: How can I find the latest Temu  Coupon Code 100€ Off 100€ Offs? A: Users can check within their account under "Coupons & offers" or look for updates on promotional websites and forums.
    • You could try this script: https://inconnu-plugins.de/tutorial/server-auto-restart
    • I have already tried other versions of MCP, from 2841 to 2860.
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • The official documentation says next to nothing and I have had no success finding reference snippets (e.g. minimap mods and other stuff that involves directly drawing to the screen). Google searches and GPT outputs reference deprecated and/or removed content from older versions. Legends speak of a layered rendering system that also has next to no documentation. Any help is appreciated. Even drawing just a single pixel is enough.
  • Topics

×
×
  • Create New...

Important Information

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