Skip to content

Commit

Permalink
Wtf git???????
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugman76 committed Apr 6, 2024
1 parent b208444 commit 9bb6329
Show file tree
Hide file tree
Showing 20 changed files with 204 additions and 204 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Due to a missing Fabric API module, versions from v2.5.0 to v4.0.0 require [Terr

### Monsters

* **Sunken Skeleton** in oceans
* **Sunken** in oceans
* **Lush Creepers** in caves


Expand Down
2 changes: 1 addition & 1 deletion curseforge.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3>Animals</h3>

<h3>Monsters</h3>
<ul>
<li><b>Sunken Skeleton</b> in oceans</li>
<li><b>Sunken</b> in oceans</li>
<li><b>Lush Creepers</b> in caves</li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion modrinth.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Due to a missing Fabric API module, versions from v2.5.0 to v4.0.0 require [Terr

### Monsters

* **Sunken Skeleton** in oceans
* **Sunken** in oceans
* **Lush Creepers** in caves


Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/hugman/promenade/PromenadeClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import fr.hugman.promenade.client.render.entity.CapybaraRenderer;
import fr.hugman.promenade.client.render.entity.DuckRenderer;
import fr.hugman.promenade.client.render.entity.LushCreeperRenderer;
import fr.hugman.promenade.client.render.entity.SunkenSkeletonRenderer;
import fr.hugman.promenade.client.render.entity.SunkenRenderer;
import fr.hugman.promenade.client.render.entity.model.PromenadeEntityModelLayers;
import fr.hugman.promenade.entity.PromenadeEntityTypes;
import fr.hugman.promenade.particle.FallingLeafParticle;
Expand Down Expand Up @@ -166,6 +166,6 @@ public static void registerEntityRenderers() {
EntityRendererRegistry.register(PromenadeEntityTypes.CAPYBARA, CapybaraRenderer::new);
EntityRendererRegistry.register(PromenadeEntityTypes.DUCK, DuckRenderer::new);
EntityRendererRegistry.register(PromenadeEntityTypes.LUSH_CREEPER, LushCreeperRenderer::new);
EntityRendererRegistry.register(PromenadeEntityTypes.SUNKEN_SKELETON, SunkenSkeletonRenderer::new);
EntityRendererRegistry.register(PromenadeEntityTypes.SUNKEN, SunkenRenderer::new);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public CapybaraRenderer(EntityRendererFactory.Context context) {

@Override
public Identifier getTexture(CapybaraEntity entity) {
return entity.getBaseTexture();
return entity.getTexture();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package fr.hugman.promenade.client.render.entity;

import fr.hugman.promenade.Promenade;
import fr.hugman.promenade.client.render.entity.model.PromenadeEntityModelLayers;
import fr.hugman.promenade.client.render.entity.model.SunkenModel;
import fr.hugman.promenade.entity.SunkenEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.entity.BipedEntityRenderer;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.render.entity.feature.ArmorFeatureRenderer;
import net.minecraft.client.render.entity.model.EntityModelLayer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RotationAxis;
import net.minecraft.util.math.Vec3d;

@Environment(EnvType.CLIENT)
public class SunkenRenderer extends BipedEntityRenderer<SunkenEntity, SunkenModel> {
public SunkenRenderer(EntityRendererFactory.Context context) {
this(context, PromenadeEntityModelLayers.SUNKEN, PromenadeEntityModelLayers.SUNKEN_INNER_ARMOR, PromenadeEntityModelLayers.SUNKEN_OUTER_ARMOR);
}

public SunkenRenderer(EntityRendererFactory.Context ctx, EntityModelLayer layer, EntityModelLayer legArmorLayer, EntityModelLayer bodyArmorLayer) {
super(ctx, new SunkenModel(ctx.getPart(layer)), 0.5F);
this.addFeature(new ArmorFeatureRenderer<>(this, new SunkenModel(ctx.getPart(legArmorLayer)), new SunkenModel(ctx.getPart(bodyArmorLayer)), ctx.getModelManager()));
}

@Override
protected void setupTransforms(SunkenEntity sunkenEntity, MatrixStack matrixStack, float animationProgress, float bodyYaw, float tickDelta, float scale) {
float i = sunkenEntity.getLeaningPitch(tickDelta);
float n;
float k;
if (sunkenEntity.isFallFlying()) {
super.setupTransforms(sunkenEntity, matrixStack, animationProgress, bodyYaw, tickDelta, scale);
n = (float) sunkenEntity.getFallFlyingTicks() + tickDelta;
k = MathHelper.clamp(n * n / 100.0F, 0.0F, 1.0F);
if (!sunkenEntity.isUsingRiptide()) {
matrixStack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(k * (-90.0F - sunkenEntity.getPitch())));
}

Vec3d vec3d = sunkenEntity.getRotationVec(tickDelta);
Vec3d vec3d2 = sunkenEntity.getVelocity();
double d = vec3d2.horizontalLengthSquared();
double e = vec3d.horizontalLengthSquared();
if (d > 0.0D && e > 0.0D) {
double l = (vec3d2.x * vec3d.x + vec3d2.z * vec3d.z) / Math.sqrt(d * e);
double m = vec3d2.x * vec3d.z - vec3d2.z * vec3d.x;
matrixStack.multiply(RotationAxis.POSITIVE_Y.rotation((float) (Math.signum(m) * Math.acos(l))));
}
} else if (i > 0.0F) {
super.setupTransforms(sunkenEntity, matrixStack, animationProgress, bodyYaw, tickDelta, scale);
n = sunkenEntity.isTouchingWater() ? -90.0F - sunkenEntity.getPitch() : -90.0F;
k = MathHelper.lerp(i, 0.0F, n);
matrixStack.multiply(RotationAxis.POSITIVE_X.rotationDegrees(k));
if (sunkenEntity.isInSwimmingPose()) {
matrixStack.translate(0.0D, -1.0D, 0.30000001192092896D);
}
} else {
super.setupTransforms(sunkenEntity, matrixStack, animationProgress, bodyYaw, tickDelta, scale);
}
}

@Override
public Identifier getTexture(SunkenEntity entity) {
return Promenade.id("textures/entity/sunken/" + entity.getVariant().getName() + ".png");
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public class PromenadeEntityModelLayers {
public static final EntityModelLayer LUSH_CREEPER = createModelLayer("lush_creeper");
public static final EntityModelLayer LUSH_CREEPER_OUTER = createModelLayer("lush_creeper", "outer");

public static final EntityModelLayer SUNKEN_SKELETON = createModelLayer("sunken_skeleton");
public static final EntityModelLayer SUNKEN_SKELETON_INNER_ARMOR = createModelLayerInnerArmor("sunken_skeleton");
public static final EntityModelLayer SUNKEN_SKELETON_OUTER_ARMOR = createModelLayerOuterArmor("sunken_skeleton");
public static final EntityModelLayer SUNKEN = createModelLayer("sunken");
public static final EntityModelLayer SUNKEN_INNER_ARMOR = createModelLayerInnerArmor("sunken");
public static final EntityModelLayer SUNKEN_OUTER_ARMOR = createModelLayerOuterArmor("sunken");

private static final Dilation ARMOR_DILATION = new Dilation(1.0F);
private static final Dilation HAT_DILATION = new Dilation(0.5F);
Expand All @@ -33,9 +33,9 @@ public static void init() {
EntityModelLayerRegistry.registerModelLayer(DUCK, DuckModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(LUSH_CREEPER, () -> CreeperEntityModel.getTexturedModelData(Dilation.NONE));
EntityModelLayerRegistry.registerModelLayer(LUSH_CREEPER_OUTER, () -> CreeperEntityModel.getTexturedModelData(new Dilation(0.25f)));
EntityModelLayerRegistry.registerModelLayer(SUNKEN_SKELETON, SunkenSkeletonModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(SUNKEN_SKELETON_INNER_ARMOR, () -> INNER_ARMOR_MODEL_DATA);
EntityModelLayerRegistry.registerModelLayer(SUNKEN_SKELETON_OUTER_ARMOR, () -> OUTER_ARMOR_MODEL_DATA);
EntityModelLayerRegistry.registerModelLayer(SUNKEN, SunkenModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(SUNKEN_INNER_ARMOR, () -> INNER_ARMOR_MODEL_DATA);
EntityModelLayerRegistry.registerModelLayer(SUNKEN_OUTER_ARMOR, () -> OUTER_ARMOR_MODEL_DATA);
}

private static EntityModelLayer createModelLayer(String name) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fr.hugman.promenade.client.render.entity.model;

import fr.hugman.promenade.entity.SunkenSkeletonEntity;
import fr.hugman.promenade.entity.SunkenEntity;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.model.*;
Expand All @@ -11,8 +11,8 @@
import net.minecraft.util.Arm;

@Environment(EnvType.CLIENT)
public class SunkenSkeletonModel extends SkeletonEntityModel<SunkenSkeletonEntity> {
public SunkenSkeletonModel(ModelPart root) {
public class SunkenModel extends SkeletonEntityModel<SunkenEntity> {
public SunkenModel(ModelPart root) {
super(root);
}

Expand All @@ -28,7 +28,7 @@ public static TexturedModelData getTexturedModelData() {
}

@Override
public void animateModel(SunkenSkeletonEntity mobEntity, float f, float g, float h) {
public void animateModel(SunkenEntity mobEntity, float f, float g, float h) {
super.animateModel(mobEntity, f, g, h);

this.hat.visible = mobEntity.getEquippedStack(EquipmentSlot.HEAD).isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public static class MonstersCategory implements ConfigData {
public int lush_creepers_weight = 15;
@ConfigEntry.Gui.RequiresRestart
@ConfigEntry.BoundedDiscrete(min = 0, max = 100)
public int sunken_skeletons_weight = 20;
public int sunkens_weight = 20;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class PromenadeEntityTypes {
.trackRangeChunks(8)
.defaultAttributes(LushCreeperEntity::createCreeperAttributes)
.spawnRestriction(SpawnLocationTypes.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, LushCreeperEntity::canSpawn));
public static final EntityType<SunkenSkeletonEntity> SUNKEN_SKELETON = of("sunken_skeleton", FabricEntityTypeBuilder.createMob()
.entityFactory(SunkenSkeletonEntity::new)
public static final EntityType<SunkenEntity> SUNKEN = of("sunken", FabricEntityTypeBuilder.createMob()
.entityFactory(SunkenEntity::new)
.spawnGroup(SpawnGroup.MONSTER)
.dimensions(EntityDimensions.changing(0.6F, 1.99F).withEyeHeight(1.74F))
.trackRangeChunks(8)
.defaultAttributes(SunkenSkeletonEntity::createSunkenSkeletonAttributes)
.spawnRestriction(SpawnLocationTypes.IN_WATER, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, SunkenSkeletonEntity::canSpawn));
.defaultAttributes(SunkenEntity::createSunkenAttributes)
.spawnRestriction(SpawnLocationTypes.IN_WATER, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, SunkenEntity::canSpawn));

private static <T extends Entity> EntityType<T> of(String path, FabricEntityTypeBuilder<T> builder) {
return Registry.register(Registries.ENTITY_TYPE, Promenade.id(path), builder.build());
Expand All @@ -61,8 +61,8 @@ public static void appendWorldGen() {
BiomeModifications.addSpawn(BiomeSelectors.spawnsOneOf(EntityType.CREEPER).and(BiomeSelectors.excludeByKey(BiomeKeys.LUSH_CAVES)), SpawnGroup.MONSTER, LUSH_CREEPER, Promenade.CONFIG.monsters.lush_creepers_weight, 2, 3);
BiomeModifications.addSpawn(BiomeSelectors.includeByKey(BiomeKeys.LUSH_CAVES), SpawnGroup.MONSTER, LUSH_CREEPER, Promenade.CONFIG.monsters.lush_creepers_weight * 4, 2, 4);
}
if (Promenade.CONFIG.monsters.sunken_skeletons_weight != 0) {
BiomeModifications.addSpawn(biomeSelectionContext -> biomeSelectionContext.hasTag(PromenadeBiomeTags.SUNKEN_SKELETON_SPAWN), SpawnGroup.MONSTER, SUNKEN_SKELETON, Promenade.CONFIG.monsters.sunken_skeletons_weight, 1, 3);
if (Promenade.CONFIG.monsters.sunkens_weight != 0) {
BiomeModifications.addSpawn(biomeSelectionContext -> biomeSelectionContext.hasTag(PromenadeBiomeTags.SUNKEN_SPAWN), SpawnGroup.MONSTER, SUNKEN, Promenade.CONFIG.monsters.sunkens_weight, 1, 3);
}
}
}
Loading

0 comments on commit 9bb6329

Please sign in to comment.