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

Commit

Permalink
Port all cosmetics to 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor4t committed Jul 7, 2021
1 parent f292b31 commit 1860edd
Show file tree
Hide file tree
Showing 25 changed files with 249 additions and 267 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public class IlluminationsClient implements ClientModInitializer {
public static final BiPredicate<World, BlockPos> PLANKTON_LOCATION_PREDICATE = (world, blockPos) -> world.getBlockState(blockPos).getFluidState().isIn(FluidTags.WATER) && world.getLightLevel(blockPos) < 2;
public static final BiPredicate<World, BlockPos> EYES_LOCATION_PREDICATE = (world, blockPos) -> ((Config.getEyesInTheDark() == Config.EyesInTheDark.ENABLE && LocalDate.now().getMonth() == Month.OCTOBER) || Config.getEyesInTheDark() == Config.EyesInTheDark.ALWAYS) && (world.getBlockState(blockPos).getBlock() == Blocks.AIR || world.getBlockState(blockPos).getBlock() == Blocks.CAVE_AIR) && world.getLightLevel(blockPos) <= 0 && world.getClosestPlayer(blockPos.getX(), blockPos.getY(), blockPos.getZ(), EYES_VANISHING_DISTANCE, false) == null && world.getRegistryKey().equals(World.OVERWORLD);
public static final BiPredicate<World, BlockPos> WISP_LOCATION_PREDICATE = (world, blockPos) -> world.getBlockState(blockPos).isIn(BlockTags.SOUL_FIRE_BASE_BLOCKS);
// register overhead models
public static final EntityModelLayer CROWN = new EntityModelLayer(new Identifier(MODID, "crown"), "main");
static final Type COSMETIC_SELECT_TYPE = new TypeToken<Map<UUID, PlayerCosmeticData>>() {
}.getType();
// illuminations cosmetics
Expand Down Expand Up @@ -122,10 +124,6 @@ public class IlluminationsClient implements ClientModInitializer {
public static ImmutableMap<Biome.Category, ImmutableSet<IlluminationData>> ILLUMINATIONS_BIOME_CATEGORIES;
public static ImmutableMap<Identifier, ImmutableSet<IlluminationData>> ILLUMINATIONS_BIOMES;

// register overhead models
public static final EntityModelLayer CROWN = new EntityModelLayer(new Identifier(MODID, "crown"), "main");


public static void loadPlayerCosmetics() {
// get illuminations player cosmetics
CompletableFuture.supplyAsync(() -> {
Expand Down Expand Up @@ -167,7 +165,13 @@ public void onInitializeClient() {
IlluminationsUpdater.init();
}

// register model layers
EntityModelLayerRegistry.registerModelLayer(CrownModel.MODEL_LAYER, CrownModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(HornsModel.MODEL_LAYER, HornsModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(HaloModel.MODEL_LAYER, HaloModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(TiaraModel.MODEL_LAYER, TiaraModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(VoidheartTiaraModel.MODEL_LAYER, VoidheartTiaraModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(WreathModel.MODEL_LAYER, WreathModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(WillOWispModel.MODEL_LAYER, WillOWispModel::getTexturedModelData);

// particles
Expand Down Expand Up @@ -287,16 +291,16 @@ public Codec<WispTrailParticleEffect> getCodec() {
.put("frost_crown", new OverheadData(CrownModel::new, "frost_crown"))
.put("pyro_crown", new OverheadData(CrownModel::new, "pyro_crown"))
.put("chorus_crown", new OverheadData(CrownModel::new, "chorus_crown"))
// .put("deepsculk_horns", new OverheadData(HornEntityModel::new, "deepsculk_horns"))
// .put("springfae_horns", new OverheadData(HornEntityModel::new, "springfae_horns"))
.put("bloodfiend_crown", new OverheadData(CrownModel::new, "bloodfiend_crown"))
.put("dreadlich_crown", new OverheadData(CrownModel::new, "dreadlich_crown"))
.put("mooncult_crown", new OverheadData(CrownModel::new, "mooncult_crown"))
// .put("voidheart_tiara", new OverheadData(VoidheartTiaraEntityModel::new, "voidheart_tiara"))
// .put("worldweaver_halo", new OverheadData(WorldweaverHaloEntityModel::new, "worldweaver_halo"))
// .put("summerbreeze_wreath", new OverheadData(WreathEntityModel::new, "summerbreeze_wreath"))
// .put("glowsquid_cult_crown", new OverheadData(TiaraCrownEntityModel::new, "glowsquid_cult_crown"))
// .put("timeaspect_cult_crown", new OverheadData(TiaraCrownEntityModel::new, "timeaspect_cult_crown"))
.put("deepsculk_horns", new OverheadData(HornsModel::new, "deepsculk_horns"))
.put("springfae_horns", new OverheadData(HornsModel::new, "springfae_horns"))
.put("voidheart_tiara", new OverheadData(VoidheartTiaraModel::new, "voidheart_tiara"))
.put("worldweaver_halo", new OverheadData(HaloModel::new, "worldweaver_halo"))
.put("summerbreeze_wreath", new OverheadData(WreathModel::new, "summerbreeze_wreath"))
.put("glowsquid_cult_crown", new OverheadData(TiaraModel::new, "glowsquid_cult_crown"))
.put("timeaspect_cult_crown", new OverheadData(TiaraModel::new, "timeaspect_cult_crown"))
.build();
PETS_DATA = ImmutableMap.<String, DefaultParticleType>builder()
.put("pride", PRIDE_PET)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ladysnake.illuminations.client.gui;

import com.mojang.blaze3d.systems.RenderSystem;
import ladysnake.illuminations.client.IlluminationsClient;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.TitleScreen;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.tag.FluidTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;
import net.minecraft.world.LightType;

import java.time.LocalDate;
Expand All @@ -34,6 +30,7 @@ public class FireflyParticle extends SpriteBillboardParticle {
protected int maxHeight;
private BlockPos lightTarget;
private boolean isAttractedByLight = false;

public FireflyParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) {
super(world, x, y, z, velocityX, velocityY, velocityZ);
this.spriteProvider = spriteProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
Expand All @@ -30,6 +26,7 @@ public class GlowwormParticle extends SpriteBillboardParticle {
private int targetChangeCooldown = 0;
private boolean isAttractedByLight = false;
private int maxHeight;

private GlowwormParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) {
super(world, x, y, z, velocityX, velocityY, velocityZ);
this.spriteProvider = spriteProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.tag.FluidTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;

import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
Expand All @@ -29,6 +25,7 @@ public class PlanktonParticle extends SpriteBillboardParticle {
private double yTarget;
private double zTarget;
private int targetChangeCooldown = 0;

private PlanktonParticle(ClientWorld world, double x, double y, double z, double velocityX, double velocityY, double velocityZ, SpriteProvider spriteProvider) {
super(world, x, y, z, velocityX, velocityY, velocityZ);
this.spriteProvider = spriteProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.client.particle.SpriteProvider;
import net.minecraft.client.render.*;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.Entity;
import net.minecraft.particle.BlockStateParticleEffect;
Expand All @@ -28,6 +27,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vec3f;

import java.util.stream.Stream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vec3f;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.ai.TargetPredicate;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vec3f;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
import net.minecraft.client.particle.*;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@
import net.minecraft.client.particle.SpriteProvider;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.ai.TargetPredicate;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
import net.minecraft.client.particle.SpriteProvider;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.*;

public class JackoParticle extends PetParticle {
private float glow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
import net.minecraft.client.particle.SpriteProvider;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.util.math.Vec3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.ai.TargetPredicate;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Quaternion;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.Vec3f;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import net.minecraft.util.Identifier;

public class DripFeatureRenderer extends FeatureRenderer<AbstractClientPlayerEntity, PlayerEntityModel<AbstractClientPlayerEntity>> {
private final BipedEntityModel<AbstractClientPlayerEntity> playerModel;
private static final Identifier dripTexture = new Identifier("illuminations", "textures/entity/drip.png");
private static final Identifier dripColorTexture = new Identifier("illuminations", "textures/entity/drip_color.png");
private final BipedEntityModel<AbstractClientPlayerEntity> playerModel;

public DripFeatureRenderer(FeatureRendererContext<AbstractClientPlayerEntity, PlayerEntityModel<AbstractClientPlayerEntity>> featureContext, EntityRendererFactory.Context registrationContext) {
super(featureContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// Made with Model Converter by Globox_Z
// Generate all required imports
// Made with Blockbench 3.8.4
// Exported for Minecraft version 1.15
// Paste this class into your mod and generate all required imports
package ladysnake.illuminations.client.render.entity.model;

import ladysnake.illuminations.client.IlluminationsClient;
Expand All @@ -24,9 +19,9 @@ public CrownModel(EntityRendererFactory.Context ctx) {
ModelPart east_r1 = crown.getChild("east_r1");
ModelPart north_r1 = crown.getChild("north_r1");
ModelPart west_r1 = crown.getChild("west_r1");
setRotationAngle(west_r1, -0.2618F, 1.5708F, 0.0F);
setRotationAngle(east_r1, -0.2618F, 1.5708F, 0.0F);
setRotationAngle(north_r1, -0.2618F, 3.1416F, 0.0F);
setRotationAngle(east_r1, -0.2618F, -1.5708F, 0.0F);
setRotationAngle(west_r1, -0.2618F, -1.5708F, 0.0F);
setRotationAngle(south_r1, -0.2618F, 0.0F, 0.0F);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
//// Made with Model Converter by Globox_Z
//// Generate all required imports
//// Made with Blockbench 3.8.4
//// Exported for Minecraft version 1.15
//// Paste this class into your mod and generate all required imports
//package ladysnake.illuminations.client.render.entity.model;
//import net.minecraft.client.model.Model;
//public class HaloModel extends Model {
// private final ModelPart head;
// private final ModelPart crown;
// public HaloModel(ModelPart root) {
//this.head = root.getChild("head");
//this.crown = this.head.getChild("crown");
//}
//public static TexturedModelData getTexturedModelData() {
//ModelData modelData = new ModelData();
//ModelPartData modelPartData = modelData.getRoot();
//ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0,32).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, 0.0F, true), ModelTransform.pivot(0.0F,0.0F,0.0F));
//modelPartData1.addChild("crown", ModelPartBuilder.create().uv(0,0).cuboid(-8.0F, -11.0F, 5.0F, 16.0F, 16.0F, 0.0F, 0.0F, true), ModelTransform.pivot(0.0F,-4.0F,0.0F));
//return TexturedModelData.of(modelData,32,32);
// }
// @Override
// public void setAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
// //previously the render function, render code was moved to a method below
// }
// @Override
// public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
// head.render(matrixStack, buffer, packedLight, packedOverlay);
// }
// public void setRotationAngle(ModelPart bone, float x, float y, float z) {
// bone.pitch = x;
// bone.yaw = y;
// bone.roll = z;
// }
//}
package ladysnake.illuminations.client.render.entity.model;

import ladysnake.illuminations.client.IlluminationsClient;
import net.minecraft.client.model.*;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.model.EntityModelLayer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;

public class HaloModel extends OverheadModel {
public static final EntityModelLayer MODEL_LAYER = new EntityModelLayer(new Identifier(IlluminationsClient.MODID, "halo"), "main");

public HaloModel(EntityRendererFactory.Context ctx) {
super(ctx, MODEL_LAYER);
}

public static TexturedModelData getTexturedModelData() {
ModelData modelData = new ModelData();
ModelPartData modelPartData = modelData.getRoot();
ModelPartData modelPartData1 = modelPartData.addChild("head", ModelPartBuilder.create().uv(0, 7).cuboid(-4.0F, -8.0F, -4.0F, 8.0F, 8.0F, 8.0F, new Dilation(-4.0f)), ModelTransform.pivot(0.0F, 0.0F, 0.0F));
modelPartData1.addChild("halo", ModelPartBuilder.create().uv(0, 0).cuboid(-8.0F, -11.0F, 5.0F, 16.0F, 16.0F, 0.0F), ModelTransform.pivot(0.0F, -4.0F, 0.0F));
return TexturedModelData.of(modelData, 32, 48);
}

@Override
public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
head.render(matrixStack, buffer, packedLight, packedOverlay);
}

public void setRotationAngle(ModelPart bone, float x, float y, float z) {
bone.pitch = x;
bone.yaw = y;
bone.roll = z;
}
}
Loading

0 comments on commit 1860edd

Please sign in to comment.