Jump to content

Recommended Posts

Posted

Problem 1 [solved]

 

  Reveal hidden contents

 

 

Problem 2: New problem...I have this coding for my mob spawners

TileEntityMobSpawner ttsnimspawner = (TileEntityMobSpawner)world.getTileEntity(i + 6, j + 11, k + 6);
	ttsnimspawner.func_145881_a().setEntityName("Skeleton");

 

When a second structure spawns in, it seems to error on this code. It works fine when there's one structure, but I flew to a second structure and it errored and crashed. I don't understand why... Also, how would I go about adding loot to the chests I have in my dungeon?

Posted

O...kay...I'm not sure where to even begin with checking for that...Sounds like a great idea, though. Could you link me to a tutorial or explain how to do so? I've tried looking for one, but can't find any.

Posted

Three things:

-You are looking for stained_hardened_clay, i think.

-When generating custom biome specific things, do it in the biome decorating method.

-You don't need to create a new world generator in each iteration of a for loop.

Posted

If I'm interpreting this correctly, couldn't you just reduce its spawn rate by only making it generate X amount of the time? For example, if you wanted it to generate a quarter as much then you could generate a random number between one and four and only have it generate if the number is four? Alternatively, you could make the structure generate a specific block in the dead center of it, and each generation make sure there isn't one of those blocks within X blocks of the new generation (via 3 stacked for loops)

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

width=174 height=100http://i.imgur.com/ghgWmA3.jpg[/img]

Posted

Unfortunately, that's what I tried to do. The random number generates a random number between 0.0 and 1.0. It's set to 0.9 (10% of the time, it's about as low as I can set it). It runs about 32 times per chunk, though...it's almost guaranteed to be set at least once. As for checking for coordinates and such, I don't have the slightest idea how to do that. What I would like to do is make it spawn every 300 blocks (like - 0, 300, 600, 900) then run some random code to then tell it "Okay, at these coordinates run a random number to determine which structure to generate there". I have no idea how to do that, though. I've tried some things, but nothing has worked, so I'm not sure what to do.

Posted

Is this beyond what someone is willing to help with? Cause I really can't find any information on doing this...Again, I'd like to do a sort of "Twilight Forest" thing where the structures spawn in specific locations. Like, maybe every 300 blocks or so (so on like 0,0, then 0,300, and 0,-300, and 300,0, etc.)

Posted

You can check if one number (here: current position) is a multiple of another number (here: your desired spacing of 300 blocks) with the modulo operator. Since the coordinates you pass to generateSurface() are already multiplied by 16 this will only work for spacings that are multiples of 16. E.g.:

private void generateSurface(World world, Random random, int x, int z)
  if ((x % 320 == 0) && (z % 320 ==0)) {
    // set chunkX etc.
    new Castle.generate(world, random, chunkX, chunkY, chunkZ);
  }
}

 

 

If you want it to work for spacings that are not a multiple of 16 then checking whether the current chunk contains a desired position becomes a bit more complicated, and to have it work correctly for coordinates <=0 you either need to handle that case extra or use a division that "rounds down".  The code below uses the latter.

 

So, for e.g. x=0, 200, 400, 600, ... and z=0, 100, 200, 300, ...:

 

/**
* 
* @param n
* @param d
* @return n/d rounded towards -infinity
*/
private static int floordiv(int n, int d) {
return n/d - ( ( n % d != 0 ) && ( (n<0) ^ (d<0) ) ? 1 : 0 );
}

private boolean chunkContainsASpawnPosition(int x, int spacing) {
final int chunksize = 16;
int lowerEdge = floordiv(x-1, spacing);     // without the -1 we'd miss cases where x is a multiple of spacing
int upperEdge = floordiv(x+chunksize -1, spacing);
return upperEdge - lowerEdge == 1;
}

