Skip to content

Commit

Permalink
Myalite is a little faster to calculate
Browse files Browse the repository at this point in the history
  • Loading branch information
yrsegal committed Aug 14, 2023
1 parent 2a533a1 commit a1a910b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.client.color.block.BlockColor;
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth;
import net.minecraft.world.level.levelgen.LegacyRandomSource;
import net.minecraft.world.level.levelgen.synth.PerlinSimplexNoise;
import net.minecraft.world.phys.BlockHitResult;
Expand Down Expand Up @@ -47,20 +48,20 @@ default ItemColor getItemColor() {
default float myaliteB() { return 0.8F; }

static int getColor(BlockPos pos, float s, float b) {
final double sp = 0.15;
final float sp = 0.15f;
final double range = 0.3;
final double shift = 0.05;

if(pos == null)
pos = BlockPos.ZERO;

double x = pos.getX() * sp;
double y = pos.getY() * sp;
double z = pos.getZ() * sp;
float x = pos.getX() * sp;
float y = pos.getY() * sp;
float z = pos.getZ() * sp;

double xv = x + Math.sin(z) * 2;
double zv = z + Math.cos(x) * 2;
double yv = y + Math.sin(y + Math.PI / 4) * 2;
double xv = x + Mth.sin(z) * 2;
double zv = z + Mth.cos(x) * 2;
double yv = y + Mth.sin(y + Mth.PI / 4) * 2;

double noise = NOISE.getValue(xv + yv, zv + (yv * 2), false);

Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/assets/quark/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
"quark.jei.hint.jasper": "Can be found in big clusters in mesas and deserts.",
"quark.jei.hint.lavender_blossom_sapling": "Can be found in swamps.",
"quark.jei.hint.limestone": "Can be found in big clusters in swamps and oceans.",
"quark.jei.hint.myalite": "Can be found in big clusters in the outer end highlands. Its color changes based on where its placed.",
"quark.jei.hint.myalite": "Can be found in big clusters in the outer end highlands. It reacts to an invisible field in the world, changing color depending on where it's placed with the field's intensity.",
"quark.jei.hint.orange_blossom_sapling": "Can be found in savannas.",
"quark.jei.hint.pathfinders_quill": "Can be used to find the biome inscribed in it. Trade for it from Cartographers or Wandering Traders.",
"quark.jei.hint.permafrost": "Can be found towards the top of Frozen Peaks.",
Expand Down Expand Up @@ -250,6 +250,7 @@
"quark.jei.hint.sign_editing": "Signs can be edited by right clicking on them.",
"quark.jei.hint.chorus_weeds": "Uncommon spawns in the barrens of the outer end. Will randomly teleport and reproduce over time or if forced via trampling, bone meal, or adajcent water. May also spawn Endermites when trampled.",
"quark.jei.hint.corundum": "Can be found underground in large clusters of two colors each. Will slowly grow upwards if placed deep underground. Can be waxed to prevent growth and particle emission.",
"quark.jei.hint.crystal_lamp": "These lamps will only change the color of a beacon beam when turned on.",
"quark.jei.hint.snow_golem_player_heads": "Having a Witch kill a named Snow Golem will drop the Player Head matching the golem's name.",
"quark.jei.hint.use_for_vanishing": "If a Pumpkin is enchanted with Curse of Vanishing, it won't show the dark overlay when worn.",
"quark.jei.hint.use_for_binding": "A Player Head with Curse of Binding on it can be put on an Armor Stand to display that player's full body.",
Expand Down Expand Up @@ -1462,6 +1463,7 @@
"tag.item.quark.big_harvesting_hoes": "Wide-Harvesting Hoes",
"tag.item.quark.blossom_logs": "Blossom Logs",
"tag.item.quark.corundum": "Corundum",
"tag.item.quark.crystal_lamp": "Crystal Lamps",
"tag.item.quark.cosmetic_anvil_items": "Cosmetic-Only Anvil Upgrades",
"tag.item.quark.framed_glass_panes": "Framed Glass Panes",
"tag.item.quark.framed_glasses": "Framed Glasses",
Expand Down

0 comments on commit a1a910b

Please sign in to comment.