Skip to content

Commit

Permalink
🔀 1.2.5
Browse files Browse the repository at this point in the history
1.2.5
  • Loading branch information
CallMeEchoCodes authored Sep 8, 2024
2 parents 4a751cf + 32813ab commit 7e2c0e7
Show file tree
Hide file tree
Showing 182 changed files with 2,519 additions and 1,523 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@ run/
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

src/generated/.cache
src/main/generated/.cache
20 changes: 17 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Dependencies {
val yarn = property("deps.yarn").toString()

val fabricApi = property("deps.fabricapi").toString()
val cabinetApi = property("deps.cabinetapi").toString()
val specter = property("deps.specter").toString()
}

val mod = ModInfo()
Expand Down Expand Up @@ -47,8 +47,22 @@ dependencies {
modImplementation("net.fabricmc:fabric-loader:${deps.loader}")

modImplementation("net.fabricmc.fabric-api:fabric-api:${deps.fabricApi}")
include("dev.callmeecho:cabinetapi:${deps.cabinetApi}")
modImplementation("dev.callmeecho:cabinetapi:${deps.cabinetApi}")

fun specterModule(name: String) {
include("dev.spiritstudios.specter:specter-$name:${deps.specter}")
modImplementation("dev.spiritstudios.specter:specter-$name:${deps.specter}")
}

specterModule("api")
specterModule("block")
specterModule("config")
specterModule("core")
specterModule("entity")
specterModule("item")
specterModule("registry")
specterModule("render")

modRuntimeOnly("dev.spiritstudios.specter:specter-debug:${deps.specter}")

// will be switched back to lambdynamiclights once it's updated
modCompileOnly("maven.modrinth:ryoamiclights:0.2.9+mc1.21-fabric")
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

mod.version = 1.2.3
mod.group = dev.callmeecho
mod.version = 1.2.5
mod.group = dev.spiritstudios
mod.id = hollow

deps.minecraft=1.21
deps.loader=0.15.11
deps.yarn=1.21+build.9

deps.fabricapi=0.100.7+1.21
deps.cabinetapi=1.3.5+1.21
deps.fabricapi=0.103.0+1.21.1
deps.specter=1.0.2
62 changes: 0 additions & 62 deletions src/client/java/dev/callmeecho/hollow/HollowClient.java

This file was deleted.

43 changes: 43 additions & 0 deletions src/client/java/dev/spiritstudios/hollow/HollowClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package dev.spiritstudios.hollow;

import dev.spiritstudios.hollow.block.HollowLogBlock;
import dev.spiritstudios.hollow.particle.FireflyJarParticle;
import dev.spiritstudios.hollow.registry.*;
import dev.spiritstudios.hollow.render.entity.FireflyEntityRenderer;
import dev.spiritstudios.hollow.render.entity.JarBlockEntityRenderer;
import dev.spiritstudios.specter.api.ModMenuHelper;
import dev.spiritstudios.specter.api.core.util.ReflectionHelper;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
import net.minecraft.util.Identifier;

public class HollowClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
EntityRendererRegistry.register(HollowEntityTypeRegistrar.FIREFLY, FireflyEntityRenderer::new);

ModelPredicateProviderRegistry.register(
HollowItemRegistrar.COPPER_HORN,
Identifier.ofVanilla("tooting"),
(stack, world, entity, seed) -> entity != null && entity.isUsingItem() && entity.getActiveItem() == stack ? 1.0F : 0.0F
);

BlockEntityRendererFactories.register(HollowBlockEntityRegistrar.JAR_BLOCK_ENTITY, JarBlockEntityRenderer::new);

ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlockRegistrar.LOTUS_LILYPAD);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItemRegistrar.LOTUS_LILYPAD);

ColorProviderRegistry.BLOCK.register((state, world, pos, tintIndex) -> world != null && pos != null ? 0x208030 : 0x71C35C, HollowBlockRegistrar.GIANT_LILYPAD);
ColorProviderRegistry.ITEM.register((stack, tintIndex) -> tintIndex == 0 ? 0x71C35C : -1, HollowItemRegistrar.GIANT_LILYPAD);

ParticleFactoryRegistry.getInstance().register(HollowParticleRegistrar.FIREFLY_JAR, FireflyJarParticle.Factory::new);

ModMenuHelper.addConfig(Hollow.MODID, HollowConfig.INSTANCE.getId());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.callmeecho.hollow;
package dev.spiritstudios.hollow;

import dev.callmeecho.hollow.registry.HollowEntityTypeRegistrar;
import dev.spiritstudios.hollow.registry.HollowEntityTypeRegistrar;
import dev.lambdaurora.lambdynlights.api.DynamicLightsInitializer;
import net.minecraft.util.math.MathHelper;
import org.thinkingstudio.ryoamiclights.api.DynamicLightHandlers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.callmeecho.hollow.mixin.client;
package dev.spiritstudios.hollow.mixin.client;

