diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index b2d97634b..a7f6f8ba9 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -2,32 +2,41 @@
# TL;DR
-Polyhedral Development is dedicated to providing a harassment-free experience for everyone, regardless of gender, gender identity and
-expression, preferred pronouns, sexual orientation, disability, physical appearance, age, race, religion, etc. We do not tolerate harassment
-of participants in any form.
+Polyhedral Development is dedicated to providing a harassment-free experience
+for everyone, regardless of gender, gender identity and expression, preferred
+pronouns, sexual orientation, disability, physical appearance, age, race,
+religion, etc. We do not tolerate harassment of participants in any form.
-This code of conduct applies to all Terra community spaces, including the github discussions tab, our
-[community discord server](https://discord.gg/PXUEbbF), the [community subreddit](https://reddit.com/r/TerraGenerator), or any other Terra
-space, both online and off. Anyone in violation of this code, as determined by the applicable moderators, may be subject to verbal warning,
-expulsion from these spaces, or future events and activities for an undetermined amount of time.
+This code of conduct applies to all Terra community spaces, including the github
+discussions tab, our [community discord server](https://discord.gg/PXUEbbF),
+the [community subreddit](https://reddit.com/r/TerraGenerator), or any other
+Terra space, both online and off. Anyone in violation of this code, as
+determined by the applicable moderators, may be subject to verbal warning,
+expulsion from these spaces, or future events and activities for an undetermined
+amount of time.
-Some Terra community spaces may have additional rules in place, which will be made clearly available to all participants. Participants are
-responsible for knowing and abiding by these rules.
+Some Terra community spaces may have additional rules in place, which will be
+made clearly available to all participants. Participants are responsible for
+knowing and abiding by these rules.
# Longer version
-Polyhedral Development is dedicated to providing a harassment-free experience for everyone. We do not tolerate harassment of participants in
-any form.
+Polyhedral Development is dedicated to providing a harassment-free experience
+for everyone. We do not tolerate harassment of participants in any form.
## When and How to Use These Guidelines
-This code of conduct applies to all Terra community spaces, both online and off. This applies to the github discussion tab,
-the [Polyhedral Development community discord server](https://discord.gg/PXUEbbF), and any other Terra community. In addition, we may choose
-to invoke them in instances of harassment outside the Terra communities, and we will punish the responsible individuals appropriately. We
-will not tolerate harassment in any form, even outside of Terra.
+This code of conduct applies to all Terra community spaces, both online and off.
+This applies to the github discussion tab, the
+[Polyhedral Development community discord server](https://discord.gg/PXUEbbF),
+and any other Terra community. In addition, we may choose to invoke them in
+instances of harassment outside the Terra communities, and we will punish the
+responsible individuals appropriately. We will not tolerate harassment in any
+form, even outside of Terra.
-Some Terra spaces may have additional rules in place, which will be made clearly available to participants. Participants are responsible for
-knowing and abiding by these rules, in addition to this code of conduct.
+Some Terra spaces may have additional rules in place, which will be made clearly
+available to participants. Participants are responsible for knowing and abiding
+by these rules, in addition to this code of conduct.
## Expected Behavior
@@ -35,33 +44,43 @@ The following behaviors are expected of all members of the Terra community:
### Be Respectful
-Value each other's ideas, styles and viewpoints. We may not always agree, but disagreement is no excuse for poor manners. Be open to
-different possibilities and to being wrong. Be respectful in all interactions and communications, especially when debating the merits of
-different options. Be aware of your impact and how intense interactions may be affecting people. Be direct, constructive and positive. Take
-responsibility for your impact, and your mistakes – if someone says they have been harmed through your words or actions, listen carefully,
-apologize sincerely, and correct the behavior going forward.
+Value each other's ideas, styles and viewpoints. We may not always agree, but
+disagreement is no excuse for poor manners. Be open to different possibilities
+and to being wrong. Be respectful in all interactions and communications,
+especially when debating the merits of different options. Be aware of your
+impact and how intense interactions may be affecting people. Be direct,
+constructive and positive. Take responsibility for your impact, and your
+mistakes – if someone says they have been harmed through your words or actions,
+listen carefully, apologize sincerely, and correct the behavior going forward.
#### Be Prepared to Admit When You are Wrong
-Any member of the Terra community should always be open to new ideas and must always be open to the possibility of being wrong. Nobody can
-always be right, and we are only human; we are [fallible](https://www.merriam-webster.com/dictionary/fallible) by nature. It is okay to make
-mistakes, but we must be willing to admit when we make one.
+Any member of the Terra community should always be open to new ideas and must
+always be open to the possibility of being wrong. Nobody can always be right,
+and we are only human; we are
+[fallible](https://www.merriam-webster.com/dictionary/fallible) by nature.
+It is okay to make mistakes, but we must be willing to admit when we make one.
### Be Direct but Professional
-We are likely to have some discussions about if and when criticism is respectful and when it's not. We must be able to speak directly when
-we disagree and when we think we need to improve. We cannot withhold hard truths. Doing so respectfully is hard, doing so when others don't
-seem to be listening is harder, and hearing such comments when one is the recipient can be even harder still. We need to be honest and
-direct, as well as respectful.
+We are likely to have some discussions about if and when criticism is respectful
+and when it's not. We must be able to speak directly when we disagree and when
+we think we need to improve. We cannot withhold hard truths. Doing so
+respectfully is hard, doing so when others don't seem to be listening is harder,
+and hearing such comments when one is the recipient can be even harder still. We
+need to be honest and direct, as well as respectful.
### Be Inclusive
-Seek diverse perspectives. Diversity of views and of people on teams powers innovation, even if it is not always comfortable. Encourage all
-voices. Help new perspectives be heard and listen actively. If you find yourself dominating a discussion, it is especially important to step
-back and encourage other voices to join in. Be aware of how much time is taken up by dominant members of the group. Provide alternative ways
-to contribute or participate when possible.
+Seek diverse perspectives. Diversity of views and of people on teams powers
+innovation, even if it is not always comfortable. Encourage all voices. Help new
+perspectives be heard and listen actively. If you find yourself dominating a
+discussion, it is especially important to step back and encourage other voices
+to join in. Be aware of how much time is taken up by dominant members of the
+group. Provide alternative ways to contribute or participate when possible.
-Be inclusive of everyone in an interaction, respecting and facilitating people's participation whether they are:
+Be inclusive of everyone in an interaction, respecting and facilitating people's
+participation whether they are:
- Not native language speakers
- Coming from a different culture
@@ -70,47 +89,60 @@ Be inclusive of everyone in an interaction, respecting and facilitating people's
- Facing other challenges to participate
- Or anything else. Be respectful of *everyone* at *all times*.
-Think about how you might facilitate alternative ways to contribute or participate. If you find yourself dominating a discussion, step back.
-Make way for other voices and listen actively to them.
+Think about how you might facilitate alternative ways to contribute or
+participate. If you find yourself dominating a discussion, step back. Make way
+for other voices and listen actively to them.
### Understand Different Perspectives
-Our goal should not be to "win" every disagreement or argument. A more productive goal is to be open to ideas that make our own ideas
-better. Strive to be an example for inclusive thinking. "Winning" is when different perspectives make our work richer and stronger. That
-means, you must pay attention to all ideas proposed. Don't disregard one without giving it the attention it deserves.
+Our goal should not be to "win" every disagreement or argument. A more
+productive goal is to be open to ideas that make our own ideas better. Strive to
+be an example for inclusive thinking. "Winning" is when different perspectives
+make our work richer and stronger. That means, you must pay attention to all
+ideas proposed. Don't disregard one without giving it the attention it deserves.
### Appreciate and Accommodate Our Similarities and Differences
-People come from many cultures and backgrounds. Cultural differences can encompass everything from official religious observances to
-personal habits to clothing. Be respectful of anyone with different cultural practices, attitudes and beliefs. Work to eliminate your own
-biases, prejudices and discriminatory practices. Think of others' needs from their point of view. Use preferred titles (including
-pronouns[\[1\]](#1)) and the appropriate tone of voice. Respect people's right to privacy and confidentiality. Be open to
-learning from and educating others as well as educating yourself; it is unrealistic to expect someone to know the cultural practices of
-every ethnic and cultural group. Therefore we must be ready to correct someone if they make a mistake, and must be ready ourselves to change
-and learn if we make a mistake.
+People come from many cultures and backgrounds. Cultural differences can
+encompass everything from official religious observances to personal habits to
+clothing. Be respectful of anyone with different cultural practices, attitudes
+and beliefs. Work to eliminate your own biases, prejudices and discriminatory
+practices. Think of others' needs from their point of view. Use preferred
+titles (including pronouns[\[1\]](#1)) and the appropriate tone of
+voice. Respect people's right to privacy and confidentiality. Be open to
+learning from and educating others as well as educating yourself; it is
+unrealistic to expect someone to know the cultural practices of every ethnic and
+cultural group. Therefore we must be ready to correct someone if they make a
+mistake, and must be ready ourselves to change and learn if we make a mistake.
### Lead by Example
-By matching your actions with your words, you become a person others want to follow. Your actions influence others to behave and respond in
-ways that are valuable and appropriate for our organizational outcomes. Design your community and your work for inclusion. Hold yourself and
-others accountable for inclusive behaviors.
+By matching your actions with your words, you become a person others want to
+follow. Your actions influence others to behave and respond in ways that are
+valuable and appropriate for our organizational outcomes. Design your community
+and your work for inclusion. Hold yourself and others accountable for inclusive
+behaviors.
## Behavior That Will Not Be Tolerated
-The following behaviors are considered to be unacceptable and will not be tolerated:
+The following behaviors are considered to be unacceptable and will not be
+tolerated:
### Violence and Threats of Violence
-Violence and threats of violence are not acceptable - online or offline. This includes incitement of violence toward any individual,
-including encouraging a person to commit self-harm, engage in self-harm, or put themselves in a negative position (e.g. one which can lead
-to an increase of depression, etc.).
+Violence and threats of violence are not acceptable - online or offline. This
+includes incitement of violence toward any individual, including encouraging a
+person to commit self-harm, engage in self-harm, or put themselves in a negative
+position (e.g. one which can lead to an increase of depression, etc.).
### Personal Attacks
-Conflicts will inevitably arise, but frustration should never turn into a personal attack. It is not okay to insult, demean or belittle
-others. Attacking someone for their opinions, beliefs and ideas is not acceptable. It is important to speak directly when we disagree and
-when we think we need to improve, but such discussions must be conducted respectfully and professionally, remaining focused on the issue at
-hand.
+Conflicts will inevitably arise, but frustration should never turn into a
+personal attack. It is not okay to insult, demean or belittle others. Attacking
+someone for their opinions, beliefs and ideas is not acceptable. It is important
+to speak directly when we disagree and when we think we need to improve, but
+such discussions must be conducted respectfully and professionally, remaining
+focused on the issue at hand.
### Derogatory Language
@@ -135,30 +167,40 @@ Offensive, unwelcome, or hurtful comments related to:
- Socioeconomic status
- Religion
- Employment
-- Or anything really. Just don't be offensive towards people, insult them, or make unwanted comments.
+- Or anything really. Just don't be offensive towards people, insult them, or
+ make unwanted comments.
-is not acceptable. This includes deliberately referring to someone by a gender that they do not identify with, and/or questioning the
-legitimacy of an individual's gender identity. If you're unsure if a word is derogatory, don't use it. This also includes repeated subtle
-and/or indirect discrimination; when asked to stop, stop the behavior in question.
+is not acceptable. This includes deliberately referring to someone by a gender
+that they do not identify with, and/or questioning the legitimacy of an
+individual's gender identity. If you're unsure if a word is derogatory, don't
+use it. This also includes repeated subtle and/or indirect discrimination; when
+asked to stop, stop the behavior in question.
### Unwelcome Sexual Attention or Physical Contact
-Unwelcome sexual attention or unwelcome physical contact is not acceptable. This includes sexualized comments, jokes or imagery in
-interactions, communications or presentation materials, as well as inappropriate touching, groping, or sexual advances. Additionally,
-touching a person without permission, including sensitive areas such as their hair, pregnant stomach, mobility device (wheelchair, scooter,
-etc) or tattoos is unacceptable. This includes physically blocking or intimidating another person. Physical contact or simulated physical
-contact (e.g. emojis like ":kiss:", ":hug:", or ":kiss_mark:", textual descriptions like "\*hug\*", "\*backrub\*", or "\*kisses
-you\*", etc.) without affirmative consent or after a request to stop will not be accepted.
+Unwelcome sexual attention or unwelcome physical contact is not acceptable. This
+includes sexualized comments, jokes or imagery in interactions, communications
+or presentation materials, as well as inappropriate touching, groping, or sexual
+advances. Additionally, touching a person without permission, including
+sensitive areas such as their hair, pregnant stomach, mobility device (
+wheelchair, scooter, etc) or tattoos is unacceptable. This includes physically
+blocking or intimidating another person. Physical contact or simulated physical
+contact (e.g. emojis like ":kiss:", ":hug:", or ":kiss_mark:", textual
+descriptions like "\*hug\*", "\*backrub\*", or "\*kisses you\*", etc.) without
+affirmative consent or after a request to stop will not be accepted.
### Sexual Behaviour Where it is Not Appropriate
-Uninvited or off-topic sexual images, text, or behaviour in spaces where they're not appropriate will not be accepted whatsoever. We are an
-open community, which means spaces must be appropriate for all ages, and everybody must feel comfortable. Discussion of sexual things, will
-be prohibited unless otherwise noted.
+Uninvited or off-topic sexual images, text, or behaviour in spaces where they're
+not appropriate will not be accepted whatsoever. We are an open community, which
+means spaces must be appropriate for all ages, and everybody must feel
+comfortable. Discussion of sexual things, will be prohibited unless otherwise
+noted.
### Discussion of Sensitive Topics
-Discussion of sensitive topics when asked to stop, or when not appropriate. Including, but not limited to:
+Discussion of sensitive topics when asked to stop, or when not appropriate.
+Including, but not limited to:
- Anything sexual
- Gore
@@ -167,171 +209,241 @@ Discussion of sensitive topics when asked to stop, or when not appropriate. Incl
- Anything related to death
- Or really anything that someone may be sensitive about.
-shall not be tolerated. As a community for all ages and all kinds of people, we must cater to everyone, and must make sure everyone feels
-comfortable here. Repeatedly breaking someone else's boundaries will not be tolerated.
+shall not be tolerated. As a community for all ages and all kinds of people, we
+must cater to everyone, and must make sure everyone feels comfortable here.
+Repeatedly breaking someone else's boundaries will not be tolerated.
### Disruptive Behavior
-Sustained disruption of events, forums, or meetings, online or otherwise, including talks and presentations, will not be tolerated. This
-includes:
+Sustained disruption of events, forums, or meetings, online or otherwise,
+including talks and presentations, will not be tolerated. This includes:
- 'Talking over', 'heckling', or otherwise disrupting speakers.
-- Making derogatory comments about someone else's choices, pushing people to do something they do not wish to do, talking about their
- choices or personal preferences to others, or pressuring them to do something they don't wish to - physically or through jeering.
+- Making derogatory comments about someone else's choices, pushing people to do
+ something they do not wish to do, talking about their choices or personal
+ preferences to others, or pressuring them to do something they don't wish to -
+ physically or through jeering.
- Behaviour that intentionally disrupts an event.
- Otherwise influencing actions that may cause hostility in the session.
### Influencing Unacceptable Behavior
-We will treat influencing or leading such activities the same way we treat the activities themselves, and thus the same consequences apply.
-To make someone do something bad is the same thing as if you were to do it yourself, and we will not tolerate it.
+We will treat influencing or leading such activities the same way we treat the
+activities themselves, and thus the same consequences apply. To make someone do
+something bad is the same thing as if you were to do it yourself, and we will
+not tolerate it.
### Stalking or Following
-Stalking or following in any form (offline or online) is unnacceptable. In addition, you may not take pictures or record video of others
-without their express permission or when asked to stop. Any individual may also request for you to delete all footage you have of them, even
-if you took it with their prior consent.
+Stalking or following in any form (offline or online) is unnacceptable. In
+addition, you may not take pictures or record video of others without their
+express permission or when asked to stop. Any individual may also request for
+you to delete all footage you have of them, even if you took it with their prior
+consent.
### Publication of Personal Information
-The publication of personally identifying information (commonly known as "[doxxing](https://en.wikipedia.org/wiki/Doxing)") is directly
-prohibited. You may not publish information that someone wants to keep private, unless it is necessary to protect vulnerable people from
-intentional abuse. Addditionally, you may not deliberately "out" any aspect of a person's identity without their consent, this includes
-gender, pronouns, sexual identity, etc.
+The publication of personally identifying information (commonly known
+as "[doxxing](https://en.wikipedia.org/wiki/Doxing)") is directly prohibited.
+You may not publish information that someone wants to keep private, unless it is
+necessary to protect vulnerable people from intentional abuse. Addditionally,
+you may not deliberately "out" any aspect of a person's identity without their
+consent, this includes gender, pronouns, sexual identity, etc.
-Unless it pretains to a case of harassment, as outlined here, in which case some personally identifying information may need to be brought
-up in private with the appropriate moderation team to help aid our efforts in keeping the community safe.
+Unless it pretains to a case of harassment, as outlined here, in which case some
+personally identifying information may need to be brought up in private with the
+appropriate moderation team to help aid our efforts in keeping the community
+safe.
### Deliberate Misuse of Pronouns[\[1\]](#1) or Names
-As an inclusive community, we must respect everyone. That means respecting the pronouns or names they wish for us to use. Deliberate
-misgendering, misuse of preferred pronouns[\[1\]](#1), or use of 'dead' or rejected names is not to be tolerated. (If someone
-*accidentally* uses the incorrect pronouns, gender, or name, politely ask them to use the correct pronouns/gender/name. But if they are to
-continue using the incorrect pronouns, gender, or name, then you should escalate and report them to us.)
+As an inclusive community, we must respect everyone. That means respecting the
+pronouns or names they wish for us to use. Deliberate misgendering, misuse of
+preferred pronouns[\[1\]](#1), or use of 'dead' or rejected names is
+not to be tolerated. (If someone
+*accidentally* uses the incorrect pronouns, gender, or name, politely ask them
+to use the correct pronouns/gender/name. But if they are to continue using the
+incorrect pronouns, gender, or name, then you should escalate and report them to
+us.)
### Not Stopping After Multiple Requests
-If someone asks you to stop doing something, then you should stop. Continuing to do it may be considered harassment, and can lead you to be
-removed from our community.
+If someone asks you to stop doing something, then you should stop. Continuing to
+do it may be considered harassment, and can lead you to be removed from our
+community.
## Complains We May Ignore
-Additionally, Terra prioritizes marginalized people's safety over privileged people's comfort. We reserve the right to ignore complaints
-regarding:
+Additionally, Terra prioritizes marginalized people's safety over privileged
+people's comfort. We reserve the right to ignore complaints regarding:
-- Claims of discrimination against non-marginalized or oppressed groups (eg. being 'superphobic', meaning to not support people who are
- 'superstraight', which is a dog whistle for transphobic groups, or being 'cisphobic' without large amounts of evidence, etc.), or claims
- of discrimination with no evidence. (Basically, don't report 'cisphobia' to us, because it doesn't exist. But if someone is mocking you or
- making fun of you for being cis, and it is *really* getting out of hand, then do tell us.)
-- Reasonable communication of boundaries, such as "leave me alone," "go away," or "I'm not discussing this with you." (If someone is asking
- you to stop, that is not reason for you to report them as harassing you.)
-- Communicating in a 'tone' you don't find [congenial](https://www.thefreedictionary.com/congenial). (You may not report someone for
- harassment for being 'annoyed with you' or 'talking sternly to you')
-- Criticizing or calling out racist, sexist, discriminatory, or otherwise oppressive behavior or assumptions. (You may not say that someone
- is harassing you if they are telling you to stop discriminating against someone.)
-- Disagreements that do not qualify as harassment. If you have a simple disagreement with someone, and they have not been discriminating to
- anyone, in any form, then we will not take action against them. Two people are allowed to disagree on things without it getting toxic.
+- Claims of discrimination against non-marginalized or oppressed groups (eg.
+ being 'superphobic', meaning to not support people who are
+ 'superstraight', which is a dog whistle for transphobic groups, or being '
+ cisphobic' without large amounts of evidence, etc.), or claims of
+ discrimination with no evidence. (Basically, don't report 'cisphobia' to us,
+ because it doesn't exist. But if someone is mocking you or making fun of you
+ for being cis, and it is *really* getting out of hand, then do tell us.)
+- Reasonable communication of boundaries, such as "leave me alone," "go away,"
+ or "I'm not discussing this with you." (If someone is asking you to stop, that
+ is not reason for you to report them as harassing you.)
+- Communicating in a 'tone' you don't
+ find [congenial](https://www.thefreedictionary.com/congenial). (You may not
+ report someone for harassment for being 'annoyed with you' or 'talking sternly
+ to you')
+- Criticizing or calling out racist, sexist, discriminatory, or otherwise
+ oppressive behavior or assumptions. (You may not say that someone is harassing
+ you if they are telling you to stop discriminating against someone.)
+- Disagreements that do not qualify as harassment. If you have a simple
+ disagreement with someone, and they have not been discriminating to anyone, in
+ any form, then we will not take action against them. Two people are allowed to
+ disagree on things without it getting toxic.
-We may also additionally choose to enact punishment for submitting a complaint in bad-faith or without adequate justification, if we deem
-necessary; if you're submitting a complaint just to troll or to annoy people, we may choose to have you banned or removed from the community
-spaces. Don't waste our time.
+We may also additionally choose to enact punishment for submitting a complaint
+in bad-faith or without adequate justification, if we deem necessary; if you're
+submitting a complaint just to troll or to annoy people, we may choose to have
+you banned or removed from the community spaces. Don't waste our time.
-In order to protect volunteers from abuse and burnout, we reserve the right to reject any report we believe to have been made in bad faith
-or with misintent. Reports intended to silence legitimate criticism may be deleted without response.
+In order to protect volunteers from abuse and burnout, we reserve the right to
+reject any report we believe to have been made in bad faith or with misintent.
+Reports intended to silence legitimate criticism may be deleted without
+response.
## Reporting
-Terra has a global moderation team which is currently comprised of the following members:
+Terra has a global moderation team which is currently comprised of the following
+members:
- solonovamax
- - discord: [@solonovamax#6983](https://discord.com/channels/@me/566146322273402881)*
+ -
+ discord: [@solonovamax#6983](https://discord.com/channels/@me/566146322273402881)*
- github: [@solonovamax](https://github.com/solonovamax)
- - email: [solonovamax@12oclockpoint.com](mailto:solonovamax@12oclockpoint.com)
+ -
+ email: [solonovamax@12oclockpoint.com](mailto:solonovamax@12oclockpoint.com)
- dfsek
- - discord: [@dfsek#4208](https://discord.com/channels/@me/378350362236682240)*
+ -
+ discord: [@dfsek#4208](https://discord.com/channels/@me/378350362236682240)*
- github: [@dfsek](https://github.com/dfsek)
- email: [dfsek@protonmail.com](mailto:dfsek@protonmail.com)
- duplex (duplexsystem)
- - discord: [@Duplex#0797](https://discord.com/channels/@me/356822848641171456)*
+ -
+ discord: [@Duplex#0797](https://discord.com/channels/@me/356822848641171456)*
- github: [@duplexsystem](https://github.com/duplexsystem)
- email: [duplexsys@protonmail.com](mailto:duplexsys@protonmail.com)
-\* The preferred method of communication is through discord. Although we will still be responsive on the other platforms, we will be more
-responsive on discord.
+\* The preferred method of communication is through discord. Although we will
+still be responsive on the other platforms, we will be more responsive on
+discord.
These are people you can contact for anything regarding this code of conduct.
-If you are being harassed by a member of the Terra community, or by someone in a Terra community space, notice that someone else is being
-harassed, or have any other concerns, please contact a moderator of the platform it occurred on, or someone on the global moderation team.
-If the person who is harassing you is on the global moderation team, they will [recuse](https://www.thefreedictionary.com/recuse) themselves
-from handling your incident. (Meaning: if you are reporting someone on the team, they will not be involved in the discussion.) We will
-respond within a reasonable time frame, but generally within about 1 day.
+If you are being harassed by a member of the Terra community, or by someone in a
+Terra community space, notice that someone else is being harassed, or have any
+other concerns, please contact a moderator of the platform it occurred on, or
+someone on the global moderation team. If the person who is harassing you is on
+the global moderation team, they
+will [recuse](https://www.thefreedictionary.com/recuse) themselves from handling
+your incident. (Meaning: if you are reporting someone on the team, they will not
+be involved in the discussion.) We will respond within a reasonable time frame,
+but generally within about 1 day.
-This code of conduct applies to Terra community spaces, but if you are being harassed by a member of Terra *outside* our spaces, we still
-want to know about it as we may choose to take action within our community. We will take all good-faith reports seriously and will always
-attempt to handle them appropriately. This includes harassment outside our spaces and harassment that took place at any point in time. The
-moderation team reserves the right to exclude people from Terra communities based on their past behavior, including behavior outside Terra
-spaces and behavior towards people who are not in Terra.
+This code of conduct applies to Terra community spaces, but if you are being
+harassed by a member of Terra *outside* our spaces, we still want to know about
+it as we may choose to take action within our community. We will take all
+good-faith reports seriously and will always attempt to handle them
+appropriately. This includes harassment outside our spaces and harassment that
+took place at any point in time. The moderation team reserves the right to
+exclude people from Terra communities based on their past behavior, including
+behavior outside Terra spaces and behavior towards people who are not in Terra.
-Note: although we only have the ability to moderate official community spaces, if you are being harassed by someone in a non-official
-community space, and the moderation team of that platform refuses to do anything to help you (or even if they *do* help you), then you
-should notify us so that we may take appropriate action.
+Note: although we only have the ability to moderate official community spaces,
+if you are being harassed by someone in a non-official community space, and the
+moderation team of that platform refuses to do anything to help you (or even if
+they *do* help you), then you should notify us so that we may take appropriate
+action.
-We will respect confidentiality requests for the purpose of protecting victims of abuse. At our discretion, we may publicly name a person
-which we have received harassment complaints about, or privately warn third parties about them, but only if we believe that doing so will
-increase the safety of Terra community members or the general public. We will not name harassment victims or reporters of harassment
-(assuming the report was made in good-faith) without their explicit consent; all reports will remain anonymous by default.
+We will respect confidentiality requests for the purpose of protecting victims
+of abuse. At our discretion, we may publicly name a person which we have
+received harassment complaints about, or privately warn third parties about
+them, but only if we believe that doing so will increase the safety of Terra
+community members or the general public. We will not name harassment victims or
+reporters of harassment
+(assuming the report was made in good-faith) without their explicit consent; all
+reports will remain anonymous by default.
## Consequences of Unacceptable Behavior
-Participants asked to stop any harassing behavior are expected to comply immediately. Whether or not you comply immediately, you may still
-face consequences for you actions, but if the harasser doesn't comply immediately then we may choose to take additional actions to protect
-the Terra community members or the individual being harassed.
+Participants asked to stop any harassing behavior are expected to comply
+immediately. Whether or not you comply immediately, you may still face
+consequences for you actions, but if the harasser doesn't comply immediately
+then we may choose to take additional actions to protect the Terra community
+members or the individual being harassed.
-Violation of this code can result in being asked to leave an event or online space, either temporarily or for the duration of the event, or
-being banned from participation in spaces, or future events and activities in perpetuity. If a participant engages in harassing behavior,
-the global moderation team may take any action they deem appropriate, up to and including expulsion from all Terra community spaces and
-identification of the participant as a harasser to other Terra community members or the general public. Bad behavior from any community
+Violation of this code can result in being asked to leave an event or online
+space, either temporarily or for the duration of the event, or being banned from
+participation in spaces, or future events and activities in perpetuity. If a
+participant engages in harassing behavior, the global moderation team may take
+any action they deem appropriate, up to and including expulsion from all Terra
+community spaces and identification of the participant as a harasser to other
+Terra community members or the general public. Bad behavior from any community
member, including those with decision-making authority, will not be tolerated.
-In addition, any participants who abuse the reporting process will be considered to be in violation of these guidelines and subject to
-consequences. False reporting, especially to retaliate or exclude, will not be accepted or tolerated.
+In addition, any participants who abuse the reporting process will be considered
+to be in violation of these guidelines and subject to consequences. False
+reporting, especially to retaliate or exclude, will not be accepted or
+tolerated.
## Questions
-if you have further questions for anything not addressed here, you may open an issue on this github repo, or contact a member of the global
-moderation team.
+if you have further questions for anything not addressed here, you may open an
+issue on this github repo, or contact a member of the global moderation team.
## License and Attribution
This set of guidelines is distributed under a
-[Creative Commons Attribution-ShareAlike license](https://creativecommons.org/licenses/by-sa/3.0/).
+[Creative Commons Attribution-ShareAlike license](https://creativecommons.org/licenses/by-sa/3.0/)
+.
These guidelines have been adapted from
-[Mozilla's Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/), which were adapted
-from:
+[Mozilla's Community Participation Guidelines](https://www.mozilla.org/en-US/about/governance/policies/participation/)
+, which were adapted from:
- Mozilla's original Community Participation Guidelines
- The [Ubuntu Code of Conduct](https://ubuntu.com/community/code-of-conduct)
-- Mozilla's [View Source Conference Code of Conduct](https://viewsourceconf.org/berlin-2016/code-of-conduct/)
-- And the [Rust Language Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct)
+-
-which in turn were based on [Stumptown Syndicate's Citizen Code of Conduct](http://citizencodeofconduct.org/), along with some adapted text
-from the [LGBTQ in Technology Code of Conduct](https://lgbtq.technology/coc.html) and
-the [WisCon code of conduct](http://wiscon.net/policies/anti-harassment/code-of-conduct/).
+Mozilla's [View Source Conference Code of Conduct](https://viewsourceconf.org/berlin-2016/code-of-conduct/)
+
+- And
+ the [Rust Language Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct)
+
+which in turn were based
+on [Stumptown Syndicate's Citizen Code of Conduct](http://citizencodeofconduct.org/)
+, along with some adapted text from
+the [LGBTQ in Technology Code of Conduct](https://lgbtq.technology/coc.html) and
+the [WisCon code of conduct](http://wiscon.net/policies/anti-harassment/code-of-conduct/)
+.
It was then modified by solonovamax with various inclusions from
-the [LGBTQ in Technology Code of Conduct](https://lgbtq.technology/coc.html) and a few other sources.
+the [LGBTQ in Technology Code of Conduct](https://lgbtq.technology/coc.html) and
+a few other sources.
## Notes
#### \[1\]
-You provide a set of pronouns that everyone is comfortable addressing you with. Although some people are comfortable
-using [neopronouns](https://www.mypronouns.org/neopronouns), not everyone is. Therefore, if you use neopronouns, you should have at *least*
-one set of more common pronouns (One of he/him, she/her, or they/them; it doesn't matter which one. Anyone who doesn't respect your basic
-pronouns will be removed from the community.) that people may use, should they so choose, as some people are not comfortable
-using [neopronouns](https://www.mypronouns.org/neopronouns). But if someone refuses to use your more common pronouns, you should report them
-to us. Additionally, you may not ask people to use unreasonable pronouns, such as 'acab/acabself', 'that/bitch', 'ur/mom', or
-'dream/dreamself' (pronouns related to real people, eg. the minecraft youtuber 'dreamwastaken'). Doing so will be considered mockery of
-individuals who use non-standard pronouns and is very disrespectful.
\ No newline at end of file
+You provide a set of pronouns that everyone is comfortable addressing you with.
+Although some people are comfortable
+using [neopronouns](https://www.mypronouns.org/neopronouns), not everyone is.
+Therefore, if you use neopronouns, you should have at *least*
+one set of more common pronouns (One of he/him, she/her, or they/them; it
+doesn't matter which one. Anyone who doesn't respect your basic pronouns will be
+removed from the community.) that people may use, should they so choose, as some
+people are not comfortable
+using [neopronouns](https://www.mypronouns.org/neopronouns). But if someone
+refuses to use your more common pronouns, you should report them to us.
+Additionally, you may not ask people to use unreasonable pronouns, such as '
+acab/acabself', 'that/bitch', 'ur/mom', or
+'dream/dreamself' (pronouns related to real people, eg. the minecraft youtuber '
+dreamwastaken'). Doing so will be considered mockery of individuals who use
+non-standard pronouns and is very disrespectful.
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 743a1face..3c2c62467 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,17 +1,22 @@
# Contributing to Terra
-First off, thank you for considering contributing to Terra. It's people like you that make Terra such a great tool.
+First off, thank you for considering contributing to Terra. It's people like you
+that make Terra such a great tool.
-Following these guidelines helps to effectively use the time of the developers managing and developing this open source project, making it
-more enjoyable for all of us.
+Following these guidelines helps to effectively use the time of the developers
+managing and developing this open source project, making it more enjoyable for
+all of us.
-Terra is an open source project and we love to receive contributions from our community, you! There are many ways to contribute, from
-writing tutorials or blog posts, improving the documentation, submitting bug reports and feature requests or writing code which can be
-incorporated into Terra.
+Terra is an open source project and we love to receive contributions from our
+community, you! There are many ways to contribute, from writing tutorials or
+blog posts, improving the documentation, submitting bug reports and feature
+requests or writing code which can be incorporated into Terra.
-The following is a set of guidelines for contributing to Terra and its packages, which are hosted in
-the [PolyhedralDev Organization](https://github.com/PolyhedralDev) on GitHub. These are mostly guidelines, not rules. Use your best
-judgment, and feel free to propose changes to this document in a pull request.
+The following is a set of guidelines for contributing to Terra and its packages,
+which are hosted in
+the [PolyhedralDev Organization](https://github.com/PolyhedralDev) on GitHub.
+These are mostly guidelines, not rules. Use your best judgment, and feel free to
+propose changes to this document in a pull request.
#### Table Of Contents
@@ -51,8 +56,10 @@ judgment, and feel free to propose changes to this document in a pull request.
## Code of Conduct
-This project and everyone participating in it is governed by the [Terra of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected
-to uphold this code. Please report unacceptable behavior to [Terra global moderation team](CODE_OF_CONDUCT.md#Reporting).
+This project and everyone participating in it is governed by
+the [Terra of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected
+to uphold this code. Please report unacceptable behavior
+to [Terra global moderation team](CODE_OF_CONDUCT.md#Reporting).
## I don't want to read this whole thing I just have a question!!!
@@ -66,160 +73,219 @@ We have an official discord server where you can request help from various users
### Your First Contribution
-Unsure where to begin contributing to Terra? You can start by looking through "beginner" and "help wanted" issues:
+Unsure where to begin contributing to Terra? You can start by looking through "
+beginner" and "help wanted" issues:
-- [Beginner issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Good%20First%20Issue) - issues which should be friendly to
- anyone new to terra.
-- [Help wanted issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Help%20Wanted) - issues which should be a bit more involved
- than "beginner" issues.
+- [Beginner issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Good%20First%20Issue)
+ - issues which should be friendly to anyone new to terra.
+- [Help wanted issues](https://github.com/PolyhedralDev/Terra/labels/Note%3A%20Help%20Wanted)
+ - issues which should be a bit more involved than "beginner" issues.
New to github? Working on your first Pull Request? Check
out [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github)
to get you up on your feet.
-At this point, you're ready to make your changes! Feel free to ask for help; everyone is a beginner at first!
+At this point, you're ready to make your changes! Feel free to ask for help;
+everyone is a beginner at first!
-If a maintainer asks you to "rebase" your PR, they're saying that a lot of code has changed, and that you need to update your branch so it's
-easier to merge.
+If a maintainer asks you to "rebase" your PR, they're saying that a lot of code
+has changed, and that you need to update your branch so it's easier to merge.
### Reporting Bugs
-This section guides you through submitting a bug report for Terra. Following these guidelines helps maintainers and the community understand
-your report, and spend their time fixing the issue instead of understanding what you mean.
+This section guides you through submitting a bug report for Terra. Following
+these guidelines helps maintainers and the community understand your report, and
+spend their time fixing the issue instead of understanding what you mean.
-Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create
-one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report).
+Before creating bug reports, please
+check [this list](#before-submitting-a-bug-report) as you might find out that
+you don't need to create one. When you are creating a bug report,
+please [include as many details as possible](#how-do-i-submit-a-good-bug-report)
+.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
#### Before Submitting A Bug Report
-- Join the [discord server](https://discord.dfsek.com) to help resolve simple issues.
-- You must be on the LATEST version of Terra to receive any support. There is no support for older versions of Terra.
-- Make sure that this is not a *specific* compatibility issue with another terrain generation mod. Do not request *specific* compatibility
- with mods or plugins (e.g. "Compatibility with TechCraft v7"). That should be implemented in an addon, **not** in the main project.
- *General* compatibility (e.g. "Ability to pull Vanilla/Modded features from parent biomes") will be considered in the main project.
-- Search for any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) open with your problem. If you open
- a duplicate, it will be closed as such.
-- Make sure that it is actually Terra causing the issue, and not another mod/plugin. You can do this by testing to see if you can recreate
- the issue without Terra installed.
-- Double check that this is not an issue with a specific Terra *pack* or Terra *addon*, and instead applies to all of Terra.
-- Include a copy of the latest.log file. Putting *just* the exception is not enough. We need to be able to check that there wasn't anything
- else before that caused it.
-- Be sure to fill out all the required information and give descriptions of everything.
+- Join the [discord server](https://discord.dfsek.com) to help resolve simple
+ issues.
+- You must be on the LATEST version of Terra to receive any support. There is no
+ support for older versions of Terra.
+- Make sure that this is not a *specific* compatibility issue with another
+ terrain generation mod. Do not request *specific* compatibility with mods or
+ plugins (e.g. "Compatibility with TechCraft v7"). That should be implemented
+ in an addon, **not** in the main project.
+ *General* compatibility (e.g. "Ability to pull Vanilla/Modded features from
+ parent biomes") will be considered in the main project.
+- Search for
+ any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+)
+ open with your problem. If you open a duplicate, it will be closed as such.
+- Make sure that it is actually Terra causing the issue, and not another
+ mod/plugin. You can do this by testing to see if you can recreate the issue
+ without Terra installed.
+- Double check that this is not an issue with a specific Terra *pack* or Terra *
+ addon*, and instead applies to all of Terra.
+- Include a copy of the latest.log file. Putting *just* the exception is not
+ enough. We need to be able to check that there wasn't anything else before
+ that caused it.
+- Be sure to fill out all the required information and give descriptions of
+ everything.
#### How Do I Submit A (Good) Bug Report?
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/)
-. [Create an issue](https://github.com/PolyhedralDev/Terra/issues/new) and provide the prerequisite information by filling in the Bug Report
-template.
+. [Create an issue](https://github.com/PolyhedralDev/Terra/issues/new) and
+provide the prerequisite information by filling in the Bug Report template.
-Explain the problem and include additional details to help maintainers reproduce the problem:
+Explain the problem and include additional details to help maintainers reproduce
+the problem:
- **Use a clear and descriptive title** for the issue to identify the problem.
-- **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you
- did, but explain how you did it**.
+- **Describe the exact steps which reproduce the problem** in as many details as
+ possible. When listing steps, **don't just say what you did, but explain how
+ you did it**.
- **Provide specific examples to demonstrate the steps**.
-- **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
+- **Describe the behavior you observed after following the steps** and point out
+ what exactly is the problem with that behavior.
- **Explain which behavior you expected to see instead and why.**
-- **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more
- information using the guidelines below.
+- **If the problem wasn't triggered by a specific action**, describe what you
+ were doing before the problem happened and share more information using the
+ guidelines below.
Include details about your configuration and environment:
-- **Which version of Terra are you using?** You can get the exact version by running `/te version`.
-- **What's the name and version of the platform you're using**? (eg. Spigot, Fabric, Paper, etc.)
+- **Which version of Terra are you using?** You can get the exact version by
+ running `/te version`.
+- **What's the name and version of the platform you're using**? (eg. Spigot,
+ Fabric, Paper, etc.)
- **Which external plugins or mods do you have installed?**
-- **Which Terra packs do you have installed?** You can get that list by running `/te packs`.
-- **Which Terra addons do you have installed?** You can get that list by running `/te addons`.
+- **Which Terra packs do you have installed?** You can get that list by
+ running `/te packs`.
+- **Which Terra addons do you have installed?** You can get that list by
+ running `/te addons`.
### Suggesting Enhancements
-This section guides you through submitting an enhancement suggestion for Terra, including completely new features and minor improvements to
-existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related
-suggestions.
+This section guides you through submitting an enhancement suggestion for Terra,
+including completely new features and minor improvements to existing
+functionality. Following these guidelines helps maintainers and the community
+understand your suggestion and find related suggestions.
-Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that
-you don't need to create one. When you are creating an enhancement suggestion,
-please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion).
+Before creating enhancement suggestions, please
+check [this list](#before-submitting-an-enhancement-suggestion) as you might
+find out that you don't need to create one. When you are creating an enhancement
+suggestion,
+please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion)
+.
#### Before Submitting An Enhancement Suggestion
-- You must be on the **LATEST** version of Terra to make sure your feature hasn't been added yet.
-- Search for any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (Including closed!) with your
- problem. If you open a duplicate, it will be closed as such.
+- You must be on the **LATEST** version of Terra to make sure your feature
+ hasn't been added yet.
+- Search for
+ any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (
+ Including closed!) with your problem. If you open a duplicate, it will be
+ closed as such.
- Verify that this is actually within the scope of Terra.
-- Be sure that this is not a feature request that should be made for a specific Terra *pack*, and instead applies to all of Terra.
-- Be sure that this is not something that should be implemented as a Terra addon, and instead applies to all of Terra.
-- Make sure that you attach a copy of the latest.log file, if there are any exceptions thrown in the console. Putting *just* the exception
- **is not enough**. We need to be able to check that there wasn't anything else before that caused it.
+- Be sure that this is not a feature request that should be made for a specific
+ Terra *pack*, and instead applies to all of Terra.
+- Be sure that this is not something that should be implemented as a Terra
+ addon, and instead applies to all of Terra.
+- Make sure that you attach a copy of the latest.log file, if there are any
+ exceptions thrown in the console. Putting *just* the exception
+ **is not enough**. We need to be able to check that there wasn't anything else
+ before that caused it.
#### How Do I Submit A (Good) Enhancement Suggestion?
-Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on our main repository
-and provide the following information:
+Enhancement suggestions are tracked
+as [GitHub issues](https://guides.github.com/features/issues/). Create an issue
+on our main repository and provide the following information:
-- **Use a clear and descriptive title** for the issue to identify the suggestion.
-- **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
+- **Use a clear and descriptive title** for the issue to identify the
+ suggestion.
+- **Provide a step-by-step description of the suggested enhancement** in as many
+ details as possible.
- **Provide specific examples to demonstrate the steps**.
-- **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
-- **Explain why this enhancement would be useful** to most Terra users and isn't something that can or should be implemented as an addon.
+- **Describe the current behavior** and **explain which behavior you expected to
+ see instead** and why.
+- **Explain why this enhancement would be useful** to most Terra users and isn't
+ something that can or should be implemented as an addon.
### Pull Requests
This section guides you through submitting a pull request for Terra.
-While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete
-additional design work, tests, or other changes before your pull request can be ultimately accepted.
+While the prerequisites above must be satisfied prior to having your pull
+request reviewed, the reviewer(s) may ask you to complete additional design
+work, tests, or other changes before your pull request can be ultimately
+accepted.
#### Before Submitting A Pull Request
-- You must be on the **LATEST** version of Terra to make sure your feature hasn't been added yet.
-- Search for any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (Including closed!) with your
- problem. If you open a duplicate, it will be closed as such.
+- You must be on the **LATEST** version of Terra to make sure your feature
+ hasn't been added yet.
+- Search for
+ any [already existing issues](https://github.com/PolyhedralDev/Terra/issues?q=is%3Aissue+) (
+ Including closed!) with your problem. If you open a duplicate, it will be
+ closed as such.
- Verify that this is actually within the scope of Terra.
-- Be sure that this is not a feature request that should be made for a specific Terra *pack*, and instead applies to all of Terra.
-- Be sure that this is not something that should be implemented as a Terra addon, and instead applies to all of Terra.
-- Make sure that you attach a copy of the latest.log file, if there are any exceptions thrown in the console. Putting *just* the
- exception **is not enough**. We need to be able to check that there wasn't anything else before that caused it.
+- Be sure that this is not a feature request that should be made for a specific
+ Terra *pack*, and instead applies to all of Terra.
+- Be sure that this is not something that should be implemented as a Terra
+ addon, and instead applies to all of Terra.
+- Make sure that you attach a copy of the latest.log file, if there are any
+ exceptions thrown in the console. Putting *just* the exception **is not
+ enough**. We need to be able to check that there wasn't anything else before
+ that caused it.
#### How Do I Submit A (Good) Pull Request?
-Pull Requests are tracked as [GitHub Pull Requests](https://guides.github.com/activities/forking/#making-a-pull-request). Create a pr on our
-main repository and provide the following information:
+Pull Requests are tracked
+as [GitHub Pull Requests](https://guides.github.com/activities/forking/#making-a-pull-request)
+. Create a pr on our main repository and provide the following information:
- **Use a clear and descriptive title** to identify the pull request.
- **State what this pull request adds/fixes**.
-- **Be sure that you are the owner of the code you contributed** or that it can be licensed under the GPLv3.
-- **Provide a description goals and non-goals of the pull request** in as many details as possible.
-- **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
-- **Explain why this enhancement would be useful** to most Terra users and isn't something that can or should be implemented as an addon.
+- **Be sure that you are the owner of the code you contributed** or that it can
+ be licensed under the GPLv3.
+- **Provide a description goals and non-goals of the pull request** in as many
+ details as possible.
+- **Describe the current behavior** and **explain which behavior you expected to
+ see instead** and why.
+- **Explain why this enhancement would be useful** to most Terra users and isn't
+ something that can or should be implemented as an addon.
## Styleguides
### Git Commits
-Following this is not mandatory, but rather a set of guidelines. As long as your commit messages aren't absolutely awful, it's probably
-fine. But it would be nice if you followed them.
+Following this is not mandatory, but rather a set of guidelines. As long as your
+commit messages aren't absolutely awful, it's probably fine. But it would be
+nice if you followed them.
#### Committing
-When you commit code, try to avoid committing large amounts of code in a single go. Splitting up code into smaller commits is much nicer and
-makes it easier to trace a feature to a single commit.
+When you commit code, try to avoid committing large amounts of code in a single
+go. Splitting up code into smaller commits is much nicer and makes it easier to
+trace a feature to a single commit.
-Try to stick to one feature/fix/etc. per commit. A good rule of thumb is if you need to use the word "and" in the subject line, then it
-should probably™ be two commits.
+Try to stick to one feature/fix/etc. per commit. A good rule of thumb is if you
+need to use the word "and" in the subject line, then it should probably™ be two
+commits.
#### Git Commit Messages
-- Subject line must fit the following format: `: `. Type must be one of the following:
+- Subject line must fit the following format: `: `. Type
+ must be one of the following:
- Build: Changes that affect the build system or external dependencies.
- Docs: Documentation only changes.
- Feat: A new feature.
- Fix: A bug fix.
- Perf: Performance improvements.
- Refactor: Refactoring sections of the codebase.
- - Repo: Changes to the repository structure that do not affect code. (Eg. modification of the `README.md` file, etc.)
+ - Repo: Changes to the repository structure that do not affect code. (Eg.
+ modification of the `README.md` file, etc.)
- Revert: Revert a previous commit.
- Style: Code style updates.
- Test: Anything related to testing.
@@ -266,7 +332,8 @@ should probably™ be two commits.
### Code Styleguide
-Use an IDE with support for `.editorconfig` files. There is an included editorconfig file in the base of the project so that your IDE should
+Use an IDE with support for `.editorconfig` files. There is an included
+editorconfig file in the base of the project so that your IDE should
automatically use the correct code style settings.
### Documentation Styleguide
@@ -279,41 +346,55 @@ TODO
#### General Compatibility
-General compatibility (example: injection of Vanilla structures/features/carvers into packs) is acceptable in the main project.
+General compatibility (example: injection of Vanilla structures/features/carvers
+into packs) is acceptable in the main project.
-- General compatibility features should be *disabled by default*. Having things auto-injected causes unpredictable behaviour that is
- annoying to diagnose. General-compatibility options should have config values attached which are disabled by default.
-- These config options should also be *simple to use*. Think of the people who will be using these compatibility options. They want to flick
- a switch and have things be compatible. That means that a majority of compatibility options should stay in `pack.yml`, to make it simple
- to go into a pack and turn on specific compatibilities. This does *not* mean that more advanced compatibility options are off the table,
- for example, look at Feature compatibility, where features can either be automatically injected, *or* configured individually per Terra
- biome, depending on how much control the user wants.
+- General compatibility features should be *disabled by default*. Having things
+ auto-injected causes unpredictable behaviour that is annoying to diagnose.
+ General-compatibility options should have config values attached which are
+ disabled by default.
+- These config options should also be *simple to use*. Think of the people who
+ will be using these compatibility options. They want to flick a switch and
+ have things be compatible. That means that a majority of compatibility options
+ should stay in `pack.yml`, to make it simple to go into a pack and turn on
+ specific compatibilities. This does *not* mean that more advanced
+ compatibility options are off the table, for example, look at Feature
+ compatibility, where features can either be automatically injected, *or*
+ configured individually per Terra biome, depending on how much control the
+ user wants.
#### Specific Compatibility
-Specific compatibility should *not* be put in the main project. (Example: Adding the ability to generate TechCraft v7's doo-dads with a
-TerraScript function)
+Specific compatibility should *not* be put in the main project. (Example: Adding
+the ability to generate TechCraft v7's doo-dads with a TerraScript function)
-Having specific compatibilities leads to tons of extra dependencies to keep track of, as well as adding lots of additional stuff to
-maintain. It quickly becomes a mess. Especially when most users will never need to use this feature.
+Having specific compatibilities leads to tons of extra dependencies to keep
+track of, as well as adding lots of additional stuff to maintain. It quickly
+becomes a mess. Especially when most users will never need to use this feature.
-We have designed an addon API for exactly this purpose. **Specific compatibilities are welcome and encouraged, in the form of addons.**
+We have designed an addon API for exactly this purpose. **Specific
+compatibilities are welcome and encouraged, in the form of addons.**
### Platform-Agnostic Design
-Terra must, at all times, remain platform agnostic. This means it must be able to run on theoretically any voxel based platform. Including
-non-minecraft games like Terasology.
+Terra must, at all times, remain platform agnostic. This means it must be able
+to run on theoretically any voxel based platform. Including non-minecraft games
+like Terasology.
-When adding a new feature to `common`, make no assumptions about what platform it'll be running on.
+When adding a new feature to `common`, make no assumptions about what platform
+it'll be running on.
Examples:
- Don't assume the world height is 256.
-- Don't assume that a specific block, item, or entity exists. (Eg. don't assume there exists a block called `minecraft:grass_block`)
+- Don't assume that a specific block, item, or entity exists. (Eg. don't assume
+ there exists a block called `minecraft:grass_block`)
### Data-Driven
-When adding a new feature, make it abstract. Don't make assumptions about "specific use cases." If you can only think of a few use cases,
-your idea should probably be generalized.
+When adding a new feature, make it abstract. Don't make assumptions about "
+specific use cases." If you can only think of a few use cases, your idea should
+probably be generalized.
-You must use configs effectively. Make configs that are *powerful* but also *make sense* and are \[easy\] to use.
\ No newline at end of file
+You must use configs effectively. Make configs that are *powerful* but also *
+make sense* and are \[easy\] to use.
\ No newline at end of file
diff --git a/README.md b/README.md
index a33baa859..08962c148 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,23 @@
# Terra
-Terra is an incredibly powerful free & open-source data-driven, platform-agnostic world generator. It allows you to create a world exactly
-to your specifications, with no knowledge of Java required.
+Terra is an incredibly powerful free & open-source data-driven,
+platform-agnostic world generator. It allows you to create a world exactly to
+your specifications, with no knowledge of Java required.
## Downloads:
-* Paper+ servers (Paper, Tuinity, Purpur, etc): [SpigotMC](https://www.spigotmc.org/resources/85151/)
-* Fabric: [Modrinth](https://modrinth.com/mod/terra) / [CurseForge](https://www.curseforge.com/minecraft/mc-mods/terra-world-generator)
-* Forge **(ALPHA - NOT PRODUCTION-READY)**: [Modrinth](https://modrinth.com/mod/terra)
+* Paper+ servers (Paper, Tuinity, Purpur,
+ etc): [SpigotMC](https://www.spigotmc.org/resources/85151/)
+* Fabric: [Modrinth](https://modrinth.com/mod/terra)
+ / [CurseForge](https://www.curseforge.com/minecraft/mc-mods/terra-world-generator)
+* Forge **(ALPHA - NOT
+ PRODUCTION-READY)**: [Modrinth](https://modrinth.com/mod/terra)
/ [CurseForge](https://www.curseforge.com/minecraft/mc-mods/terra-world-generator)
## Building and Running Terra
-To build, simply run `./gradlew build` (`gradlew.bat build` on Windows). This will build all platforms, and produce JARs
-in `platforms//build/libs`
+To build, simply run `./gradlew build` (`gradlew.bat build` on Windows). This
+will build all platforms, and produce JARs in `platforms//build/libs`
### Production JARs:
@@ -32,10 +36,14 @@ JARs are produced in `platforms//build/libs`.
To run Minecraft with Terra in the IDE (for testing) use the following tasks:
* Bukkit
- * `installPaper` - Install a [Paper](https://github.com/PaperMC/Paper) test server. (Only needs to be run once).
- * `installPurpur` - Install a [Purpur](https://github.com/pl3xgaming/Purpur) test server. (Only needs to be run once).
- * `runPaper` - Run the Paper test server with Terra (`installPaper` must have been run previously).
- * `runPurpur` - Run the Purpur test server with Terra (`installPurpur` must have been run previously).
+ * `installPaper` - Install a [Paper](https://github.com/PaperMC/Paper) test
+ server. (Only needs to be run once).
+ * `installPurpur` - Install a [Purpur](https://github.com/pl3xgaming/Purpur)
+ test server. (Only needs to be run once).
+ * `runPaper` - Run the Paper test server with Terra (`installPaper` must
+ have been run previously).
+ * `runPurpur` - Run the Purpur test server with Terra (`installPurpur` must
+ have been run previously).
* Fabric
* `runClient` - Run a Minecraft Fabric client with Terra installed.
* `runServer` - Run a Minecraft Fabric server with Terra installed.
@@ -45,9 +53,12 @@ To run Minecraft with Terra in the IDE (for testing) use the following tasks:
## Contributing
-Contributions are welcome! If you want to see a feature in Terra, please, open an issue, or implement it yourself and submit a PR!
-Join the discord [here](https://discord.gg/PXUEbbF) if you would like to talk more about the project!
+Contributions are welcome! If you want to see a feature in Terra, please, open
+an issue, or implement it yourself and submit a PR!
+Join the discord [here](https://discord.gg/PXUEbbF) if you would like to talk
+more about the project!
## Beta
-Terra is still in beta! While it is stable, it is not feature-complete. There is a lot to be added!
+Terra is still in beta! While it is stable, it is not feature-complete. There is
+a lot to be added!
diff --git a/build.gradle.kts b/build.gradle.kts
index 414f3eb38..7d603aff7 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,28 +1,32 @@
-import com.dfsek.terra.*
+import com.dfsek.terra.configureCompilation
+import com.dfsek.terra.configureDependencies
+import com.dfsek.terra.configureDistribution
+import com.dfsek.terra.configurePublishing
+import com.dfsek.terra.getGitHash
val versionObj = Version("6", "0", "0", true)
allprojects {
version = versionObj
group = "com.dfsek.terra"
-
+
configureDependencies()
configureCompilation()
configurePublishing()
-
+
tasks.withType().configureEach {
options.isFork = true
options.isIncremental = true
}
-
+
tasks.withType().configureEach {
useJUnitPlatform()
-
+
maxHeapSize = "2G"
ignoreFailures = false
failFast = true
maxParallelForks = (Runtime.getRuntime().availableProcessors() - 1).takeIf { it > 0 } ?: 1
-
+
reports.html.required.set(false)
reports.junitXml.required.set(false)
}
@@ -39,7 +43,7 @@ afterEvaluate {
*/
@Suppress("MemberVisibilityCanBePrivate")
class Version(val major: String, val minor: String, val revision: String, val preRelease: Boolean = false) {
-
+
override fun toString(): String {
return if (!preRelease)
"$major.$minor.$revision"
diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt
index 71c6f587e..9602b51f3 100644
--- a/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt
+++ b/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt
@@ -1,10 +1,10 @@
package com.dfsek.terra
+import java.io.File
+import java.util.function.Predicate
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.jvm.tasks.Jar
-import java.io.File
-import java.util.function.Predicate
import kotlin.streams.asStream
@@ -22,13 +22,13 @@ fun Project.addonDir(dir: File, task: Task) {
}
project(":common:addons").subprojects.forEach { addonProject ->
val jar = (addonProject.tasks.named("jar").get() as Jar)
-
+
val target = File(dir, jar.archiveFileName.get())
-
+
val base = "${jar.archiveBaseName.get()}-${project.version}"
-
+
println("Copying addon ${jar.archiveFileName.get()} to ${target.absolutePath}. Base name: $base")
-
+
jar.archiveFile.orNull?.asFile?.copyTo(target)
}
}
diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/CommonConfig.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/CommonConfig.kt
index d252ecae7..5fe68f42d 100644
--- a/buildSrc/src/main/kotlin/com/dfsek/terra/CommonConfig.kt
+++ b/buildSrc/src/main/kotlin/com/dfsek/terra/CommonConfig.kt
@@ -1,7 +1,7 @@
package com.dfsek.terra
-import org.gradle.api.Project
import java.io.ByteArrayOutputStream
+import org.gradle.api.Project
fun Project.getGitHash(): String {
val stdout = ByteArrayOutputStream()
diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/CompilationConfig.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/CompilationConfig.kt
index 4872a5543..e38e85ee3 100644
--- a/buildSrc/src/main/kotlin/com/dfsek/terra/CompilationConfig.kt
+++ b/buildSrc/src/main/kotlin/com/dfsek/terra/CompilationConfig.kt
@@ -6,7 +6,12 @@ import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.api.tasks.javadoc.Javadoc
-import org.gradle.kotlin.dsl.*
+import org.gradle.kotlin.dsl.apply
+import org.gradle.kotlin.dsl.configure
+import org.gradle.kotlin.dsl.filter
+import org.gradle.kotlin.dsl.getByName
+import org.gradle.kotlin.dsl.register
+import org.gradle.kotlin.dsl.withType
import org.gradle.language.jvm.tasks.ProcessResources
fun Project.configureCompilation() {
@@ -14,46 +19,46 @@ fun Project.configureCompilation() {
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "idea")
-
+
configure {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
}
-
+
tasks.withType {
options.encoding = "UTF-8"
doFirst {
options.compilerArgs.add("-Xlint:all")
}
}
-
+
tasks.withType {
include("**/*.*")
filter(
- "tokens" to mapOf(
- "VERSION" to project.version.toString(),
- "DESCRIPTION" to project.properties["terra.description"],
- "WIKI" to project.properties["terra.wiki"],
- "SOURCE" to project.properties["terra.source"],
- "ISSUES" to project.properties["terra.issues"],
- "LICENSE" to project.properties["terra.license"]
- )
- )
+ "tokens" to mapOf(
+ "VERSION" to project.version.toString(),
+ "DESCRIPTION" to project.properties["terra.description"],
+ "WIKI" to project.properties["terra.wiki"],
+ "SOURCE" to project.properties["terra.source"],
+ "ISSUES" to project.properties["terra.issues"],
+ "LICENSE" to project.properties["terra.license"]
+ )
+ )
}
-
+
tasks.withType {
options.encoding = "UTF-8"
}
-
+
tasks.withType {
archiveBaseName.set("Terra-${archiveBaseName.get()}")
from("../LICENSE", "../../LICENSE")
}
-
+
tasks.register("sourcesJar") {
archiveClassifier.set("sources")
}
-
+
tasks.register("javadocJar") {
dependsOn("javadoc")
archiveClassifier.set("javadoc")
diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/DependencyConfig.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/DependencyConfig.kt
index 5dbb19755..c659676e6 100644
--- a/buildSrc/src/main/kotlin/com/dfsek/terra/DependencyConfig.kt
+++ b/buildSrc/src/main/kotlin/com/dfsek/terra/DependencyConfig.kt
@@ -1,12 +1,16 @@
package com.dfsek.terra
import org.gradle.api.Project
-import org.gradle.kotlin.dsl.*
+import org.gradle.kotlin.dsl.apply
+import org.gradle.kotlin.dsl.dependencies
+import org.gradle.kotlin.dsl.invoke
+import org.gradle.kotlin.dsl.project
+import org.gradle.kotlin.dsl.repositories
fun Project.configureDependencies() {
apply(plugin = "java")
apply(plugin = "java-library")
-
+
configurations {
val shaded = create("shaded")
val shadedApi = create("shadedApi")
@@ -16,7 +20,7 @@ fun Project.configureDependencies() {
shaded.extendsFrom(shadedImplementation)
getByName("implementation").extendsFrom(shadedImplementation)
}
-
+
repositories {
maven { url = uri("https://maven.enginehub.org/repo/") }
maven { url = uri("https://repo.codemc.org/repository/maven-public") }
@@ -25,16 +29,16 @@ fun Project.configureDependencies() {
gradlePluginPortal()
mavenCentral()
}
-
+
dependencies {
"testImplementation"("org.junit.jupiter:junit-jupiter-api:5.7.0")
"testImplementation"("org.junit.jupiter:junit-jupiter-engine:5.7.0")
"compileOnly"("org.jetbrains:annotations:20.1.0")
-
+
"compileOnly"("com.google.guava:guava:30.0-jre")
"testImplementation"("com.google.guava:guava:30.0-jre")
}
-
+
if (project(":common:addons").subprojects.contains(this)) { // If this is an addon project, depend on the API.
dependencies {
"compileOnly"(project(":common:api"))
diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/DistributionConfig.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/DistributionConfig.kt
index 2bd60d666..b527de9a3 100644
--- a/buildSrc/src/main/kotlin/com/dfsek/terra/DistributionConfig.kt
+++ b/buildSrc/src/main/kotlin/com/dfsek/terra/DistributionConfig.kt
@@ -1,6 +1,13 @@
package com.dfsek.terra
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+import java.io.File
+import java.io.FileInputStream
+import java.io.FileOutputStream
+import java.io.FileWriter
+import java.net.URL
+import java.util.zip.ZipEntry
+import java.util.zip.ZipOutputStream
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.plugins.BasePluginExtension
@@ -11,29 +18,22 @@ import org.gradle.kotlin.dsl.get
import org.gradle.kotlin.dsl.named
import org.yaml.snakeyaml.DumperOptions
import org.yaml.snakeyaml.Yaml
-import java.io.File
-import java.io.FileInputStream
-import java.io.FileOutputStream
-import java.io.FileWriter
-import java.net.URL
-import java.util.zip.ZipEntry
-import java.util.zip.ZipOutputStream
fun Project.configureDistribution() {
apply(plugin = "com.github.johnrengelman.shadow")
-
+
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
group = "terra"
doFirst {
file("${buildDir}/resources/main/packs/").deleteRecursively()
-
+
val defaultPackUrl = URL("https://github.com/PolyhedralDev/TerraDefaultConfig/releases/download/latest/default.zip")
downloadPack(defaultPackUrl, project)
val netherPackUrl = URL("https://github.com/PolyhedralDev/TerraDefaultConfig/releases/download/latest/nether.zip")
downloadPack(netherPackUrl, project)
}
}
-
+
val installAddons = tasks.create("installAddons") {
group = "terra"
project(":common:addons").subprojects.forEach {
@@ -41,7 +41,7 @@ fun Project.configureDistribution() {
dependsOn(it.tasks.getByName("build")) // Depend on addon JARs
}
}
-
+
doFirst {
// The addons are copied into a JAR because of a ShadowJar bug
// which expands *all* JARs, even resource ones, into the fat JAR.
@@ -52,13 +52,13 @@ fun Project.configureDistribution() {
// https://github.com/johnrengelman/shadow/issues/111
val dest = File(buildDir, "/resources/main/addons.jar")
dest.parentFile.mkdirs()
-
+
val zip = ZipOutputStream(FileOutputStream(dest))
-
+
project(":common:addons").subprojects.forEach { addonProject ->
val jar = (addonProject.tasks.named("jar").get() as Jar)
println("Packaging addon ${jar.archiveFileName.get()} to ${dest.absolutePath}.")
-
+
val entry = ZipEntry("addons/${jar.archiveFileName.get()}")
zip.putNextEntry(entry)
FileInputStream(jar.archiveFile.get().asFile).copyTo(zip)
@@ -67,7 +67,7 @@ fun Project.configureDistribution() {
zip.close()
}
}
-
+
val generateResourceManifest = tasks.create("generateResourceManifest") {
group = "terra"
dependsOn(downloadDefaultPacks)
@@ -75,24 +75,24 @@ fun Project.configureDistribution() {
doFirst {
val resources = HashMap>()
val packsDir = File("${project.buildDir}/resources/main/packs/")
-
+
packsDir.walkTopDown().forEach {
if (it.isDirectory || !it.name.endsWith(".zip")) return@forEach
resources.computeIfAbsent("packs") { ArrayList() }.add(it.name)
}
-
+
val langDir = File("${project(":common:implementation").buildDir}/resources/main/lang/")
-
+
langDir.walkTopDown().forEach {
if (it.isDirectory || !it.name.endsWith(".yml")) return@forEach
resources.computeIfAbsent("lang") { ArrayList() }.add(it.name)
}
-
+
project(":common:addons").subprojects.forEach { addonProject ->
val jar = (addonProject.tasks.named("jar").get() as Jar).archiveFileName.get()
resources.computeIfAbsent("addons") { ArrayList() }.add(jar)
}
-
+
val options = DumperOptions()
options.indent = 2
options.indentWithIndicator = true
@@ -100,25 +100,25 @@ fun Project.configureDistribution() {
options.isPrettyFlow = true
options.defaultFlowStyle = DumperOptions.FlowStyle.BLOCK
options.defaultScalarStyle = DumperOptions.ScalarStyle.DOUBLE_QUOTED
-
+
val yaml = Yaml(options)
-
+
val manifest = File("${project.buildDir}/resources/main/resources.yml")
-
+
if (manifest.exists()) manifest.delete()
manifest.createNewFile()
yaml.dump(resources, FileWriter(manifest))
}
}
-
+
tasks["processResources"].dependsOn(generateResourceManifest)
-
+
tasks.named("shadowJar") {
// Tell shadow to download the packs
dependsOn(downloadDefaultPacks)
-
+
configurations = listOf(project.configurations["shaded"])
-
+
archiveClassifier.set("shaded")
setVersion(project.version)
relocate("org.apache.commons", "com.dfsek.terra.lib.commons")
@@ -126,11 +126,11 @@ fun Project.configureDistribution() {
relocate("org.json", "com.dfsek.terra.lib.json")
relocate("org.yaml", "com.dfsek.terra.lib.yaml")
}
-
+
configure {
archivesName.set(project.name)
}
-
+
tasks.named("build") {
dependsOn(tasks["shadowJar"])
}
diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/PublishingConfig.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/PublishingConfig.kt
index 7742a85bb..2fa6a3a3b 100644
--- a/buildSrc/src/main/kotlin/com/dfsek/terra/PublishingConfig.kt
+++ b/buildSrc/src/main/kotlin/com/dfsek/terra/PublishingConfig.kt
@@ -3,7 +3,11 @@ package com.dfsek.terra
import org.gradle.api.Project
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
-import org.gradle.kotlin.dsl.*
+import org.gradle.kotlin.dsl.configure
+import org.gradle.kotlin.dsl.create
+import org.gradle.kotlin.dsl.get
+import org.gradle.kotlin.dsl.maven
+import org.gradle.kotlin.dsl.provideDelegate
fun Project.configurePublishing() {
configure {
@@ -13,11 +17,11 @@ fun Project.configurePublishing() {
artifact(tasks["jar"])
}
}
-
+
repositories {
val mavenUrl = "https://repo.codemc.io/repository/maven-releases/"
//val mavenSnapshotUrl = "https://repo.codemc.io/repository/maven-snapshots/"
-
+
maven(mavenUrl) {
val mavenUsername: String? by project
val mavenPassword: String? by project
diff --git a/common/addons/README.md b/common/addons/README.md
index cea224814..1ee000423 100644
--- a/common/addons/README.md
+++ b/common/addons/README.md
@@ -1,3 +1,4 @@
# Core Addons
-This directory contains the modularized "core addons" that implement Terra's default behavior.
\ No newline at end of file
+This directory contains the modularized "core addons" that implement Terra's
+default behavior.
\ No newline at end of file
diff --git a/common/addons/api-features/README.md b/common/addons/api-features/README.md
index e570ff02c..7c8ba1834 100644
--- a/common/addons/api-features/README.md
+++ b/common/addons/api-features/README.md
@@ -1,8 +1,10 @@
# api-features
+
Contains the API for feature generation.
This API implemented in:
- * `config-feature`
- * `generation-stage-feature`
- * `config-locators`
- * `config-distributors`
\ No newline at end of file
+
+* `config-feature`
+* `generation-stage-feature`
+* `config-locators`
+* `config-distributors`
\ No newline at end of file
diff --git a/common/addons/biome-provider-image/README.md b/common/addons/biome-provider-image/README.md
index f659e1bb1..49e9b8fdb 100644
--- a/common/addons/biome-provider-image/README.md
+++ b/common/addons/biome-provider-image/README.md
@@ -1,6 +1,6 @@
# biome-provider-image
-Implements and registers the `IMAGE` biome provider, a biome provider which generates
-biomes from an image, using the `color` attribute of biomes.
+Implements and registers the `IMAGE` biome provider, a biome provider which
+generates biomes from an image, using the `color` attribute of biomes.
This addon registers the provider type, and all associated config options.
\ No newline at end of file
diff --git a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProvider.java b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProvider.java
index 5f609e206..3ba0cb9ba 100644
--- a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProvider.java
+++ b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProvider.java
@@ -1,57 +1,64 @@
package com.dfsek.terra.addons.biome.image;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import net.jafama.FastMath;
-import java.awt.*;
+import java.awt.Color;
import java.awt.image.BufferedImage;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import com.dfsek.terra.api.world.biome.TerraBiome;
+import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
+
+
public class ImageBiomeProvider implements BiomeProvider {
private final Map colorBiomeMap = new HashMap<>();
private final BufferedImage image;
private final int resolution;
private final Align align;
-
+
public ImageBiomeProvider(Set registry, BufferedImage image, int resolution, Align align) {
this.image = image;
this.resolution = resolution;
this.align = align;
registry.forEach(biome -> colorBiomeMap.put(new Color(biome.getColor()), biome));
}
-
+
private static int distance(Color a, Color b) {
return FastMath.abs(a.getRed() - b.getRed()) + FastMath.abs(a.getGreen() - b.getGreen()) + FastMath.abs(a.getBlue() - b.getBlue());
}
-
+
@Override
public TerraBiome getBiome(int x, int z, long seed) {
x /= resolution;
z /= resolution;
Color color = align.getColor(image, x, z);
- return colorBiomeMap.get(colorBiomeMap.keySet().stream().reduce(colorBiomeMap.keySet().stream().findAny().orElseThrow(IllegalStateException::new), (running, element) -> {
- int d1 = distance(color, running);
- int d2 = distance(color, element);
- return d1 < d2 ? running : element;
- }));
+ return colorBiomeMap.get(colorBiomeMap.keySet()
+ .stream()
+ .reduce(colorBiomeMap.keySet().stream().findAny().orElseThrow(IllegalStateException::new),
+ (running, element) -> {
+ int d1 = distance(color, running);
+ int d2 = distance(color, element);
+ return d1 < d2 ? running : element;
+ }));
}
-
+
public enum Align {
CENTER {
@Override
public Color getColor(BufferedImage image, int x, int z) {
- return new Color(image.getRGB(FastMath.floorMod(x - image.getWidth() / 2, image.getWidth()), FastMath.floorMod(z - image.getHeight() / 2, image.getHeight())));
+ return new Color(image.getRGB(FastMath.floorMod(x - image.getWidth() / 2, image.getWidth()),
+ FastMath.floorMod(z - image.getHeight() / 2, image.getHeight())));
}
- }, NONE {
+ },
+ NONE {
@Override
public Color getColor(BufferedImage image, int x, int z) {
return new Color(image.getRGB(FastMath.floorMod(x, image.getWidth()), FastMath.floorMod(z, image.getHeight())));
}
};
-
+
public abstract Color getColor(BufferedImage image, int x, int z);
}
}
diff --git a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProviderAddon.java b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProviderAddon.java
index 566abff80..94c0b8984 100644
--- a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProviderAddon.java
+++ b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProviderAddon.java
@@ -1,6 +1,9 @@
package com.dfsek.terra.addons.biome.image;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
+
+import java.util.function.Supplier;
+
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.addon.TerraAddon;
import com.dfsek.terra.api.addon.annotations.Addon;
@@ -14,26 +17,27 @@ import com.dfsek.terra.api.util.reflection.TypeKey;
import com.dfsek.terra.api.world.biome.TerraBiome;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import java.util.function.Supplier;
@Addon("biome-provider-image")
@Author("Terra")
@Version("1.0.0")
public class ImageBiomeProviderAddon extends TerraAddon {
- public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {};
-
+ public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
+ };
+
@Inject
private TerraPlugin main;
-
+
@Override
public void initialize() {
main.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(PROVIDER_REGISTRY_KEY);
- providerRegistry.register("IMAGE", () -> new ImageProviderTemplate(event.getPack().getRegistry(TerraBiome.class)));
- })
- .failThrough();
+ .getHandler(FunctionalEventHandler.class)
+ .register(this, ConfigPackPreLoadEvent.class)
+ .then(event -> {
+ CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(
+ PROVIDER_REGISTRY_KEY);
+ providerRegistry.register("IMAGE", () -> new ImageProviderTemplate(event.getPack().getRegistry(TerraBiome.class)));
+ })
+ .failThrough();
}
}
diff --git a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageProviderTemplate.java b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageProviderTemplate.java
index 70ad46589..877697c9e 100644
--- a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageProviderTemplate.java
+++ b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageProviderTemplate.java
@@ -3,29 +3,29 @@ package com.dfsek.terra.addons.biome.image;
import com.dfsek.tectonic.annotations.Default;
import com.dfsek.tectonic.annotations.Value;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
-import com.dfsek.terra.api.registry.Registry;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import java.awt.image.BufferedImage;
import java.util.HashSet;
+import com.dfsek.terra.api.registry.Registry;
+import com.dfsek.terra.api.world.biome.TerraBiome;
+import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
+
+
public class ImageProviderTemplate implements ObjectTemplate {
private final Registry biomes;
- @Value("image.name")
- private BufferedImage image;
-
- @Value("image.align")
- private ImageBiomeProvider.Align align;
-
@Value("resolution")
@Default
- private int resolution = 1;
-
+ private final int resolution = 1;
+ @Value("image.name")
+ private BufferedImage image;
+ @Value("image.align")
+ private ImageBiomeProvider.Align align;
+
public ImageProviderTemplate(Registry set) {
this.biomes = set;
}
-
+
@Override
public BiomeProvider get() {
return new ImageBiomeProvider(new HashSet<>(biomes.entries()), image, resolution, align);
diff --git a/common/addons/biome-provider-pipeline/README.md b/common/addons/biome-provider-pipeline/README.md
index 0326bcf6e..9e55109a7 100644
--- a/common/addons/biome-provider-pipeline/README.md
+++ b/common/addons/biome-provider-pipeline/README.md
@@ -3,5 +3,5 @@
Implements the Biome Pipeline, a procedural biome provider that uses a series
of "stages" to apply "mutations" to a 2D grid of biomes.
-
-This addon registers the `PIPELINE` biome provider type, and all associated configurations.
\ No newline at end of file
+This addon registers the `PIPELINE` biome provider type, and all associated
+configurations.
\ No newline at end of file
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomeHolderImpl.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomeHolderImpl.java
index 3044cd1b9..ac1fa6be5 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomeHolderImpl.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomeHolderImpl.java
@@ -3,16 +3,17 @@ package com.dfsek.terra.addons.biome.pipeline;
import com.dfsek.terra.addons.biome.pipeline.api.BiomeExpander;
import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
+import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
import com.dfsek.terra.api.vector.Vector2;
import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
+
public class BiomeHolderImpl implements BiomeHolder {
private final Vector2 origin;
private final int width;
private final int offset;
private TerraBiome[][] biomes;
-
+
public BiomeHolderImpl(int width, Vector2 origin) {
width += 4;
this.width = width;
@@ -20,35 +21,38 @@ public class BiomeHolderImpl implements BiomeHolder {
this.origin = origin;
this.offset = 2;
}
-
+
private BiomeHolderImpl(TerraBiome[][] biomes, Vector2 origin, int width, int offset) {
this.biomes = biomes;
this.origin = origin;
this.width = width;
this.offset = 2 * offset;
}
-
+
@Override
public BiomeHolder expand(BiomeExpander expander, long seed) {
TerraBiome[][] old = biomes;
int newWidth = width * 2 - 1;
-
+
biomes = new TerraBiome[newWidth][newWidth];
-
+
for(int x = 0; x < width; x++) {
for(int z = 0; z < width; z++) {
biomes[x * 2][z * 2] = old[x][z];
if(z != width - 1)
- biomes[x * 2][z * 2 + 1] = expander.getBetween(x + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z], old[x][z + 1]);
+ biomes[x * 2][z * 2 + 1] = expander.getBetween(x + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z],
+ old[x][z + 1]);
if(x != width - 1)
- biomes[x * 2 + 1][z * 2] = expander.getBetween(x + 1 + origin.getX(), z + origin.getZ(), seed, old[x][z], old[x + 1][z]);
+ biomes[x * 2 + 1][z * 2] = expander.getBetween(x + 1 + origin.getX(), z + origin.getZ(), seed, old[x][z],
+ old[x + 1][z]);
if(x != width - 1 && z != width - 1)
- biomes[x * 2 + 1][z * 2 + 1] = expander.getBetween(x + 1 + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z], old[x + 1][z + 1], old[x][z + 1], old[x + 1][z]);
+ biomes[x * 2 + 1][z * 2 + 1] = expander.getBetween(x + 1 + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z],
+ old[x + 1][z + 1], old[x][z + 1], old[x + 1][z]);
}
}
return new BiomeHolderImpl(biomes, origin.setX(origin.getX() * 2 - 1).setZ(origin.getZ() * 2 - 1), newWidth, offset);
}
-
+
@Override
public void mutate(BiomeMutator mutator, long seed) {
for(int x = 0; x < width; x++) {
@@ -58,7 +62,7 @@ public class BiomeHolderImpl implements BiomeHolder {
}
}
}
-
+
@Override
public void fill(BiomeSource source, long seed) {
for(int x = 0; x < width; x++) {
@@ -67,14 +71,14 @@ public class BiomeHolderImpl implements BiomeHolder {
}
}
}
-
+
@Override
public TerraBiome getBiome(int x, int z) {
x += offset;
z += offset;
return getBiomeRaw(x, z);
}
-
+
@Override
public TerraBiome getBiomeRaw(int x, int z) {
if(x >= width || z >= width || x < 0 || z < 0) return null;
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipeline.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipeline.java
index d5266bb15..122767773 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipeline.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipeline.java
@@ -1,31 +1,33 @@
package com.dfsek.terra.addons.biome.pipeline;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.api.vector.Vector2;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-
import java.util.ArrayList;
import java.util.List;
+import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
+import com.dfsek.terra.addons.biome.pipeline.api.Stage;
+import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
+import com.dfsek.terra.api.vector.Vector2;
+
+
public class BiomePipeline {
private final BiomeSource source;
private final List stages;
private final int size;
private final int init;
-
+
private BiomePipeline(BiomeSource source, List stages, int size, int init) {
this.source = source;
this.stages = stages;
this.size = size;
this.init = init;
}
-
+
/**
* Get biomes in a chunk
*
* @param x Chunk X coord
* @param z Chunk Z coord
+ *
* @return BiomeHolder containing biomes.
*/
public BiomeHolder getBiomes(int x, int z, long seed) {
@@ -34,29 +36,29 @@ public class BiomePipeline {
for(Stage stage : stages) holder = stage.apply(holder, seed);
return holder;
}
-
+
public int getSize() {
return size;
}
-
+
public static final class BiomePipelineBuilder {
private final int init;
List stages = new ArrayList<>();
private int expand;
-
+
public BiomePipelineBuilder(int init) {
this.init = init;
expand = init;
}
-
+
public BiomePipeline build(BiomeSource source) {
for(Stage stage : stages) {
if(stage.isExpansion()) expand = expand * 2 - 1;
}
-
+
return new BiomePipeline(source, stages, expand, init);
}
-
+
public BiomePipelineBuilder addStage(Stage stage) {
stages.add(stage);
return this;
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineAddon.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineAddon.java
index 539723a67..b7ecae266 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineAddon.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineAddon.java
@@ -1,9 +1,11 @@
package com.dfsek.terra.addons.biome.pipeline;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
+
+import java.util.function.Supplier;
+
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.config.BiomePipelineTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.BiomeProviderLoader;
import com.dfsek.terra.addons.biome.pipeline.config.NoiseSourceTemplate;
import com.dfsek.terra.addons.biome.pipeline.config.stage.expander.ExpanderStageTemplate;
import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.BorderListMutatorTemplate;
@@ -11,6 +13,7 @@ import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.BorderMutatorT
import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.ReplaceListMutatorTemplate;
import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.ReplaceMutatorTemplate;
import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.SmoothMutatorTemplate;
+import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.addon.TerraAddon;
import com.dfsek.terra.api.addon.annotations.Addon;
@@ -22,44 +25,47 @@ import com.dfsek.terra.api.injection.annotations.Inject;
import com.dfsek.terra.api.registry.CheckedRegistry;
import com.dfsek.terra.api.util.reflection.TypeKey;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-import java.util.function.Supplier;
@Addon("biome-provider-pipeline")
@Author("Terra")
@Version("1.0.0")
public class BiomePipelineAddon extends TerraAddon {
-
- public static final TypeKey>> SOURCE_REGISTRY_KEY = new TypeKey<>() {};
-
- public static final TypeKey>> STAGE_REGISTRY_KEY = new TypeKey<>() {};
- public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {};
+
+ public static final TypeKey>> SOURCE_REGISTRY_KEY = new TypeKey<>() {
+ };
+
+ public static final TypeKey>> STAGE_REGISTRY_KEY = new TypeKey<>() {
+ };
+ public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
+ };
@Inject
private TerraPlugin main;
-
+
@Override
public void initialize() {
main.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(PROVIDER_REGISTRY_KEY);
- providerRegistry.register("PIPELINE", () -> new BiomePipelineTemplate(main));
- })
- .then(event -> {
- CheckedRegistry>> sourceRegistry = event.getPack().getOrCreateRegistry(SOURCE_REGISTRY_KEY);
- sourceRegistry.register("NOISE", NoiseSourceTemplate::new);
- })
- .then(event -> {
- CheckedRegistry>> stageRegistry = event.getPack().getOrCreateRegistry(STAGE_REGISTRY_KEY);
- stageRegistry.register("FRACTAL_EXPAND", ExpanderStageTemplate::new);
- stageRegistry.register("SMOOTH", SmoothMutatorTemplate::new);
- stageRegistry.register("REPLACE", ReplaceMutatorTemplate::new);
- stageRegistry.register("REPLACE_LIST", ReplaceListMutatorTemplate::new);
- stageRegistry.register("BORDER", BorderMutatorTemplate::new);
- stageRegistry.register("BORDER_LIST", BorderListMutatorTemplate::new);
- })
- .failThrough();
+ .getHandler(FunctionalEventHandler.class)
+ .register(this, ConfigPackPreLoadEvent.class)
+ .then(event -> {
+ CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(
+ PROVIDER_REGISTRY_KEY);
+ providerRegistry.register("PIPELINE", () -> new BiomePipelineTemplate(main));
+ })
+ .then(event -> {
+ CheckedRegistry>> sourceRegistry = event.getPack().getOrCreateRegistry(
+ SOURCE_REGISTRY_KEY);
+ sourceRegistry.register("NOISE", NoiseSourceTemplate::new);
+ })
+ .then(event -> {
+ CheckedRegistry>> stageRegistry = event.getPack().getOrCreateRegistry(STAGE_REGISTRY_KEY);
+ stageRegistry.register("FRACTAL_EXPAND", ExpanderStageTemplate::new);
+ stageRegistry.register("SMOOTH", SmoothMutatorTemplate::new);
+ stageRegistry.register("REPLACE", ReplaceMutatorTemplate::new);
+ stageRegistry.register("REPLACE_LIST", ReplaceListMutatorTemplate::new);
+ stageRegistry.register("BORDER", BorderMutatorTemplate::new);
+ stageRegistry.register("BORDER_LIST", BorderListMutatorTemplate::new);
+ })
+ .failThrough();
}
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineProvider.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineProvider.java
index 21aa51e6e..542603188 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineProvider.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineProvider.java
@@ -1,15 +1,17 @@
package com.dfsek.terra.addons.biome.pipeline;
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import net.jafama.FastMath;
+import org.jetbrains.annotations.NotNull;
+
import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.world.biome.TerraBiome;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import net.jafama.FastMath;
-import org.jetbrains.annotations.NotNull;
+
public class BiomePipelineProvider implements BiomeProvider {
private final LoadingCache holderCache;
@@ -17,50 +19,51 @@ public class BiomePipelineProvider implements BiomeProvider {
private final int resolution;
private final NoiseSampler mutator;
private final double noiseAmp;
-
+
public BiomePipelineProvider(BiomePipeline pipeline, TerraPlugin main, int resolution, NoiseSampler mutator, double noiseAmp) {
this.resolution = resolution;
this.mutator = mutator;
this.noiseAmp = noiseAmp;
holderCache = CacheBuilder.newBuilder()
- .maximumSize(main == null ? 32 : main.getTerraConfig().getProviderCache())
- .build(
- new CacheLoader() {
- @Override
- public BiomeHolder load(@NotNull SeededVector key) {
- return pipeline.getBiomes(key.x, key.z, key.seed);
- }
- }
- );
+ .maximumSize(main == null ? 32 : main.getTerraConfig().getProviderCache())
+ .build(
+ new CacheLoader() {
+ @Override
+ public BiomeHolder load(@NotNull SeededVector key) {
+ return pipeline.getBiomes(key.x, key.z, key.seed);
+ }
+ }
+ );
this.pipeline = pipeline;
}
-
+
@Override
public TerraBiome getBiome(int x, int z, long seed) {
x += mutator.getNoiseSeeded(seed + 1, x, z) * noiseAmp;
z += mutator.getNoiseSeeded(seed + 2, x, z) * noiseAmp;
-
-
+
+
x = FastMath.floorToInt(FastMath.floorDiv(x, resolution));
-
+
z = FastMath.floorToInt(FastMath.floorDiv(z, resolution));
-
+
int fdX = FastMath.floorDiv(x, pipeline.getSize());
int fdZ = FastMath.floorDiv(z, pipeline.getSize());
- return holderCache.getUnchecked(new SeededVector(fdX, fdZ, seed)).getBiome(x - fdX * pipeline.getSize(), z - fdZ * pipeline.getSize());
+ return holderCache.getUnchecked(new SeededVector(fdX, fdZ, seed)).getBiome(x - fdX * pipeline.getSize(),
+ z - fdZ * pipeline.getSize());
}
-
+
private static final class SeededVector {
private final int x;
private final int z;
private final long seed;
-
+
private SeededVector(int x, int z, long seed) {
this.x = x;
this.z = z;
this.seed = seed;
}
-
+
@Override
public int hashCode() {
int result = 0;
@@ -69,12 +72,12 @@ public class BiomePipelineProvider implements BiomeProvider {
result = 31 * result + z;
return result;
}
-
+
@Override
public boolean equals(Object obj) {
if(!(obj instanceof SeededVector)) return false;
SeededVector that = (SeededVector) obj;
-
+
return this.seed == that.seed && this.x == that.x && this.z == that.z;
}
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeExpander.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeExpander.java
index 39bc22f73..462f8ebec 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeExpander.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeExpander.java
@@ -2,6 +2,7 @@ package com.dfsek.terra.addons.biome.pipeline.api;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
public interface BiomeExpander {
TerraBiome getBetween(double x, double z, long seed, TerraBiome... others);
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeHolder.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeHolder.java
index 1d57ba616..bf88c46e2 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeHolder.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeHolder.java
@@ -1,16 +1,17 @@
package com.dfsek.terra.addons.biome.pipeline.api;
-import com.dfsek.terra.api.world.biome.TerraBiome;
import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
+import com.dfsek.terra.api.world.biome.TerraBiome;
+
public interface BiomeHolder {
BiomeHolder expand(BiomeExpander expander, long seed);
-
+
void mutate(BiomeMutator mutator, long seed);
-
+
void fill(BiomeSource source, long seed);
-
+
TerraBiome getBiome(int x, int z);
-
+
TerraBiome getBiomeRaw(int x, int z);
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeMutator.java
index 547409b5a..fab417815 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeMutator.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeMutator.java
@@ -2,21 +2,22 @@ package com.dfsek.terra.addons.biome.pipeline.api;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
public interface BiomeMutator {
TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed);
-
+
class ViewPoint {
private final BiomeHolder biomes;
private final int offX;
private final int offZ;
-
+
public ViewPoint(BiomeHolder biomes, int offX, int offZ) {
this.biomes = biomes;
this.offX = offX;
this.offZ = offZ;
}
-
-
+
+
public TerraBiome getBiome(int x, int z) {
return biomes.getBiomeRaw(x + offX, z + offZ);
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/Stage.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/Stage.java
index dbf9f2722..af00308c3 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/Stage.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/Stage.java
@@ -1,8 +1,8 @@
package com.dfsek.terra.addons.biome.pipeline.api;
public interface Stage {
- boolean isExpansion();
-
BiomeHolder apply(BiomeHolder in, long seed);
-
+
+ boolean isExpansion();
+
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java
index bc35d9a01..11bc53417 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java
@@ -2,33 +2,35 @@ package com.dfsek.terra.addons.biome.pipeline.config;
import com.dfsek.tectonic.annotations.Default;
import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.terra.addons.biome.pipeline.BiomePipeline;
-import com.dfsek.terra.addons.biome.pipeline.BiomePipelineProvider;
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.api.TerraPlugin;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
import java.util.List;
-@SuppressWarnings({"FieldMayBeFinal", "unused"})
+import com.dfsek.terra.addons.biome.pipeline.BiomePipeline;
+import com.dfsek.terra.addons.biome.pipeline.BiomePipelineProvider;
+import com.dfsek.terra.addons.biome.pipeline.api.Stage;
+import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
+import com.dfsek.terra.api.TerraPlugin;
+import com.dfsek.terra.api.config.meta.Meta;
+import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
+
+
+@SuppressWarnings({ "FieldMayBeFinal", "unused" })
public class BiomePipelineTemplate extends BiomeProviderTemplate {
private final TerraPlugin main;
@Value("pipeline.initial-size")
@Default
private @Meta int initialSize = 2;
-
+
@Value("pipeline.stages")
private @Meta List<@Meta Stage> stages;
-
+
@Value("pipeline.source")
private @Meta BiomeSource source;
-
+
public BiomePipelineTemplate(TerraPlugin main) {
this.main = main;
}
-
+
@Override
public BiomeProvider get() {
BiomePipeline.BiomePipelineBuilder biomePipelineBuilder = new BiomePipeline.BiomePipelineBuilder(initialSize);
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderLoader.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderLoader.java
index 2d181efe7..a254082ca 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderLoader.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderLoader.java
@@ -3,10 +3,12 @@ package com.dfsek.terra.addons.biome.pipeline.config;
import com.dfsek.tectonic.exception.LoadException;
import com.dfsek.tectonic.loading.ConfigLoader;
import com.dfsek.tectonic.loading.TypeLoader;
+
+import java.lang.reflect.AnnotatedType;
+
import com.dfsek.terra.addons.biome.pipeline.BiomePipelineProvider;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import java.lang.reflect.AnnotatedType;
public class BiomeProviderLoader implements TypeLoader {
@Override
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java
index fc8909455..c1aa496cb 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java
@@ -3,10 +3,12 @@ package com.dfsek.terra.addons.biome.pipeline.config;
import com.dfsek.tectonic.annotations.Default;
import com.dfsek.tectonic.annotations.Value;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
+
import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
+
public abstract class BiomeProviderTemplate implements ObjectTemplate {
@Value("resolution")
@Default
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/NoiseSourceTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/NoiseSourceTemplate.java
index 042253fe6..627146800 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/NoiseSourceTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/NoiseSourceTemplate.java
@@ -1,20 +1,22 @@
package com.dfsek.terra.addons.biome.pipeline.config;
import com.dfsek.tectonic.annotations.Value;
+
+import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
import com.dfsek.terra.addons.biome.pipeline.source.NoiseSource;
import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
+
public class NoiseSourceTemplate extends SourceTemplate {
@Value("noise")
private @Meta NoiseSampler noise;
-
+
@Value("biomes")
private @Meta ProbabilityCollection<@Meta TerraBiome> biomes;
-
+
@Override
public BiomeSource get() {
return new NoiseSource(biomes, noise);
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java
index c9a41e949..831ca3d88 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java
@@ -1,8 +1,10 @@
package com.dfsek.terra.addons.biome.pipeline.config;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
+
import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-public abstract class SourceTemplate implements ObjectTemplate{
+
+public abstract class SourceTemplate implements ObjectTemplate {
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/StageTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/StageTemplate.java
index 4aba4990f..4b491e482 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/StageTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/StageTemplate.java
@@ -2,12 +2,12 @@ package com.dfsek.terra.addons.biome.pipeline.config.stage;
import com.dfsek.tectonic.annotations.Value;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
+
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage;
import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.noise.NoiseSampler;
+
public abstract class StageTemplate implements ObjectTemplate {
@Value("noise")
protected @Meta NoiseSampler noise;
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java
index 6ccf0e9af..ea74a303a 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java
@@ -5,6 +5,7 @@ import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.expand.FractalExpander;
import com.dfsek.terra.addons.biome.pipeline.stages.ExpanderStage;
+
public class ExpanderStageTemplate extends StageTemplate {
@Override
public Stage get() {
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderListMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderListMutatorTemplate.java
index a65e181d6..136243bc2 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderListMutatorTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderListMutatorTemplate.java
@@ -1,6 +1,9 @@
package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
import com.dfsek.tectonic.annotations.Value;
+
+import java.util.Map;
+
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.mutator.BorderListMutator;
@@ -9,23 +12,22 @@ import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
-import java.util.Map;
@SuppressWarnings("unused")
public class BorderListMutatorTemplate extends StageTemplate {
@Value("from")
private @Meta String from;
-
+
@Value("default-replace")
private @Meta String defaultReplace;
-
+
@Value("default-to")
private @Meta ProbabilityCollection<@Meta TerraBiome> defaultTo;
-
+
@Value("replace")
private @Meta Map<@Meta TerraBiome, @Meta ProbabilityCollection<@Meta TerraBiome>> replace;
-
-
+
+
@Override
public Stage get() {
return new MutatorStage(new BorderListMutator(replace, from, defaultReplace, noise, defaultTo));
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderMutatorTemplate.java
index 786b54dc8..6632bf6bb 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderMutatorTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderMutatorTemplate.java
@@ -1,7 +1,7 @@
package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
+
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.mutator.BorderMutator;
@@ -10,17 +10,18 @@ import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
@SuppressWarnings("unused")
public class BorderMutatorTemplate extends StageTemplate {
@Value("from")
private @Meta String from;
-
+
@Value("replace")
private @Meta String replace;
-
+
@Value("to")
private @Meta ProbabilityCollection<@Meta TerraBiome> to;
-
+
@Override
public Stage get() {
return new MutatorStage(new BorderMutator(from, replace, noise, to));
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceListMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceListMutatorTemplate.java
index bdd22ade9..5a21ec95b 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceListMutatorTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceListMutatorTemplate.java
@@ -1,7 +1,9 @@
package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
+
+import java.util.Map;
+
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.mutator.ReplaceListMutator;
@@ -10,19 +12,18 @@ import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
-import java.util.Map;
@SuppressWarnings("unused")
public class ReplaceListMutatorTemplate extends StageTemplate {
@Value("default-from")
private @Meta String defaultFrom;
-
+
@Value("default-to")
private @Meta ProbabilityCollection<@Meta TerraBiome> defaultTo;
-
+
@Value("to")
private @Meta Map<@Meta TerraBiome, @Meta ProbabilityCollection<@Meta TerraBiome>> replace;
-
+
@Override
public Stage get() {
return new MutatorStage(new ReplaceListMutator(replace, defaultFrom, defaultTo, noise));
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceMutatorTemplate.java
index ea59bd3d8..6dd7196c2 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceMutatorTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceMutatorTemplate.java
@@ -1,7 +1,7 @@
package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
+
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.mutator.ReplaceMutator;
@@ -10,14 +10,15 @@ import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
@SuppressWarnings("unused")
public class ReplaceMutatorTemplate extends StageTemplate {
@Value("from")
private @Meta String from;
-
+
@Value("to")
private @Meta ProbabilityCollection<@Meta TerraBiome> to;
-
+
@Override
public Stage get() {
return new MutatorStage(new ReplaceMutator(from, to, noise));
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java
index 77e23c100..400779433 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java
@@ -1,11 +1,11 @@
package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
import com.dfsek.terra.addons.biome.pipeline.mutator.SmoothMutator;
import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage;
+
public class SmoothMutatorTemplate extends StageTemplate {
@Override
public Stage get() {
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/expand/FractalExpander.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/expand/FractalExpander.java
index 894d2a86a..39050c873 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/expand/FractalExpander.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/expand/FractalExpander.java
@@ -5,13 +5,14 @@ import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.MathUtil;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
public class FractalExpander implements BiomeExpander {
private final NoiseSampler sampler;
-
+
public FractalExpander(NoiseSampler sampler) {
this.sampler = sampler;
}
-
+
@Override
public TerraBiome getBetween(double x, double z, long seed, TerraBiome... others) {
return others[MathUtil.normalizeIndex(sampler.getNoiseSeeded(seed, x, z), others.length)];
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderListMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderListMutator.java
index 53273973e..ff8570001 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderListMutator.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderListMutator.java
@@ -1,11 +1,12 @@
package com.dfsek.terra.addons.biome.pipeline.mutator;
+import java.util.Map;
+
import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
-import java.util.Map;
public class BorderListMutator implements BiomeMutator {
private final String border;
@@ -13,15 +14,16 @@ public class BorderListMutator implements BiomeMutator {
private final ProbabilityCollection replaceDefault;
private final String defaultReplace;
private final Map> replace;
-
- public BorderListMutator(Map> replace, String border, String defaultReplace, NoiseSampler noiseSampler, ProbabilityCollection replaceDefault) {
+
+ public BorderListMutator(Map> replace, String border, String defaultReplace,
+ NoiseSampler noiseSampler, ProbabilityCollection replaceDefault) {
this.border = border;
this.noiseSampler = noiseSampler;
this.replaceDefault = replaceDefault;
this.defaultReplace = defaultReplace;
this.replace = replace;
}
-
+
@Override
public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
TerraBiome origin = viewPoint.getBiome(0, 0);
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderMutator.java
index dfd54aa9c..6bd5c39c8 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderMutator.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderMutator.java
@@ -5,19 +5,20 @@ import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
public class BorderMutator implements BiomeMutator {
private final String border;
private final NoiseSampler noiseSampler;
private final ProbabilityCollection replace;
private final String replaceTag;
-
+
public BorderMutator(String border, String replaceTag, NoiseSampler noiseSampler, ProbabilityCollection replace) {
this.border = border;
this.noiseSampler = noiseSampler;
this.replace = replace;
this.replaceTag = replaceTag;
}
-
+
@Override
public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
TerraBiome origin = viewPoint.getBiome(0, 0);
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceListMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceListMutator.java
index 8bdb314b8..4712d41a7 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceListMutator.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceListMutator.java
@@ -1,25 +1,27 @@
package com.dfsek.terra.addons.biome.pipeline.mutator;
+import java.util.Map;
+
import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
-import java.util.Map;
public class ReplaceListMutator implements BiomeMutator {
private final Map> replace;
private final NoiseSampler sampler;
private final ProbabilityCollection replaceDefault;
private final String defaultTag;
-
- public ReplaceListMutator(Map> replace, String defaultTag, ProbabilityCollection replaceDefault, NoiseSampler sampler) {
+
+ public ReplaceListMutator(Map> replace, String defaultTag,
+ ProbabilityCollection replaceDefault, NoiseSampler sampler) {
this.replace = replace;
this.sampler = sampler;
this.defaultTag = defaultTag;
this.replaceDefault = replaceDefault;
}
-
+
@Override
public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
TerraBiome center = viewPoint.getBiome(0, 0);
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceMutator.java
index ec1c7437c..df77f796d 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceMutator.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceMutator.java
@@ -5,17 +5,18 @@ import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
public class ReplaceMutator implements BiomeMutator {
private final String replaceableTag;
private final ProbabilityCollection replace;
private final NoiseSampler sampler;
-
+
public ReplaceMutator(String replaceable, ProbabilityCollection replace, NoiseSampler sampler) {
this.replaceableTag = replaceable;
this.replace = replace;
this.sampler = sampler;
}
-
+
@Override
public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
if(viewPoint.getBiome(0, 0).getTags().contains(replaceableTag)) {
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/SmoothMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/SmoothMutator.java
index ac1c7c8a0..3ac06370c 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/SmoothMutator.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/SmoothMutator.java
@@ -1,38 +1,39 @@
package com.dfsek.terra.addons.biome.pipeline.mutator;
+import java.util.Objects;
+
import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.MathUtil;
import com.dfsek.terra.api.world.biome.TerraBiome;
-import java.util.Objects;
public class SmoothMutator implements BiomeMutator {
-
+
private final NoiseSampler sampler;
-
+
public SmoothMutator(NoiseSampler sampler) {
this.sampler = sampler;
}
-
+
@Override
public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
TerraBiome top = viewPoint.getBiome(1, 0);
TerraBiome bottom = viewPoint.getBiome(-1, 0);
TerraBiome left = viewPoint.getBiome(0, 1);
TerraBiome right = viewPoint.getBiome(0, -1);
-
-
+
+
boolean vert = Objects.equals(top, bottom) && top != null;
boolean horiz = Objects.equals(left, right) && left != null;
-
+
if(vert && horiz) {
return MathUtil.normalizeIndex(sampler.getNoiseSeeded(seed, x, z), 2) == 0 ? left : top;
}
-
+
if(vert) return top;
if(horiz) return left;
-
+
return viewPoint.getBiome(0, 0);
}
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java
index f1cf927c3..694a820cf 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java
@@ -2,6 +2,7 @@ package com.dfsek.terra.addons.biome.pipeline.source;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
public interface BiomeSource {
TerraBiome getBiome(double x, double z, long seed);
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/NoiseSource.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/NoiseSource.java
index 1ae08b7b8..d7846a917 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/NoiseSource.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/NoiseSource.java
@@ -4,15 +4,16 @@ import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.util.collection.ProbabilityCollection;
import com.dfsek.terra.api.world.biome.TerraBiome;
+
public class NoiseSource implements BiomeSource {
private final ProbabilityCollection biomes;
private final NoiseSampler sampler;
-
+
public NoiseSource(ProbabilityCollection biomes, NoiseSampler sampler) {
this.biomes = biomes;
this.sampler = sampler;
}
-
+
@Override
public TerraBiome getBiome(double x, double z, long seed) {
return biomes.get(sampler, x, z, seed);
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/ExpanderStage.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/ExpanderStage.java
index 839febab5..6fe1eab4e 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/ExpanderStage.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/ExpanderStage.java
@@ -4,23 +4,24 @@ import com.dfsek.terra.addons.biome.pipeline.api.BiomeExpander;
import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
+
public class ExpanderStage implements Stage {
private final BiomeExpander expander;
-
+
public ExpanderStage(BiomeExpander expander) {
this.expander = expander;
}
-
- @Override
- public boolean isExpansion() {
- return true;
- }
-
+
@Override
public BiomeHolder apply(BiomeHolder in, long seed) {
return in.expand(expander, seed);
}
-
+
+ @Override
+ public boolean isExpansion() {
+ return true;
+ }
+
public enum Type {
FRACTAL
}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/MutatorStage.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/MutatorStage.java
index 4f5f6bf6e..e1b42fb3c 100644
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/MutatorStage.java
+++ b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/MutatorStage.java
@@ -4,25 +4,30 @@ import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
import com.dfsek.terra.addons.biome.pipeline.api.Stage;
+
public class MutatorStage implements Stage {
private final BiomeMutator mutator;
-
+
public MutatorStage(BiomeMutator mutator) {
this.mutator = mutator;
}
-
- @Override
- public boolean isExpansion() {
- return false;
- }
-
+
@Override
public BiomeHolder apply(BiomeHolder in, long seed) {
in.mutate(mutator, seed);
return in;
}
-
+
+ @Override
+ public boolean isExpansion() {
+ return false;
+ }
+
public enum Type {
- REPLACE, REPLACE_LIST, BORDER, BORDER_LIST, SMOOTH
+ REPLACE,
+ REPLACE_LIST,
+ BORDER,
+ BORDER_LIST,
+ SMOOTH
}
}
diff --git a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProvider.java b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProvider.java
index 2b171547f..694da0b8d 100644
--- a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProvider.java
+++ b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProvider.java
@@ -3,13 +3,14 @@ package com.dfsek.terra.addons.biome.single;
import com.dfsek.terra.api.world.biome.TerraBiome;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
+
public class SingleBiomeProvider implements BiomeProvider {
private final TerraBiome biome;
-
+
public SingleBiomeProvider(TerraBiome biome) {
this.biome = biome;
}
-
+
@Override
public TerraBiome getBiome(int x, int z, long seed) {
return biome;
diff --git a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderAddon.java b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderAddon.java
index 704a20d28..3f63b811a 100644
--- a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderAddon.java
+++ b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderAddon.java
@@ -1,6 +1,9 @@
package com.dfsek.terra.addons.biome.single;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
+
+import java.util.function.Supplier;
+
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.addon.TerraAddon;
import com.dfsek.terra.api.addon.annotations.Addon;
@@ -13,26 +16,27 @@ import com.dfsek.terra.api.registry.CheckedRegistry;
import com.dfsek.terra.api.util.reflection.TypeKey;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import java.util.function.Supplier;
@Addon("biome-provider-single")
@Author("Terra")
@Version("1.0.0")
public class SingleBiomeProviderAddon extends TerraAddon {
- public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {};
-
+ public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
+ };
+
@Inject
private TerraPlugin main;
-
+
@Override
public void initialize() {
main.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(PROVIDER_REGISTRY_KEY);
- providerRegistry.register("SINGLE", SingleBiomeProviderTemplate::new);
- })
- .failThrough();
+ .getHandler(FunctionalEventHandler.class)
+ .register(this, ConfigPackPreLoadEvent.class)
+ .then(event -> {
+ CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(
+ PROVIDER_REGISTRY_KEY);
+ providerRegistry.register("SINGLE", SingleBiomeProviderTemplate::new);
+ })
+ .failThrough();
}
}
diff --git a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderTemplate.java b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderTemplate.java
index bbb3f4f1e..034c7887b 100644
--- a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderTemplate.java
+++ b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderTemplate.java
@@ -2,14 +2,16 @@ package com.dfsek.terra.addons.biome.single;
import com.dfsek.tectonic.annotations.Value;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
+
import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.world.biome.TerraBiome;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
+
public class SingleBiomeProviderTemplate implements ObjectTemplate {
@Value("biome")
private @Meta TerraBiome biome;
-
+
@Override
public BiomeProvider get() {
return new SingleBiomeProvider(biome);
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/BiomePaletteTemplate.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/BiomePaletteTemplate.java
index ed14d2faf..b0c797800 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/BiomePaletteTemplate.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/BiomePaletteTemplate.java
@@ -3,26 +3,26 @@ package com.dfsek.terra.addons.chunkgenerator;
import com.dfsek.tectonic.annotations.Default;
import com.dfsek.tectonic.annotations.Value;
import com.dfsek.tectonic.loading.object.ObjectTemplate;
+
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteInfo;
import com.dfsek.terra.addons.chunkgenerator.palette.SlantHolder;
import com.dfsek.terra.api.config.meta.Meta;
import com.dfsek.terra.api.world.generator.Palette;
-public class BiomePaletteTemplate implements ObjectTemplate {
- @Value("palette")
- private @Meta PaletteHolder palette;
+public class BiomePaletteTemplate implements ObjectTemplate {
@Value("slant")
@Default
- private @Meta SlantHolder slant = null;
-
+ private final @Meta SlantHolder slant;
+ @Value("palette")
+ private @Meta PaletteHolder palette;
@Value("ocean.level")
private @Meta int seaLevel;
-
+
@Value("ocean.palette")
private @Meta Palette oceanPalette;
-
+
@Override
public PaletteInfo get() {
return new PaletteInfo(palette, slant, oceanPalette, seaLevel);
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java
index bd5acee77..1ad12108f 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java
@@ -17,34 +17,36 @@ import com.dfsek.terra.api.injection.annotations.Inject;
import com.dfsek.terra.api.world.biome.TerraBiome;
import com.dfsek.terra.api.world.generator.ChunkGeneratorProvider;
+
@Addon("chunk-generator-noise-3d")
@Author("Terra")
@Version("1.0.0")
public class NoiseChunkGenerator3DAddon extends TerraAddon {
@Inject
private TerraPlugin main;
-
+
@Override
public void initialize() {
main.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- event.getPack().getOrCreateRegistry(ChunkGeneratorProvider.class).register("NOISE_3D", pack -> new NoiseChunkGenerator3D(pack, main));
- event.getPack()
- .applyLoader(SlantHolder.class, new SlantHolderLoader())
- .applyLoader(PaletteHolder.class, new PaletteHolderLoader());
- })
- .failThrough();
-
+ .getHandler(FunctionalEventHandler.class)
+ .register(this, ConfigPackPreLoadEvent.class)
+ .then(event -> {
+ event.getPack().getOrCreateRegistry(ChunkGeneratorProvider.class).register("NOISE_3D",
+ pack -> new NoiseChunkGenerator3D(pack, main));
+ event.getPack()
+ .applyLoader(SlantHolder.class, new SlantHolderLoader())
+ .applyLoader(PaletteHolder.class, new PaletteHolderLoader());
+ })
+ .failThrough();
+
main.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigurationLoadEvent.class)
- .then(event -> {
- if(event.is(TerraBiome.class)) {
- event.getLoadedObject(TerraBiome.class).getContext().put(event.load(new BiomePaletteTemplate()).get());
- }
- })
- .failThrough();
+ .getHandler(FunctionalEventHandler.class)
+ .register(this, ConfigurationLoadEvent.class)
+ .then(event -> {
+ if(event.is(TerraBiome.class)) {
+ event.getLoadedObject(TerraBiome.class).getContext().put(event.load(new BiomePaletteTemplate()).get());
+ }
+ })
+ .failThrough();
}
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/PaletteUtil.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/PaletteUtil.java
index 1b370cfeb..aa295094a 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/PaletteUtil.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/PaletteUtil.java
@@ -7,6 +7,7 @@ import com.dfsek.terra.api.world.biome.GenerationSettings;
import com.dfsek.terra.api.world.generator.Palette;
import com.dfsek.terra.api.world.generator.Sampler;
+
public final class PaletteUtil {
public static Palette getPalette(int x, int y, int z, GenerationSettings c, Sampler sampler, PaletteInfo paletteInfo) {
SlantHolder slant = paletteInfo.getSlantHolder();
@@ -16,7 +17,7 @@ public final class PaletteUtil {
return slant.getPalette(slope).getPalette(y);
}
}
-
+
return paletteInfo.getPaletteHolder().getPalette(y);
}
}
\ No newline at end of file
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/generators/NoiseChunkGenerator3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/generators/NoiseChunkGenerator3D.java
index fe9ea7d8e..f76391908 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/generators/NoiseChunkGenerator3D.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/generators/NoiseChunkGenerator3D.java
@@ -1,5 +1,12 @@
package com.dfsek.terra.addons.chunkgenerator.generation.generators;
+import net.jafama.FastMath;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
import com.dfsek.terra.addons.chunkgenerator.PaletteUtil;
import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
import com.dfsek.terra.addons.chunkgenerator.palette.PaletteInfo;
@@ -16,32 +23,27 @@ import com.dfsek.terra.api.world.biome.GenerationSettings;
import com.dfsek.terra.api.world.biome.TerraBiome;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import com.dfsek.terra.api.world.generator.ChunkData;
-import com.dfsek.terra.api.world.generator.Palette;
-import com.dfsek.terra.api.world.generator.Sampler;
import com.dfsek.terra.api.world.generator.ChunkGenerator;
import com.dfsek.terra.api.world.generator.GenerationStage;
-import net.jafama.FastMath;
-import org.jetbrains.annotations.NotNull;
+import com.dfsek.terra.api.world.generator.Palette;
+import com.dfsek.terra.api.world.generator.Sampler;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
public class NoiseChunkGenerator3D implements ChunkGenerator {
private final ConfigPack configPack;
private final TerraPlugin main;
private final List generationStages = new ArrayList<>();
-
+
private final BlockState air;
-
+
public NoiseChunkGenerator3D(ConfigPack c, TerraPlugin main) {
this.configPack = c;
this.main = main;
this.air = main.getWorldHandle().air();
c.getStages().forEach(stage -> generationStages.add(stage.newInstance(c)));
}
-
- @SuppressWarnings({"try"})
+
+ @SuppressWarnings("try")
static void biomes(@NotNull World world, int chunkX, int chunkZ, @NotNull BiomeGrid biome, TerraPlugin main) {
try(ProfileFrame ignore = main.getProfiler().profile("biomes")) {
int xOrig = (chunkX << 4);
@@ -53,73 +55,64 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
int cx = xOrig + (x << 2);
int cz = zOrig + (z << 2);
TerraBiome b = grid.getBiome(cx, cz, seed);
-
+
biome.setBiome(cx, cz, b.getVanillaBiomes().get(b.getGenerator().getBiomeNoise(), cx, 0, cz, world.getSeed()));
}
}
}
}
-
+
@Override
- public ConfigPack getConfigPack() {
- return configPack;
- }
-
- @Override
- public TerraPlugin getMain() {
- return main;
- }
-
- @Override
- @SuppressWarnings({"try"})
+ @SuppressWarnings("try")
public ChunkData generateChunkData(@NotNull World world, Random random, int chunkX, int chunkZ, ChunkData chunk) {
try(ProfileFrame ignore = main.getProfiler().profile("chunk_base_3d")) {
BiomeProvider grid = world.getBiomeProvider();
-
+
int xOrig = (chunkX << 4);
int zOrig = (chunkZ << 4);
-
+
Sampler sampler = world.getConfig().getSamplerCache().getChunk(chunkX, chunkZ);
-
+
long seed = world.getSeed();
-
+
for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
int paletteLevel = 0;
-
+
int cx = xOrig + x;
int cz = zOrig + z;
-
+
TerraBiome biome = grid.getBiome(cx, cz, seed);
-
+
PaletteInfo paletteInfo = biome.getContext().get(PaletteInfo.class);
-
+
if(paletteInfo == null) {
main.logger().info("null palette: " + biome.getID());
}
-
+
GenerationSettings generationSettings = biome.getGenerator();
-
+
int sea = paletteInfo.getSeaLevel();
Palette seaPalette = paletteInfo.getOcean();
-
+
boolean justSet = false;
BlockState data = null;
for(int y = world.getMaxHeight() - 1; y >= world.getMinHeight(); y--) {
if(sampler.sample(x, y, z) > 0) {
justSet = true;
-
- data = PaletteUtil.getPalette(x, y, z, generationSettings, sampler, paletteInfo).get(paletteLevel, cx, y, cz, seed);
+
+ data = PaletteUtil.getPalette(x, y, z, generationSettings, sampler, paletteInfo).get(paletteLevel, cx, y, cz,
+ seed);
chunk.setBlock(x, y, z, data);
-
+
paletteLevel++;
} else if(y <= sea) {
chunk.setBlock(x, y, z, seaPalette.get(sea - y, x + xOrig, y, z + zOrig, seed));
-
+
justSet = false;
paletteLevel = 0;
- } else {
-
+ } else {
+
justSet = false;
paletteLevel = 0;
}
@@ -129,47 +122,38 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
return chunk;
}
}
-
- private boolean placeStair(BlockState orig, ChunkData chunk, Vector3 block, double thresh, Sampler sampler, BlockState stairNew) {
-
- if(sampler.sample(block.getBlockX() - 0.55, block.getY(), block.getZ()) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.WEST);
- } else if(sampler.sample(block.getBlockX(), block.getY(), block.getZ() - 0.55) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.NORTH);
- } else if(sampler.sample(block.getBlockX(), block.getY(), block.getZ() + 0.55) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.SOUTH);
- } else if(sampler.sample(block.getX() + 0.55, block.getY(), block.getZ()) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.EAST);
- } else stairNew = null;
- if(stairNew != null) {
- stairNew.setIfPresent(Properties.WATERLOGGED, orig.getBlockType().isWater());
- chunk.setBlock(block.getBlockX(), block.getBlockY(), block.getBlockZ(), stairNew);
- return true;
- }
- return false;
- }
-
+
@Override
public void generateBiomes(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, @NotNull BiomeGrid biome) {
biomes(world, chunkX, chunkZ, biome, main);
}
-
+
@Override
public Sampler createSampler(int chunkX, int chunkZ, BiomeProvider provider, World world, int elevationSmooth) {
return new Sampler3D(chunkX, chunkZ, provider, world, elevationSmooth);
}
-
+
+ @Override
+ public ConfigPack getConfigPack() {
+ return configPack;
+ }
+
+ @Override
+ public TerraPlugin getMain() {
+ return main;
+ }
+
@Override
public List getGenerationStages() {
return generationStages;
}
-
+
@Override
public BlockState getBlock(World world, int x, int y, int z) {
BiomeProvider provider = world.getBiomeProvider();
TerraBiome biome = provider.getBiome(x, z, world.getSeed());
Sampler sampler = world.getConfig().getSamplerCache().get(x, z);
-
+
PaletteInfo paletteInfo = biome.getContext().get(PaletteInfo.class);
Palette palette = PaletteUtil.getPalette(x, y, z, biome.getGenerator(), sampler, paletteInfo);
int fdX = FastMath.floorMod(x, 16);
@@ -186,4 +170,23 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
return paletteInfo.getOcean().get(paletteInfo.getSeaLevel() - y, x, y, z, world.getSeed());
} else return air;
}
+
+ private boolean placeStair(BlockState orig, ChunkData chunk, Vector3 block, double thresh, Sampler sampler, BlockState stairNew) {
+
+ if(sampler.sample(block.getBlockX() - 0.55, block.getY(), block.getZ()) > thresh) {
+ stairNew.set(Properties.DIRECTION, Direction.WEST);
+ } else if(sampler.sample(block.getBlockX(), block.getY(), block.getZ() - 0.55) > thresh) {
+ stairNew.set(Properties.DIRECTION, Direction.NORTH);
+ } else if(sampler.sample(block.getBlockX(), block.getY(), block.getZ() + 0.55) > thresh) {
+ stairNew.set(Properties.DIRECTION, Direction.SOUTH);
+ } else if(sampler.sample(block.getX() + 0.55, block.getY(), block.getZ()) > thresh) {
+ stairNew.set(Properties.DIRECTION, Direction.EAST);
+ } else stairNew = null;
+ if(stairNew != null) {
+ stairNew.setIfPresent(Properties.WATERLOGGED, orig.getBlockType().isWater());
+ chunk.setBlock(block.getBlockX(), block.getBlockY(), block.getBlockZ(), stairNew);
+ return true;
+ }
+ return false;
+ }
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator2D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator2D.java
index a610f6f15..8773732df 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator2D.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator2D.java
@@ -1,16 +1,18 @@
package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
+import net.jafama.FastMath;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
import com.dfsek.terra.api.util.mutable.MutableInteger;
import com.dfsek.terra.api.vector.Vector3;
import com.dfsek.terra.api.world.World;
import com.dfsek.terra.api.world.biome.GenerationSettings;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import com.dfsek.terra.api.world.generator.ChunkInterpolator;
-import net.jafama.FastMath;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.BiFunction;
/**
* Class to abstract away the Interpolators needed to generate a chunk.
@@ -19,7 +21,7 @@ import java.util.function.BiFunction;
public class ChunkInterpolator2D implements ChunkInterpolator {
private final Interpolator[][] interpGrid = new Interpolator[4][4];
private final BiFunction noiseGetter;
-
+
/**
* Instantiates a 3D ChunkInterpolator3D at a pair of chunk coordinates.
*
@@ -27,33 +29,36 @@ public class ChunkInterpolator2D implements ChunkInterpolator {
* @param chunkZ Z coordinate of the chunk.
* @param provider Biome Provider to use for biome fetching.
*/
- public ChunkInterpolator2D(World w, int chunkX, int chunkZ, BiomeProvider provider, BiFunction noiseGetter) {
+ public ChunkInterpolator2D(World w, int chunkX, int chunkZ, BiomeProvider provider,
+ BiFunction noiseGetter) {
this.noiseGetter = noiseGetter;
int xOrigin = chunkX << 4;
int zOrigin = chunkZ << 4;
-
+
long seed = w.getSeed();
-
+
double[][] noiseStorage = new double[5][5];
-
+
for(int x = 0; x < 5; x++) {
for(int z = 0; z < 5; z++) {
GenerationSettings generationSettings = provider.getBiome(xOrigin + (x << 2), zOrigin + (z << 2), seed).getGenerator();
Map genMap = new HashMap<>();
-
+
int step = generationSettings.getBlendStep();
int blend = generationSettings.getBlendDistance();
-
+
for(int xi = -blend; xi <= blend; xi++) {
for(int zi = -blend; zi <= blend; zi++) {
- genMap.computeIfAbsent(provider.getBiome(xOrigin + (x << 2) + (xi * step), zOrigin + (z << 2) + (zi * step), seed).getGenerator(), g -> new MutableInteger(0)).increment(); // Increment by 1
+ genMap.computeIfAbsent(
+ provider.getBiome(xOrigin + (x << 2) + (xi * step), zOrigin + (z << 2) + (zi * step), seed).getGenerator(),
+ g -> new MutableInteger(0)).increment(); // Increment by 1
}
}
-
+
noiseStorage[x][z] = computeNoise(genMap, (x << 2) + xOrigin, 0, (z << 2) + zOrigin);
}
}
-
+
for(int x = 0; x < 4; x++) {
for(int z = 0; z < 4; z++) {
interpGrid[x][z] = new Interpolator(
@@ -64,27 +69,28 @@ public class ChunkInterpolator2D implements ChunkInterpolator {
}
}
}
-
+
private static int reRange(int value, int high) {
return FastMath.max(FastMath.min(value, high), 0);
}
-
+
public double computeNoise(GenerationSettings generationSettings, double x, double y, double z) {
return noiseGetter.apply(generationSettings, new Vector3(x, y, z));
}
-
+
/**
* Gets the noise at a pair of internal chunk coordinates.
*
* @param x The internal X coordinate (0-15).
* @param z The internal Z coordinate (0-15).
+ *
* @return double - The interpolated noise at the coordinates.
*/
@Override
public double getNoise(double x, double y, double z) {
return interpGrid[reRange(((int) x) / 4, 3)][reRange(((int) z) / 4, 3)].bilerp((x % 4) / 4, (z % 4) / 4);
}
-
+
public double getNoise(int x, int y, int z) {
return interpGrid[x / 4][z / 4].bilerp((double) (x % 4) / 4, (double) (z % 4) / 4);
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator3D.java
index 982a76d7f..909500d09 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator3D.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator3D.java
@@ -1,16 +1,18 @@
package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
+import net.jafama.FastMath;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+
import com.dfsek.terra.api.util.mutable.MutableInteger;
import com.dfsek.terra.api.vector.Vector3;
import com.dfsek.terra.api.world.World;
import com.dfsek.terra.api.world.biome.GenerationSettings;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import com.dfsek.terra.api.world.generator.ChunkInterpolator;
-import net.jafama.FastMath;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.BiFunction;
/**
* Class to abstract away the Interpolators needed to generate a chunk.
@@ -19,10 +21,10 @@ import java.util.function.BiFunction;
public class ChunkInterpolator3D implements ChunkInterpolator {
private final Interpolator3[][][] interpGrid;
private final BiFunction noiseGetter;
-
+
private final int min;
private final int max;
-
+
/**
* Instantiates a 3D ChunkInterpolator3D at a pair of chunk coordinates.
*
@@ -30,43 +32,46 @@ public class ChunkInterpolator3D implements ChunkInterpolator {
* @param chunkZ Z coordinate of the chunk.
* @param provider Biome Provider to use for biome fetching.
*/
- public ChunkInterpolator3D(World w, int chunkX, int chunkZ, BiomeProvider provider, BiFunction noiseGetter) {
+ public ChunkInterpolator3D(World w, int chunkX, int chunkZ, BiomeProvider provider,
+ BiFunction noiseGetter) {
this.noiseGetter = noiseGetter;
int xOrigin = chunkX << 4;
int zOrigin = chunkZ << 4;
-
+
this.max = w.getMaxHeight();
this.min = w.getMinHeight();
int range = max - min + 1;
-
+
int size = range >> 2;
-
+
interpGrid = new Interpolator3[4][size][4];
-
+
double[][][] noiseStorage = new double[5][5][size + 1];
-
+
long seed = w.getSeed();
-
+
for(int x = 0; x < 5; x++) {
for(int z = 0; z < 5; z++) {
GenerationSettings generationSettings = provider.getBiome(xOrigin + (x << 2), zOrigin + (z << 2), seed).getGenerator();
Map genMap = new HashMap<>();
-
+
int step = generationSettings.getBlendStep();
int blend = generationSettings.getBlendDistance();
-
+
for(int xi = -blend; xi <= blend; xi++) {
for(int zi = -blend; zi <= blend; zi++) {
- genMap.computeIfAbsent(provider.getBiome(xOrigin + (x << 2) + (xi * step), zOrigin + (z << 2) + (zi * step), seed).getGenerator(), g -> new MutableInteger(0)).increment(); // Increment by 1
+ genMap.computeIfAbsent(
+ provider.getBiome(xOrigin + (x << 2) + (xi * step), zOrigin + (z << 2) + (zi * step), seed).getGenerator(),
+ g -> new MutableInteger(0)).increment(); // Increment by 1
}
}
-
+
for(int y = 0; y < size + 1; y++) {
noiseStorage[x][z][y] = computeNoise(genMap, (x << 2) + xOrigin, (y << 2) + min, (z << 2) + zOrigin);
}
}
}
-
+
for(int x = 0; x < 4; x++) {
for(int z = 0; z < 4; z++) {
for(int y = 0; y < size; y++) {
@@ -83,27 +88,30 @@ public class ChunkInterpolator3D implements ChunkInterpolator {
}
}
}
-
+
private static int reRange(int value, int high) {
return FastMath.max(FastMath.min(value, high), 0);
}
-
+
public double computeNoise(GenerationSettings generationSettings, double x, double y, double z) {
return noiseGetter.apply(generationSettings, new Vector3(x, y, z));
}
-
+
/**
* Gets the noise at a pair of internal chunk coordinates.
*
* @param x The internal X coordinate (0-15).
* @param z The internal Z coordinate (0-15).
+ *
* @return double - The interpolated noise at the coordinates.
*/
@Override
public double getNoise(double x, double y, double z) {
- return interpGrid[reRange(((int) x) / 4, 3)][(FastMath.max(FastMath.min(((int) y), max), min) - min) / 4][reRange(((int) z) / 4, 3)].trilerp((x % 4) / 4, (y % 4) / 4, (z % 4) / 4);
+ return interpGrid[reRange(((int) x) / 4, 3)][(FastMath.max(FastMath.min(((int) y), max), min) - min) / 4][reRange(((int) z) / 4,
+ 3)].trilerp(
+ (x % 4) / 4, (y % 4) / 4, (z % 4) / 4);
}
-
+
public double getNoise(int x, int y, int z) {
return interpGrid[x / 4][(y - min) / 4][z / 4].trilerp((double) (x % 4) / 4, (double) (y % 4) / 4, (double) (z % 4) / 4);
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ElevationInterpolator.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ElevationInterpolator.java
index 80ae9899d..e2b01942e 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ElevationInterpolator.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ElevationInterpolator.java
@@ -4,24 +4,25 @@ import com.dfsek.terra.api.world.World;
import com.dfsek.terra.api.world.biome.GenerationSettings;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
+
public class ElevationInterpolator {
private final double[][] values = new double[18][18];
-
+
public ElevationInterpolator(World world, int chunkX, int chunkZ, BiomeProvider provider, int smooth) {
int xOrigin = chunkX << 4;
int zOrigin = chunkZ << 4;
-
+
long seed = world.getSeed();
-
+
GenerationSettings[][] gens = new GenerationSettings[18 + 2 * smooth][18 + 2 * smooth];
-
+
// Precompute generators.
for(int x = -1 - smooth; x <= 16 + smooth; x++) {
for(int z = -1 - smooth; z <= 16 + smooth; z++) {
gens[x + 1 + smooth][z + 1 + smooth] = provider.getBiome(xOrigin + x, zOrigin + z, seed).getGenerator();
}
}
-
+
for(int x = -1; x <= 16; x++) {
for(int z = -1; z <= 16; z++) {
double noise = 0;
@@ -37,7 +38,7 @@ public class ElevationInterpolator {
}
}
}
-
+
public double getElevation(int x, int z) {
return values[x + 1][z + 1];
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator.java
index 37bc0eb76..d67ac6c10 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator.java
@@ -5,7 +5,7 @@ package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
*/
public class Interpolator {
private final double v0, v1, v2, v3;
-
+
/**
* Constructs an interpolator with given values as vertices of a unit square.
*
@@ -20,24 +20,26 @@ public class Interpolator {
this.v2 = v2;
this.v3 = v3;
}
-
+
/**
* 1D Linear interpolation between 2 points 1 unit apart.
*
* @param t - Distance from v0. Total distance between v0 and v1 is 1 unit.
* @param v0 - Value at v0.
* @param v1 - Value at v1.
+ *
* @return double - The interpolated value.
*/
public static double lerp(double t, double v0, double v1) {
return v0 + t * (v1 - v0);
}
-
+
/**
* 2D Bilinear interpolation between 4 points on a unit square.
*
* @param s - X value
* @param t - Z value
+ *
* @return double - The interpolated value.
*/
public double bilerp(double s, double t) {
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator3.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator3.java
index ddedc713b..1d80fb025 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator3.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator3.java
@@ -6,7 +6,7 @@ package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
public class Interpolator3 {
private final Interpolator bottom;
private final Interpolator top;
-
+
/**
* Constructs an interpolator with given values as vertices of a unit cube.
* * @param _000 The value at (t, u, v) = (0, 0, 0).
@@ -25,7 +25,7 @@ public class Interpolator3 {
this.top = new Interpolator(_000, _010, _001, _011);
this.bottom = new Interpolator(_100, _110, _101, _111);
}
-
+
public double trilerp(double x, double y, double z) {
return Interpolator.lerp(x, top.bilerp(y, z), bottom.bilerp(y, z));
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/samplers/Sampler3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/samplers/Sampler3D.java
index d0092503c..1b7136b4b 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/samplers/Sampler3D.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/samplers/Sampler3D.java
@@ -1,26 +1,30 @@
package com.dfsek.terra.addons.chunkgenerator.generation.math.samplers;
+import net.jafama.FastMath;
+
import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.ChunkInterpolator3D;
import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.ElevationInterpolator;
import com.dfsek.terra.api.world.World;
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
import com.dfsek.terra.api.world.generator.Sampler;
-import net.jafama.FastMath;
+
public class Sampler3D implements Sampler {
private final ChunkInterpolator3D interpolator;
private final ElevationInterpolator elevationInterpolator;
-
+
public Sampler3D(int x, int z, BiomeProvider provider, World world, int elevationSmooth) {
- this.interpolator = new ChunkInterpolator3D(world, x, z, provider, (generator, coord) -> generator.getBaseSampler().getNoiseSeeded(coord, world.getSeed()));
+ this.interpolator = new ChunkInterpolator3D(world, x, z, provider, (generator, coord) -> generator.getBaseSampler()
+ .getNoiseSeeded(coord,
+ world.getSeed()));
this.elevationInterpolator = new ElevationInterpolator(world, x, z, provider, elevationSmooth);
}
-
+
@Override
public double sample(double x, double y, double z) {
return interpolator.getNoise(x, y, z) + elevationInterpolator.getElevation(FastMath.roundToInt(x), FastMath.roundToInt(z));
}
-
+
@Override
public double sample(int x, int y, int z) {
return interpolator.getNoise(x, y, z) + elevationInterpolator.getElevation(FastMath.roundToInt(x), FastMath.roundToInt(z));
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolder.java
index e6c009a55..55d2a2dac 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolder.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolder.java
@@ -2,21 +2,22 @@ package com.dfsek.terra.addons.chunkgenerator.palette;
import com.dfsek.terra.api.world.generator.Palette;
+
public class PaletteHolder {
private final Palette[] palettes;
private final int offset;
-
+
protected PaletteHolder(Palette[] palettes, int offset) {
this.palettes = palettes;
this.offset = offset;
}
-
+
public Palette getPalette(int y) {
int index = y + offset;
return index >= 0
- ? index < palettes.length
- ? palettes[index]
- : palettes[palettes.length - 1]
- : palettes[0];
+ ? index < palettes.length
+ ? palettes[index]
+ : palettes[palettes.length - 1]
+ : palettes[0];
}
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderBuilder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderBuilder.java
index 485c03c9d..61042145b 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderBuilder.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderBuilder.java
@@ -1,24 +1,26 @@
package com.dfsek.terra.addons.chunkgenerator.palette;
-import com.dfsek.terra.api.world.generator.Palette;
import net.jafama.FastMath;
import java.util.Map;
import java.util.TreeMap;
+import com.dfsek.terra.api.world.generator.Palette;
+
+
public class PaletteHolderBuilder {
private final TreeMap paletteMap = new TreeMap<>();
-
+
public PaletteHolderBuilder add(int y, Palette palette) {
paletteMap.put(y, palette);
return this;
}
-
+
public PaletteHolder build() {
-
+
int min = FastMath.min(paletteMap.keySet().stream().min(Integer::compareTo).orElse(0), 0);
int max = FastMath.max(paletteMap.keySet().stream().max(Integer::compareTo).orElse(255), 255);
-
+
Palette[] palettes = new Palette[paletteMap.lastKey() + 1 - min];
for(int y = min; y <= FastMath.max(paletteMap.lastKey(), max); y++) {
Palette d = null;
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderLoader.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderLoader.java
index 61286fe69..bf0bc3bb5 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderLoader.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderLoader.java
@@ -3,12 +3,14 @@ package com.dfsek.terra.addons.chunkgenerator.palette;
import com.dfsek.tectonic.exception.LoadException;
import com.dfsek.tectonic.loading.ConfigLoader;
import com.dfsek.tectonic.loading.TypeLoader;
-import com.dfsek.terra.api.world.generator.Palette;
import java.lang.reflect.AnnotatedType;
import java.util.List;
import java.util.Map;
+import com.dfsek.terra.api.world.generator.Palette;
+
+
public class PaletteHolderLoader implements TypeLoader {
@SuppressWarnings("unchecked")
@Override
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteInfo.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteInfo.java
index 109da179b..fd7b331b7 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteInfo.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteInfo.java
@@ -3,32 +3,33 @@ package com.dfsek.terra.addons.chunkgenerator.palette;
import com.dfsek.terra.api.properties.Properties;
import com.dfsek.terra.api.world.generator.Palette;
+
public class PaletteInfo implements Properties {
private final PaletteHolder paletteHolder;
private final SlantHolder slantHolder;
private final Palette ocean;
-
+
private final int seaLevel;
-
+
public PaletteInfo(PaletteHolder paletteHolder, SlantHolder slantHolder, Palette ocean, int seaLevel) {
this.paletteHolder = paletteHolder;
this.slantHolder = slantHolder;
this.ocean = ocean;
this.seaLevel = seaLevel;
}
-
+
public Palette getOcean() {
return ocean;
}
-
+
public PaletteHolder getPaletteHolder() {
return paletteHolder;
}
-
+
public SlantHolder getSlantHolder() {
return slantHolder;
}
-
+
public int getSeaLevel() {
return seaLevel;
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolder.java
index 3b8e3fc73..0845604dc 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolder.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolder.java
@@ -3,19 +3,20 @@ package com.dfsek.terra.addons.chunkgenerator.palette;
import java.util.TreeMap;
+
public class SlantHolder {
private final TreeMap layers;
private final double minSlope;
-
+
public SlantHolder(TreeMap layers, double minSlope) {
this.layers = layers;
this.minSlope = minSlope;
}
-
+
public PaletteHolder getPalette(double slope) {
return layers.floorEntry(slope).getValue();
}
-
+
public double getMinSlope() {
return minSlope;
}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolderLoader.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolderLoader.java
index 6b7e0a8b3..74869b9dc 100644
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolderLoader.java
+++ b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/SlantHolderLoader.java
@@ -9,6 +9,7 @@ import java.util.List;
import java.util.Map;
import java.util.TreeMap;
+
@SuppressWarnings("unchecked")
public class SlantHolderLoader implements TypeLoader {
@Override
@@ -16,13 +17,13 @@ public class SlantHolderLoader implements TypeLoader {
List