private void generateSurface(World world, Random random, int x, int z)
  if (chunkContainsASpawnPosition(x, 200) && chunkContainsASpawnPosition(z, 100)) {
    // set chunkX etc.
    new Castle.generate(world, random, chunkX, chunkY, chunkZ);
  }
}

 

 

The spawning positions aren't exact multiples of the "spacing" variable but rather the position of the chunk which contains the desired position, i.e. here: z=96, 192, 288, 400, 496, ...

But since you are adding in some random offsets anyway I hope that's ok.

 

Posted

Wow! Thanks a lot! This helps a ton!

 

EDIT: New problem...I have this coding for my mob spawners

TileEntityMobSpawner ttsnimspawner = (TileEntityMobSpawner)world.getTileEntity(i + 6, j + 11, k + 6);
	ttsnimspawner.func_145881_a().setEntityName("Skeleton");

 

When a second structure spawns in, it seems to error on this code. It works fine when there's one structure, but I flew to a second structure and it errored and crashed. I don't understand why... Also, how would I go about adding loot to the chests I have in my dungeon?

Posted

I don't know about the spawners; your code (preceded by "world.setBlock(..., Blocks.mob_spawner)) worked for me.

Maybe you could check whether getTileEntity() returns null, and if so use world.getBlock to see what's in that location.

 

 

For chests:

        world.setBlock(i, j, k, Blocks.chest);
        TileEntityChest chest = (TileEntityChest) world.getTileEntity(i, j, k);
        if (chest == null) {
                System.err.printf("TileEntityChest is null!?!\n");
        } else {
                for (int idx = 0; idx < 4; idx++) {
                        ItemStack stack = new ItemStack(Items.diamond_axe);
                        stack.addEnchantment(Enchantment.efficiency, idx+1);
                        stack.addEnchantment(Enchantment.unbreaking, 10);
                        chest.setInventorySlotContents(idx, stack);
                }
        }

 

 

Posted

Yeap...turns out a jungle biome spawned inside of my structure...so a leaf block replaced the spawner...is there any way to prevent that from happening? I mean, it works now and stuff, but I'd like my dungeons to not be destroyed by the biomes around them.

Posted

The only way of doing this is subscribing to the PopulateChunkEvent.Post event and do your dungeon generation there.

Here's an example:

https://github.com/SanAndreasP/EnderStuffPlus/blob/master/java/de/sanandrew/mods/enderstuffplus/world/EnderStuffWorldGenerator.java#L27-L38

 

Also please note that if you think it is registered with the TERRAIN_GEN_BUS, it isn't, it is with the EVENT_BUS!

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Posted

I'm a little confused...so I would need to run my world generation using EVENT_BUS instead if I added that into it? I can see your generation there is doing both the PopulateChunkEvent and the world generation, so that's why it confused me. Cause right now my world generator is just:

GameRegistry.registerWorldGenerator(new CraftyGirlsWorldGeneration(), 1);

Would that mean I have to make it this instead?

MinecraftForge.EVENT_BUS.register(new CraftyGirlsWorldGeneration());

Posted

You can use a higher number in your registerWorldGenerator so your structures generate after trees and such. I think that might help, but only if you destroy foliage and trees that are in your way.

Posted
  On 5/1/2014 at 8:25 PM, SureenInk said:

I'm a little confused...so I would need to run my world generation using EVENT_BUS instead if I added that into it? I can see your generation there is doing both the PopulateChunkEvent and the world generation, so that's why it confused me. Cause right now my world generator is just:

GameRegistry.registerWorldGenerator(new CraftyGirlsWorldGeneration(), 1);

Would that mean I have to make it this instead?

MinecraftForge.EVENT_BUS.register(new CraftyGirlsWorldGeneration());

 

Keep the EVENT_BUS if you are doing a worldgen.

Developer of MechanicalCraft.

 