import com.llamalad7.mixinextras.sugar.Local;
import dev.callmeecho.cabinetapi.util.Easing;
import dev.callmeecho.hollow.HollowTags;
import dev.spiritstudios.hollow.HollowTags;
import dev.spiritstudios.specter.api.core.util.Easing;
import net.minecraft.block.enums.CameraSubmersionType;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.BackgroundRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.callmeecho.hollow.particle;
package dev.spiritstudios.hollow.particle;

import net.minecraft.client.particle.*;
import net.minecraft.client.world.ClientWorld;
Expand Down Expand Up @@ -35,16 +35,13 @@ public ParticleTextureSheet getType() {
public void tick() {
super.tick();

if (this.age % 5 == 0 && this.random.nextInt(5) == 0) {
lightTicks -= this.random.nextBetween(10, 15);
} else {
lightTicks += 1;
}
if (this.age % 5 == 0 && this.random.nextInt(5) == 0) lightTicks -= this.random.nextBetween(10, 15);
else lightTicks += 1;

lightTicks = MathHelper.clamp(lightTicks, 0, 15);

double newY = MathHelper.sin((float) this.age / 15) * 0.0025;
double newXZ = MathHelper.cos((float) this.age / 15) * 0.0025;
double newY = MathHelper.sin((float) this.age / 15) * 0.0015;
double newXZ = MathHelper.cos((float) this.age / 15) * 0.0015;

this.x += xMover ? newXZ : -newXZ;
this.z += xMover ? newXZ : -newXZ;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.callmeecho.hollow.render.entity;
package dev.spiritstudios.hollow.render.entity;

import dev.callmeecho.hollow.entity.FireflyEntity;
import dev.spiritstudios.hollow.entity.FireflyEntity;
import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
Expand All @@ -14,7 +14,7 @@
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RotationAxis;

import static dev.callmeecho.hollow.Hollow.MODID;
import static dev.spiritstudios.hollow.Hollow.MODID;

public class FireflyEntityRenderer extends EntityRenderer<FireflyEntity> {
private static final Identifier TEXTURE = Identifier.of(MODID, "textures/entity/firefly.png");
Expand Down Expand Up @@ -54,18 +54,22 @@ protected int getBlockLight(FireflyEntity entity, BlockPos pos) {
}

private void renderVertex(VertexConsumer vertexConsumer, MatrixStack.Entry entry, float x, float y, float u, float v, FireflyEntity entity, int light) {
int color = ColorHelper.Argb.lerp(MathHelper.clampedLerp(0.0F, 15.0F, (1.0F - entity.getLightTicks() / 10.0F)) / 15.0F, 0xFF92CF40, 0xFF30352F);

float red = ColorHelper.Argb.getRed(color);
float green = ColorHelper.Argb.getGreen(color);
float blue = ColorHelper.Argb.getBlue(color);
float red;
float green;
float blue;

if (entity.hasCustomName() && "jeb_".equals(entity.getName().getString())) {
red = MathHelper.sin(entity.age * 0.1F) * 128.0F + 128.0F;
green = MathHelper.sin(entity.age * 0.1F + (float) Math.toRadians(120.0F)) * 128.0F + 128.0F;
blue = MathHelper.sin(entity.age * 0.1F + (float) Math.toRadians(240.0F)) * 128.0F + 128.0F;
} else {
int color = ColorHelper.Argb.lerp(MathHelper.clampedLerp(0.0F, 15.0F, (1.0F - entity.getLightTicks() / 10.0F)) / 15.0F, 0xFF92CF40, 0xFF30352F);

red = ColorHelper.Argb.getRed(color);
green = ColorHelper.Argb.getGreen(color);
blue = ColorHelper.Argb.getBlue(color);
}

vertexConsumer.vertex(entry, x - 0.5F, y - 0.25F, 0.0F)
.color(red / 255.0F, green / 255.0F, blue / 255.0F, 1.0F)
.texture(u, v)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.callmeecho.hollow.render.entity;
package dev.spiritstudios.hollow.render.entity;

import dev.callmeecho.hollow.block.entity.JarBlockEntity;
import dev.spiritstudios.hollow.block.entity.JarBlockEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/client/resources/hollow.client.mixins.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"required": true,
"minVersion": "0.8",
"package": "dev.callmeecho.hollow.mixin.client",
"package": "dev.spiritstudios.hollow.mixin.client",
"compatibilityLevel": "JAVA_21",
"client": [
"BackgroundRendererMixin"
Expand Down
Loading

0 comments on commit 7e2c0e7

Please sign in to comment.