Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
Finalize for update
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor4t committed Jul 28, 2020
1 parent c233410 commit 0421860
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 27 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Illuminations - Changelog

### Illuminations 1.0.2 - 1.16.1

- Introduced prismatic auras, auras that you can change the color of on the [Illuminations dashboard](https://illuminations.glitch.me/)
- Made the twilight aura prismatic

### Illuminations 1.0.1 - 1.16.1

- Fixed an issue where the game would crash upon loading the mod with Sodium

### Illuminations 1.0 - 1.16.1
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ Glowing **plankton** - even though difficult to notice because of its size - can

**Auras** are special Illuminations effects around the player visible to other players that have the mod. Auras currently serve as a bonus for donators that support the mod and are purely cosmetic with no other provided advantage whatsoever. They are visible to other players with Illuminations installed (even on vanilla servers).

### Twilight aura
Two types of aura are currently availably: regular auras and prismatic auras. Regular auras are not customizable and have a specific color that you cannot change, while prismatic auras on the other hand will be colored depending on your Illuminations prismatic color.

The **Twilight** aura creates magenta colored fireflies that will orbit around the player. If the player moves, they will leave a trail of these fireflies.
Auras and prismatic color can be selected and changed via the [Illuminations dashboard](https://illuminations.glitch.me/).

### Twilight aura (prismatic)

The **Twilight** aura creates prismatic colored fireflies that will orbit around the player. If the player moves, they will leave a trail of these fireflies.

![illuminations-1.0-twilight-aura](README.assets/illuminations-1.0-twilight-aura.gif)

Expand All @@ -50,4 +54,8 @@ The **Twilight** aura creates magenta colored fireflies that will orbit around t

#### I wish to support the mod and get an aura. What steps do I need to follow?

In order to get an aura, you will need to make a PayPal donation by following [this link](https://www.paypal.com/donate/?token=khJOtftVs9CuPqxETbT8q2MyRlCrQXkpw-iOaI9NOPJSOpQouUb2Xg1uOifF8ZZDkSoi-W&Z3JncnB0) or via the Curse Forge donate button available on the project page. **When making your donation, please include your Minecraft UUID as well as a valid email address (so I may contact you in case of any problem) in your message.** All donations and aura attributions are manually processed and done as soon as possible, but may take up to a day so please be patient.
In order to get an aura, you will need to make a PayPal donation by following [this link](https://www.paypal.com/donate/?token=khJOtftVs9CuPqxETbT8q2MyRlCrQXkpw-iOaI9NOPJSOpQouUb2Xg1uOifF8ZZDkSoi-W&Z3JncnB0) or via the Curse Forge donate button available on the project page. **When making your donation, please include your Minecraft UUID as well as a valid email address (so I may contact you in case of any problem) in your message.** All donations and aura attributions are manually processed and done as soon as possible, but may take up to a day so please be patient.

#### I want to change my aura / the color of my prismatic auras / disable it, what do I do?

If you have donated multiple times, you may have multiple auras and may want to select a specific one. Or you may just simply want to change your prismatic color or disable your aura. **You can do all this via the [Illuminations dashboard](https://illuminations.glitch.me/)** with no restrictions whatsoever.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ loader_version=0.9.0+build.204
fabric_version=0.14.1+build.372-1.16

# Mod Properties
mod_version = 1.0.1.1
mod_version = 1.0.2
maven_group = io.github.ladysnake
archives_base_name = illuminations

Expand Down
4 changes: 0 additions & 4 deletions src/main/java/ladysnake/illuminations/client/AuraData.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package ladysnake.illuminations.client;

import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

import java.util.Random;
import java.util.function.BiPredicate;
import java.util.function.Predicate;

public class AuraData {
private final DefaultParticleType particle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.common.collect.ImmutableSet;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.google.gson.JsonObject;
import ladysnake.illuminations.client.particle.FireflyParticle;
import ladysnake.illuminations.client.particle.GlowwormParticle;
import ladysnake.illuminations.client.particle.PlanktonParticle;
Expand All @@ -28,11 +28,8 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.lang.reflect.Type;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
import java.util.UUID;
import java.util.function.BiPredicate;
import java.util.function.Predicate;

Expand All @@ -41,10 +38,9 @@ public class IlluminationsClient implements ClientModInitializer {
public static final Logger logger = LogManager.getLogger("Illuminations");

// illuminations auras
private static final String URL = "https://illuminations.glitch.me/auras.json";
private static final String URL = "https://illuminations.glitch.me/auras";
private static final Gson GSON = new GsonBuilder().create();
private static final Type AURA_SELECT_TYPE = new TypeToken<Map<UUID, String>>(){}.getType();
public static ImmutableMap<UUID, String> PLAYER_AURAS;
public static JsonObject PLAYER_AURAS;
public static ImmutableMap<String, AuraData> AURAS_DATA;

// particle types
Expand Down Expand Up @@ -119,7 +115,7 @@ public void onInitializeClient() {

public static void getUsers() {
try(Reader reader = new InputStreamReader(new URL(URL).openStream())) {
PLAYER_AURAS = ImmutableMap.copyOf((Map<? extends UUID, ? extends String>) GSON.fromJson(reader, AURA_SELECT_TYPE));
PLAYER_AURAS = GSON.fromJson(reader, JsonObject.class);
logger.log(Level.INFO, "Illuminations player auras retrieved");
} catch (MalformedURLException e) {
logger.log(Level.ERROR, "Could not get Illuminations player auras because of malformed URL: " + e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ladysnake.illuminations.client.particle.aura;

import ladysnake.illuminations.client.IlluminationsClient;
import ladysnake.illuminations.client.particle.FireflyParticle;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand All @@ -19,6 +20,7 @@
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;

import java.awt.*;
import java.util.Random;

public class TwilightFireflyParticle extends FireflyParticle {
Expand All @@ -31,10 +33,16 @@ public TwilightFireflyParticle(ClientWorld world, double x, double y, double z,
this.owner = world.getClosestPlayer((new TargetPredicate()).setBaseMaxDistance(1D), this.x, this.y, this.z);
this.maxHeight = 2;

this.colorRed = 216f/255f;
this.colorGreen = 0f/255f;
this.colorBlue = 182f/255f;
this.nextAlphaGoal = 0.5f;
if (owner != null) {
String playerColor = IlluminationsClient.PLAYER_AURAS.getAsJsonObject(owner.getUuid().toString()).get("color").getAsString();
Color color = Color.decode(playerColor);
this.colorRed = color.getRed()/255f;
this.colorGreen = color.getGreen()/255f;
this.colorBlue = color.getBlue()/255f;
this.nextAlphaGoal = 0.5f;
} else {
this.markDead();
}

this.setPos(this.x + TwilightFireflyParticle.getWanderingDistance(this.random), this.y + random.nextFloat() * 2d, this.z + TwilightFireflyParticle.getWanderingDistance(this.random));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package ladysnake.illuminations.mixin;

import ladysnake.illuminations.client.IlluminationsClient;
import ladysnake.illuminations.client.particle.aura.TwilightFireflyParticle;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.world.World;
import org.apache.logging.log4j.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -23,8 +21,8 @@ protected PlayerEntityMixin(EntityType<? extends LivingEntity> entityType, World
@Inject(method = "tick", at = @At("RETURN"))
public void tick(CallbackInfo callbackInfo) {
// if player has an aura
if (IlluminationsClient.PLAYER_AURAS.containsKey(this.getUuid())) {
String playerAura = IlluminationsClient.PLAYER_AURAS.get(this.getUuid());
if (IlluminationsClient.PLAYER_AURAS.has(this.getUuid().toString())) {
String playerAura = IlluminationsClient.PLAYER_AURAS.getAsJsonObject(this.getUuid().toString()).get("aura").getAsString();

// do not render in first person or if the player is invisible
//noinspection ConstantConditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Slice;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Random;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/illuminations.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"compatibilityLevel": "JAVA_8",
"client": [
"ClientWorldMixin",
"SodiumClientWorldMixin",
"PlayerEntityMixin"
"PlayerEntityMixin",
"SodiumClientWorldMixin"
],
"plugin": "ladysnake.illuminations.IlluminationsMixinConfigPlugin",
"injectors": {
Expand Down

0 comments on commit 0421860

Please sign in to comment.