generated from QuiltMC/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6223322
commit 0004e5b
Showing
26 changed files
with
574 additions
and
44 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
common/src/generated/resources/assets/wwizardry/lang/en_us.json
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
common/src/generated/resources/data/wwizardry/tags/blocks/damages_snail.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"replace":false,"values":[{"required":false,"id":"copper_block"},{"required":false,"id":"exposed_copper"},{"required":false,"id":"weathered_copper"},{"required":false,"id":"oxidized_copper"},{"required":false,"id":"waxed_copper_block"},{"required":false,"id":"waxed_exposed_copper"},{"required":false,"id":"waxed_weathered_copper"},{"required":false,"id":"waxed_oxidized_copper"},{"required":false,"id":"cut_copper"},{"required":false,"id":"exposed_cut_copper"},{"required":false,"id":"weathered_cut_copper"},{"required":false,"id":"oxidized_cut_copper"},{"required":false,"id":"waxed_cut_copper"},{"required":false,"id":"waxed_exposed_cut_copper"},{"required":false,"id":"waxed_weathered_cut_copper"},{"required":false,"id":"waxed_oxidized_cut_copper"},{"required":false,"id":"cut_copper_stairs"},{"required":false,"id":"exposed_cut_copper_stairs"},{"required":false,"id":"weathered_cut_copper_stairs"},{"required":false,"id":"oxidized_cut_copper_stairs"},{"required":false,"id":"waxed_cut_copper"},{"required":false,"id":"waxed_exposed_cut_copper_stairs"},{"required":false,"id":"waxed_weathered_cut_copper_stairs"},{"required":false,"id":"waxed_oxidized_cut_copper_stairs"},{"required":false,"id":"cut_copper_slab"},{"required":false,"id":"exposed_cut_copper_slab"},{"required":false,"id":"weathered_cut_copper_slab"},{"required":false,"id":"oxidized_cut_copper_slab"},{"required":false,"id":"waxed_cut_copper_slab"},{"required":false,"id":"waxed_exposed_cut_copper_slab"},{"required":false,"id":"waxed_weathered_cut_copper_slab"},{"required":false,"id":"waxed_oxidized_cut_copper_slab"},{"required":false,"id":"chiseled_copper"},{"required":false,"id":"exposed_chiseled_copper"},{"required":false,"id":"weathered_chiseled_copper"},{"required":false,"id":"oxidized_chiseled_copper"},{"required":false,"id":"waxed_chiseled_copper"},{"required":false,"id":"waxed_exposed_chiseled_copper"},{"required":false,"id":"waxed_weathered_chiseled_copper"},{"required":false,"id":"waxed_oxidized_chiseled_copper"},{"required":false,"id":"copper_grate"},{"required":false,"id":"exposed_copper_grate"},{"required":false,"id":"weathered_copper_grate"},{"required":false,"id":"oxidized_copper_grate"},{"required":false,"id":"waxed_copper_grate"},{"required":false,"id":"waxed_exposed_copper_grate"},{"required":false,"id":"waxed_weathered_copper_grate"},{"required":false,"id":"waxed_oxidized_copper_grate"},{"required":false,"id":"copper_bulb"},{"required":false,"id":"exposed_copper_bulb"},{"required":false,"id":"weathered_copper_bulb"},{"required":false,"id":"oxidized_copper_bulb"},{"required":false,"id":"waxed_copper_bulb"},{"required":false,"id":"waxed_exposed_copper_bulb"},{"required":false,"id":"waxed_weathered_copper_bulb"},{"required":false,"id":"waxed_oxidized_copper_bulb"},{"required":false,"id":"copper_door"},{"required":false,"id":"exposed_copper_door"},{"required":false,"id":"weathered_copper_door"},{"required":false,"id":"oxidized_copper_door"},{"required":false,"id":"waxed_copper_door"},{"required":false,"id":"waxed_exposed_copper_door"},{"required":false,"id":"waxed_weathered_copper_door"},{"required":false,"id":"waxed_oxidized_copper_door"},{"required":false,"id":"copper_trapdoor"},{"required":false,"id":"exposed_copper_trapdoor"},{"required":false,"id":"weathered_copper_trapdoor"},{"required":false,"id":"oxidized_copper_trapdoor"},{"required":false,"id":"waxed_copper_trapdoor"},{"required":false,"id":"waxed_exposed_copper_trapdoor"},{"required":false,"id":"waxed_weathered_copper_trapdoor"},{"required":false,"id":"waxed_oxidized_copper_trapdoor"}]} |
1 change: 1 addition & 0 deletions
1
common/src/generated/resources/data/wwizardry/tags/items/snail_food.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"replace":false,"values":[{"required":false,"id":"kelp"}]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
common/src/main/java/dev/sweetberry/wwizardry/client/render/entity/SnailRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package dev.sweetberry.wwizardry.client.render.entity; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import dev.sweetberry.wwizardry.WanderingWizardry; | ||
import dev.sweetberry.wwizardry.client.render.model.SnailModel; | ||
import dev.sweetberry.wwizardry.content.entity.Snail; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.client.renderer.entity.MobRenderer; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public class SnailRenderer extends MobRenderer<Snail, SnailModel> { | ||
public SnailRenderer(EntityRendererProvider.Context context) { | ||
super(context, new SnailModel(context.bakeLayer(SnailModel.LAYER_LOCATION)), 0.2f); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getTextureLocation(Snail snail) { | ||
return WanderingWizardry.id(snail.getVariant().getTextureName()); | ||
} | ||
|
||
@Override | ||
public void render(Snail snail, float $$1, float $$2, PoseStack stack, MultiBufferSource buffer, int $$5) { | ||
stack.pushPose(); | ||
final float scale = 0.6f; | ||
if (snail.isBaby()) | ||
stack.scale(scale, scale, scale); | ||
|
||
super.render(snail, $$1, $$2, stack, buffer, $$5); | ||
stack.popPose(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
common/src/main/java/dev/sweetberry/wwizardry/client/render/model/SnailModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package dev.sweetberry.wwizardry.client.render.model; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.blaze3d.vertex.VertexConsumer; | ||
import dev.sweetberry.wwizardry.WanderingWizardry; | ||
import dev.sweetberry.wwizardry.content.entity.Snail; | ||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.model.geom.ModelLayerLocation; | ||
import net.minecraft.client.model.geom.ModelPart; | ||
import net.minecraft.client.model.geom.PartPose; | ||
import net.minecraft.client.model.geom.builders.*; | ||
|
||
public class SnailModel extends EntityModel<Snail> { | ||
public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(WanderingWizardry.id("snail"), "main"); | ||
private final ModelPart body; | ||
private final ModelPart leftEye; | ||
private final ModelPart rightEye; | ||
private final ModelPart shell; | ||
|
||
public SnailModel(ModelPart root) { | ||
this.body = root.getChild("Body"); | ||
this.leftEye = root.getChild("EyeL"); | ||
this.rightEye = root.getChild("EyeR"); | ||
this.shell = root.getChild("Shell"); | ||
} | ||
|
||
public static LayerDefinition createBodyLayer() { | ||
MeshDefinition meshdefinition = new MeshDefinition(); | ||
PartDefinition partdefinition = meshdefinition.getRoot(); | ||
|
||
PartDefinition body = partdefinition.addOrReplaceChild("Body", CubeListBuilder.create().texOffs(0, 0).addBox(-1.5F, -1.0F, -3.5F, 3.0F, 1.0F, 7.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 24.0F, 0.0F)); | ||
|
||
PartDefinition leftEye = partdefinition.addOrReplaceChild("EyeL", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5F, -3.0F, -0.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.01F)), PartPose.offsetAndRotation(1.0F, 23.25F, -3.0F, 0.0873F, 0.0F, 0.0873F)); | ||
|
||
PartDefinition rightEye = partdefinition.addOrReplaceChild("EyeR", CubeListBuilder.create().texOffs(0, 0).addBox(-0.5F, -3.0F, -0.5F, 1.0F, 3.0F, 1.0F, new CubeDeformation(0.01F)), PartPose.offsetAndRotation(-1.0F, 23.25F, -3.0F, 0.0873F, 0.0F, -0.0873F)); | ||
|
||
PartDefinition shell = partdefinition.addOrReplaceChild("Shell", CubeListBuilder.create().texOffs(0, 8).addBox(-1.5F, -2.0F, -2.0F, 3.0F, 4.0F, 4.0F, new CubeDeformation(0.01F)), PartPose.offsetAndRotation(0.0F, 21.25F, 1.0F, -0.0873F, 0.0F, 0.0F)); | ||
|
||
PartDefinition shroom = shell.addOrReplaceChild("shroom", CubeListBuilder.create().texOffs(13, 4).addBox(-2.0F, -1.5F, 0.5F, 3.0F, 3.0F, 0.0F, new CubeDeformation(0.0F)) | ||
.texOffs(13, 1).addBox(-0.5F, -1.5F, -1.0F, 0.0F, 3.0F, 3.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(-0.25F, -3.25F, 1.25F, -0.1309F, -0.7854F, -0.0436F)); | ||
|
||
return LayerDefinition.create(meshdefinition, 32, 32); | ||
} | ||
|
||
@Override | ||
public void setupAnim(Snail entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {} | ||
|
||
@Override | ||
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { | ||
body.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
leftEye.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
rightEye.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
shell.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
common/src/main/java/dev/sweetberry/wwizardry/content/entity/EntityInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package dev.sweetberry.wwizardry.content.entity; | ||
|
||
import dev.sweetberry.wwizardry.WanderingWizardry; | ||
import dev.sweetberry.wwizardry.api.Lazy; | ||
import dev.sweetberry.wwizardry.api.registry.RegistryContext; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.entity.MobCategory; | ||
import net.minecraft.world.entity.ai.attributes.AttributeSupplier; | ||
import net.minecraft.world.phys.Vec3; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.function.Supplier; | ||
|
||
public class EntityInitializer { | ||
public static final RegistryContext<EntityType<?>> ENTITIES = new RegistryContext<>(BuiltInRegistries.ENTITY_TYPE); | ||
public static final List<AttributeSupplierData> SUPPLIER_DATA = new ArrayList<>(); | ||
|
||
public static final Lazy<EntityType<Snail>> SNAIL = registerEntity( | ||
"snail", | ||
() -> EntityType.Builder | ||
.of(Snail::new, MobCategory.CREATURE) | ||
.sized(0.4f, 0.4f) | ||
.passengerAttachments(new Vec3(0, 0.3125f, -0.0625f)) | ||
.eyeHeight(0.125f) | ||
.clientTrackingRange(10) | ||
.build("wwizardry:snail"), | ||
Snail::createAttributes | ||
); | ||
|
||
public static void init() {} | ||
|
||
public static <T extends Entity> Lazy<EntityType<T>> registerEntity(String id, Supplier<EntityType<T>> entity, Supplier<AttributeSupplier> supplier) { | ||
var value = EntityInitializer.<T>entities().register(WanderingWizardry.id(id), entity); | ||
SUPPLIER_DATA.add(new AttributeSupplierData((Supplier<EntityType<?>>) (Object) value, supplier.get())); | ||
return value; | ||
} | ||
|
||
public static <T extends Entity> RegistryContext<EntityType<T>> entities() { | ||
return (RegistryContext<EntityType<T>>) (Object) ENTITIES; | ||
} | ||
|
||
public record AttributeSupplierData(Supplier<EntityType<?>> entity, AttributeSupplier supplier) {} | ||
} |
Oops, something went wrong.