Sadly not available to public yet :(

Posted
  On 5/1/2014 at 8:25 PM, SureenInk said:

I'm a little confused...so I would need to run my world generation using EVENT_BUS instead if I added that into it? I can see your generation there is doing both the PopulateChunkEvent and the world generation, so that's why it confused me. Cause right now my world generator is just:

GameRegistry.registerWorldGenerator(new CraftyGirlsWorldGeneration(), 1);

Would that mean I have to make it this instead?

MinecraftForge.EVENT_BUS.register(new CraftyGirlsWorldGeneration());

 

You actually do both, if you use the IWorldGenerator and the PopulateChunkEvent.

 

You could also try sequituri's suggestion. Seems easier (if it works) than fiddling with events.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

  Quote

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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

    • coupon, shopping on the app or website becomes more affordable and rewarding. acs670886 – Enjoy a flat $100 discount on any order.   acs670886 – Unlock a $100 coupon pack usable across multiple purchases.   acs670886 – Exclusive $100 discount just for new users.   acs670886 – Extra $100 promo code for loyal, returning customers.   acs670886 – $100 coupon specially tailored for users in the USA and Canada.   Temu Coupon Code $100 Off For New Users In 2025 If you’re a new Temu user, you can receive the most benefits by using our verified code. This Temu coupon $100 off combined with the Temu coupon code $100 off ensures a budget-friendly shopping experience. acs670886 – Flat $100 discount on your first-ever order.   acs670886 – $100 coupon bundle designed exclusively for new customers.   acs670886 – Up to $100 coupon bundle usable across different purchases.   acs670886 – Benefit from free shipping to 68 countries globally.   acs670886 – An extra 30% discount for first-timLooking for the best deals online? Our Temu coupon code $100 off is exactly what you need to unlock maximum savings. Use the Temu code acs670886 to get exclusive discounts for users across the USA, Canada, and Europe. This is your chance to shop smart and save big. Whether you are searching for a Temu coupon $100 off or a Temu 100 off coupon code, we’ve got you covered with verified offers that work every time. What Is The Coupon Code For Temu $100 Off? Both new and existing Temu customers can enjoy exciting savings when they use our exclusive Temu coupon $100 off. With the $100 off Temue users on any item.   How To Redeem The Temu Coupon $100 Off For New Customers? To use the Temu $100 coupon and claim the Temu $100 off coupon code for new users, follow these steps: Download and install the Temu app or visit the website.   Sign up as a new user with your email or phone number.   Add your favorite products to the cart.   Go to checkout and paste the coupon code acs670886 in the promo code box.   Your discount will be automatically applied, and you can enjoy your savings.   Temu Coupon $100 Off For Existing Customers Even existing customers can reap the rewards with our exclusive code. Use the Temu $100 coupon codes for existing users and benefit from Temu coupon $100 off for existing customers free shipping without missing out. acs670886 – An additional $100 off for loyal Temu users.   acs670886 – Receive a $100 coupon bundle for several orders.   acs670886 – Free gift and express shipping in the USA and Canada.   acs670886 – Enjoy 30% off on top of any running offer.   acs670886 – Free global shipping to 68 countries.   How To Use The Temu Coupon Code $100 Off For Existing Customers? To make the most of the Temu coupon code $100 off and Temu coupon $100 off code as a returning customer: Open the Temu app or website and log in.   Browse through the products and add items to your cart.   At checkout, enter acs670886 in the promo section.   Review your updated total reflecting the applied discount.   Complete your purchase and enjoy amazing savings.   Latest Temu Coupon $100 Off First Order Your first order with Temu just got even better! The Temu coupon code $100 off first order, Temu coupon code first order, and Temu coupon code $100 off first time user are here to elevate your shopping experience. acs670886 – Flat $100 off the first purchase.   acs670886 – Verified $100 Temu coupon code for initial orders.   acs670886 – Use this code to get a $100 coupon for multiple uses.   acs670886 – Free shipping included for first orders in 68 countries.   acs670886 – Additional 30% off on your first transaction.   How To Find The Temu Coupon Code $100 Off? Wondering where to grab the best Temu coupon $100 off or track the Temu coupon $100 off Reddit discussions? Simply sign up for Temu’s newsletter for insider updates. You can also follow Temu on social media for limited-time offers and verified codes. For the latest and working codes, visit trusted coupon websites like ours for real-time updates. Is Temu $100 Off Coupon Legit? Yes, the Temu $100 Off Coupon Legit claim is absolutely true. Our code acs670886 is thoroughly tested and verified. You can safely use it for your first order and even on future ones without any concerns. The Temu 100 off coupon legit status means the code is valid worldwide and doesn’t expire anytime soon. How Does Temu $100 Off Coupon Work? The Temu coupon code $100 off first-time user and Temu coupon codes 100 off allow you to receive up to $100 in discounts when making a purchase on Temu. It works by applying the code acs670886 during checkout, which instantly reduces your payable total. Whether you're a first-time or repeat buyer, this coupon code brings significant value to your orders. How To Earn Temu $100 Coupons As A New Customer? To earn your Temu coupon code $100 off and enjoy the 100 off Temu coupon code benefits, all you need to do is sign up as a new user. Then, enter our verified code acs670886 at checkout to get instant access to your $100 discount, free shipping, and other benefits designed specifically for first-time shoppers. What Are The Advantages Of Using The Temu Coupon $100 Off? Using the Temu coupon code 100 off and Temu coupon code $100 off brings amazing shopping perks: $100 off on your very first Temu order   $100 coupon bundle for ongoing purchases   Up to 70% discount on selected trending items   Extra 30% discount for returning users   Up to 90% savings on exclusive deals   Free welcome gift for new customers   Complimentary global shipping to 68 nations   Temu $100 Discount Code And Free Gift For New And Existing Customers There’s more than just savings when using our Temu $100 off coupon code and $100 off Temu coupon code. You’ll also receive valuable gifts and extended discounts. acs670886 – $100 off your very first order on Temu.   acs670886 – Extra 30% off on any purchase.   acs670886 – Complimentary gift for new shoppers.   acs670886 – Access to 70% off selected items on the app.   acs670886 – Free gift and free delivery in 68 nations.   Pros And Cons Of Using The Temu Coupon Code $100 Off This Month Explore the highlights and considerations when using the Temu coupon $100 off code and Temu 100 off coupon: Pros: Verified and easy to apply   Valid for new and existing customers   Flat $100 discount on all orders   Global shipping with no extra cost   Up to 30% extra off even on discounted items   Cons: Limited to one use per account   May not stack with other special offers   Terms And Conditions Of Using The Temu Coupon $100 Off In 2025 Before using the Temu coupon code $100 off free shipping and latest Temu coupon code $100 off, please review the following terms: The code has no expiration date.   Valid in 68 countries, including the USA, UK, and Canada.   Applicable to both new and existing users.   No minimum purchase amount required.   Can be used through both app and website.   Final Note: Use The Latest Temu Coupon Code $100 Off Using the Temu coupon code $100 off is your gateway to incredible savings and rewards on every order. Shop now to make the most of this limited-time opportunity. Enjoy unbeatable prices, exclusive gifts, and free global shipping with the Temu coupon $100 off by applying our verified code today. FAQs Of Temu $100 Off Coupon Is the Temu $100 off coupon real? Yes, the Temu $100 off coupon is real, verified, and works for both new and returning customers across 68 countries. How do I apply the Temu coupon code on my first order? Add products to your cart, head to checkout, and enter the code acs670886 to instantly get $100 off. Can existing customers use the Temu $100 off coupon? Absolutely. Existing customers can use the code acs670886 to get an extra $100 discount and free gifts. Does the coupon code expire? No, our coupon code acs670886 does not have an expiration date, so you can use it anytime. What do I get apart from the $100 off? Along with the $100 discount, you get up to 30% extra off, free gifts, and free shipping worldwide.    
    • Telegram (@danielklose) Buy Cocaine, Weed in Dubrovnik signal (danielklose.59) Buy MDMA, lsd, magic mushroom, Coke, Hash, Coca,
    • If you're looking to save money on trendy products, the Temu coupon code 40% off is exactly what you need. It gives a massive discount, making your shopping spree more affordable than ever. When you use the Temu coupon code acs670886, you unlock maximum value, especially if you're shopping from the USA, Canada, or across Europe. This exclusive code offers incredible savings not found anywhere else. For our loyal users, the Temu coupon code 2025 for existing customers and the Temu 40% discount coupon are game-changers. Now, staying loyal pays off more than ever! What Is The Temu Coupon Code 40% off? Both new and returning users can enjoy irresistible deals with the Temu coupon 40% off on the app and website. This 40% discount Temu coupon opens the door to unbeatable offers worldwide. acs670886 – Use it to get a flat 40% discount as a new user.   acs670886 – Grab 40% off on any order even if you're a returning user.   acs670886 – Redeem a $100 coupon pack that can be used multiple times.   acs670886 – New customers can claim $100 off instantly using this code.   acs670886 – Existing users can also use this code to unlock an additional $100 promo discount and benefit from regional exclusives in the USA and Canada.   Temu Coupon Code 40% Off For New Users New users can unlock unmatched savings by using our coupon code in the Temu app. With the Temu coupon 40% off and the Temu coupon code 40 off for existing users, both new and loyal users benefit big. acs670886 – Grants a flat 40% discount exclusively to new users.   acs670886 – Comes with a $100 coupon bundle for fresh accounts.   acs670886 – Use it for a $100 bundle usable over several orders.   acs670886 – Free shipping available to 68+ countries.   acs670886 – Offers 30% extra off on first purchases.   How To Redeem The Temu 40% Off Coupon Code For New Customers? To redeem the Temu 40% off deal, just download the Temu app or visit the website. Apply the Temu 40 off coupon code at checkout. Steps: Sign up on the Temu app or website.   Add your favorite items to your cart.   During checkout, enter acs670886 in the promo code field.   Confirm the discount is applied and complete your order.   Enjoy your savings and share with friends!   Temu Coupon Code 40% Off For Existing Users Yes, you read that right. Returning customers also get the spotlight with the Temu 40 off coupon code and Temu coupon code for existing customers. acs670886 – Grants existing users an exclusive 40% discount.   acs670886 – Unlocks a $100 coupon bundle usable across multiple orders.   acs670886 – Comes with free express-shipped gifts in the USA and Canada.   acs670886 – Offers an additional 30% off even if you're already enjoying a discount.   acs670886 – Eligible for free delivery to 68 countries.   How To Use The Temu Coupon Code 40% Off For Existing Customers? To get your deal using the Temu coupon code 40 off, just follow the simple checkout process. Redeeming the Temu discount code for existing users is as easy as applying it at payment. Steps: Open the Temu app or log in to your account.   Shop for items you love.   At the cart page, enter acs670886 in the coupon code box.   Click apply and wait for the discount to reflect.   Complete payment and enjoy your purchase.   How To Find The Temu Coupon Code 40% Off? To locate the Temu coupon code 40% off first order and latest Temu coupons 40 off, stay connected with trusted sources. Sign up for the Temu newsletter and stay updated on email-exclusive deals. Visit Temu’s Instagram, Facebook, or Twitter pages for real-time promotions. You can also find updated coupon codes on reliable deal websites that specialize in Western regions. How Temu 40% Off Coupons Work? The Temu coupon code 40% off first time user and Temu coupon code 40 percent off work by reducing your total order value by 40% instantly. When you enter acs670886 during checkout, the app verifies it, applies the discount, and updates your order total. Whether you’re a first-time shopper or a returning buyer, Temu’s smart system detects your eligibility and delivers the discount instantly—no gimmicks, no extra steps. How To Earn 40% Off Coupons In Temu As A New Customer? To earn the Temu coupon code 40% off, all you need is to sign up as a new user and shop through the app or official website. The Temu 40 off coupon code first order gets activated automatically for first-timers. You can also refer friends, participate in Temu app events, or use our tested code acs670886 for guaranteed rewards. What Are The Advantages Of Using Temu 40% Off Coupons? The Temu 40% off coupon code legit and coupon code for Temu 40 off bring incredible perks: 40% discount on your first order   40% discount for returning users   $100 coupon bundle usable across multiple orders   Up to 70% discount on best-selling items   Extra 30% off for loyal customers   Up to 90% off in seasonal offers   Free welcome gift for new shoppers   Free shipping to 68 nations globally   Temu Free Gift And Special Discount For New And Existing Users With our Temu 40% off coupon code and 40% off Temu coupon code, you get much more than just discounts. acs670886 – Unlocks 40% off your very first order.   acs670886 – Grants 40% discount to returning users.   acs670886 – Includes an extra 30% off on selected purchases.   acs670886 – Comes with a free welcome gift for new users.   acs670886 – Offers up to 70% discount and free delivery across the US, UK, and other regions.   Pros And Cons Of Using Temu Coupon Code 40% Off Let’s look at the Temu coupon 40% off code and Temu free coupon code 40 off in a balanced view: Pros: Huge 40% savings across all categories   Works for both new and returning customers   Includes $100 promo bundles   Combine with site-wide discounts   Free gifts and express shipping   Cons: Not stackable with other exclusive offers   Limited to selected items during flash sales   May require regional availability for some rewards   Terms And Conditions Of The Temu 40% Off Coupon Code In 2025 Here’s what you need to know about Temu coupon code 40% off free shipping and Temu coupon code 40% off reddit: Our coupon acs670886 has no expiration date.   Usable by both new and existing customers.   Available in 68 countries including USA, Canada, UK, etc.   No minimum cart value required to activate the code.   Not valid on select clearance or third-party items.   Final Note Now that you’re familiar with the Temu coupon code 40% off, shopping smarter is just one step away. You have the tools and the savings power at your fingertips. Take advantage of the Temu 40% off coupon and enjoy exclusive perks. Get started today and experience what hassle-free savings look like. FAQs Of Temu 40% Off Coupon 1. What is the best Temu 40% off code available? The best code available is acs670886 which gives you a guaranteed 40% discount for both new and existing users, plus other perks like $100 bundles and free shipping. 2. Can existing users benefit from this coupon? Yes! Existing customers can apply acs670886 to get a 40% discount, additional 30% off, free gifts, and more. 3. Is this coupon valid in the USA and Canada? Absolutely. acs670886 works perfectly for users based in North America including the USA and Canada. 4. Is the 40% off Temu coupon code legit? Yes, the code is tested and verified. Use acs670886 and enjoy secure and safe discounts directly via the Temu platform. 5. Does the Temu 40% off coupon expire? As of 2025, this coupon has no set expiration date and can be used anytime by eligible users.  
    • Hi So I Made A Mod Using ChatGPT And To Test It I Downgraded My Creative World Named Snow From Version Vanilla 1.21.6 To 1.12.2-forge-14.23.5.2860 And As Usual 1.12.2 Does Not Have Option To Create Backup And Load So I Clicked Use Anyway And As Expected My World Corrupted And When The Mod Did Not Work I Upgraded That World Back To Vanilla 1.21.6 And I Ended Up Being Spawned In The Same Ocean That Was In 1.12.2 But Many Mobs Fell From Sky Including Animals, Creepers And Skeletons And The Hills Around The Ocean Just Got Corrupted With Ore And Block Generation Going INSANE With Naturally Spawned Glazed Terracotta, Bricks. Also Dirt Gravel And Stone All Got Messed Up
    • Add crash-reports with sites like https://mclo.gs/ Make a test without createaddition
  • Topics

×
×
  • Create New...

Important Information

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