Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi,

 

I'm building my first mod, a faction style mod where the player places a "faction core" and all the blocks within a 16 block radius of the core change to my mod's equivalent of that block

 

for example, Grass would become faction Grass, logs become faction Logs etc

 

I've got the core block and a few other faction blocks (grass, log and dirt)

 

the faction blocks spread like grass (but aren't restricted to dirt).

 

I'm at a stage now where I want to limit the spread to 16 blocks around the faction core but I have no idea how to do it! :/ 

 

can anyone help me out with some pointers/suggestions?

thanks,

Jamie

  • Author
12 minutes ago, diesieben07 said:

Before spreading check if the coordinates you want to spread to are more than 16 blocks away.

so control the spread from the faction core?

 

at the moment every block ticks randomly and calls a "doSpread" function

 

  • Author
3 minutes ago, diesieben07 said:

How is that at all what I said?

I can only see 2 ways to do what you said

 

every block checks for a faction core in range before spreading (seems kinda inefficient

 

or control the spread from the faction core

 

or is there another way I haven't thought of?

  • Author
1 minute ago, diesieben07 said:

If the faction core is a TileEntity then searching for it can be pretty efficient.

 

ok, I know nothing about tile entities xD

 

I was going to limit block spread and then make the faction core a tile entity for faction information.... maybe I'll do the tile entity part first

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.