Skip to content

Commit

Permalink
Port to 1.21 (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Jun 25, 2024
1 parent d8bd7aa commit 8a27312
Show file tree
Hide file tree
Showing 59 changed files with 673 additions and 614 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
id "net.darkhax.curseforgegradle" version "1.1.17" apply(false)
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "net.darkhax.curseforgegradle" version "1.1.24" apply(false)
id "com.modrinth.minotaur" version "2.+" apply false
}

Expand Down Expand Up @@ -57,7 +57,7 @@ allprojects {

tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.getRelease().set(17)
it.options.getRelease().set(21)
}

java {
Expand Down
4 changes: 2 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ dependencies {
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury:${rootProject.architectury_version}"

modImplementation("vazkii.patchouli:Patchouli-xplat:${patchouli_version}-SNAPSHOT")
modImplementation("xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}")
// modImplementation("vazkii.patchouli:Patchouli-xplat:${patchouli_version}-SNAPSHOT")
// modImplementation("xyz.brassgoggledcoders:PatchouliProvider:${patchouli_provider_version}")
}

publishing {
Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/net/chococraft/Chococraft.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.chococraft.registry.ModRegistry;
import net.chococraft.registry.ModSounds;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
Expand Down
6 changes: 3 additions & 3 deletions common/src/main/java/net/chococraft/ChococraftClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import net.minecraft.resources.ResourceLocation;

public class ChococraftClient {
public static final ModelLayerLocation CHOCOBO = new ModelLayerLocation(new ResourceLocation(Chococraft.MOD_ID, "main"), "chocobo");
public static final ModelLayerLocation CHICOBO = new ModelLayerLocation(new ResourceLocation(Chococraft.MOD_ID, "main"), "chicobo");
public static final ModelLayerLocation CHOCO_DISGUISE = new ModelLayerLocation(new ResourceLocation(Chococraft.MOD_ID, "main"), "choco_disguise");
public static final ModelLayerLocation CHOCOBO = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "main"), "chocobo");
public static final ModelLayerLocation CHICOBO = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "main"), "chicobo");
public static final ModelLayerLocation CHOCO_DISGUISE = new ModelLayerLocation(ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "main"), "choco_disguise");

public static void init() {
Chococraft.LOGGER.info("Registering chocobo screen");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.chococraft.common.entity.properties.MovementType;
import net.chococraft.common.inventory.SaddleBagMenu;
import net.chococraft.common.items.armor.AbstractChocoDisguiseItem;
import net.minecraft.core.Holder;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.syncher.EntityDataSerializer;
import net.minecraft.world.entity.EntityType;
Expand Down Expand Up @@ -50,7 +51,7 @@ public static SaddleBagMenu constructMenu(int i, Inventory inventory, AbstractCh
}

@ExpectPlatform
public static AbstractChocoDisguiseItem constructChocoDisguise(ArmorMaterial material, ArmorItem.Type type, Item.Properties properties) {
public static AbstractChocoDisguiseItem constructChocoDisguise(Holder<ArmorMaterial> material, ArmorItem.Type type, Item.Properties properties) {
// Just throw an error, the content should get replaced at runtime.
throw new AssertionError();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


public class ChocoboBookScreen extends Screen {
private final static ResourceLocation TEXTURE = new ResourceLocation(Chococraft.MOD_ID, "textures/gui/chocobo_book.png");
private final static ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/gui/chocobo_book.png");
private final Component bookTitle = Component.literal("The Chocopedia").withStyle(ChatFormatting.GOLD);
private final Component bookAuthor = Component.literal("by Clienthax");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import net.minecraft.world.item.ItemStack;

public class ChocoboInventoryScreen extends AbstractContainerScreen<SaddleBagMenu> {
private static final ResourceLocation INV_TEXTURE_NULL = new ResourceLocation(Chococraft.MOD_ID, "textures/gui/chocobo_inventory_null.png");
private static final ResourceLocation INV_TEXTURE_SMALL = new ResourceLocation(Chococraft.MOD_ID, "textures/gui/chocobo_inventory_small.png");
private static final ResourceLocation INV_TEXTURE_LARGE = new ResourceLocation(Chococraft.MOD_ID, "textures/gui/chocobo_inventory_large.png");
private static final ResourceLocation INV_TEXTURE_NULL = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/gui/chocobo_inventory_null.png");
private static final ResourceLocation INV_TEXTURE_SMALL = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/gui/chocobo_inventory_small.png");
private static final ResourceLocation INV_TEXTURE_LARGE = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/gui/chocobo_inventory_large.png");


public ChocoboInventoryScreen(SaddleBagMenu container, Inventory playerInventory, Component title) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void setupAnim(LivingEntity livingEntity, float limbSwing, float limbSwin
}

@Override
public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, int color) {
poseStack.pushPose();

this.setHeadRotation();
Expand All @@ -201,22 +201,22 @@ public void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packe
float f = 2.0F;
poseStack.scale(1.5F / f, 1.5F / f, 1.5F / f);
poseStack.translate(0.0F, 16.0F * 1, 0.0F);
chocobo_head.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_head.render(poseStack, buffer, packedLight, packedOverlay, color);
poseStack.popPose();
poseStack.pushPose();
poseStack.scale(1.0F / f, 1.0F / f, 1.0F / f);
poseStack.translate(0.0F, 24.0F * 1, 0.0F);
chocobo_body.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_body.render(poseStack, buffer, packedLight, packedOverlay, color);
} else {
chocobo_head.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_body.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_right_arm.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_left_arm.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_head.render(poseStack, buffer, packedLight, packedOverlay, color);
chocobo_body.render(poseStack, buffer, packedLight, packedOverlay, color);
chocobo_right_arm.render(poseStack, buffer, packedLight, packedOverlay, color);
chocobo_left_arm.render(poseStack, buffer, packedLight, packedOverlay, color);
}
chocobo_leg_right.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_leg_left.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_claw_right.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_claw_left.render(poseStack, buffer, packedLight, packedOverlay, red, green, blue, alpha);
chocobo_leg_right.render(poseStack, buffer, packedLight, packedOverlay, color);
chocobo_leg_left.render(poseStack, buffer, packedLight, packedOverlay, color);
chocobo_claw_right.render(poseStack, buffer, packedLight, packedOverlay, color);
chocobo_claw_left.render(poseStack, buffer, packedLight, packedOverlay, color);
poseStack.popPose();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ public static LayerDefinition createBodyLayer() {
}

@Override
public void renderToBuffer(PoseStack poseStack, VertexConsumer consumer, int packedLightIn, int packedOverlayIn, float red, float green, float blue, float alpha) {
this.root.render(poseStack, consumer, packedLightIn, packedOverlayIn, red, green, blue, alpha);
public void renderToBuffer(PoseStack poseStack, VertexConsumer consumer, int packedLightIn, int packedOverlayIn, int color) {
this.root.render(poseStack, consumer, packedLightIn, packedOverlayIn, color);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void setupAnim(AbstractChocobo entity, float limbSwing, float limbSwingAm
}

@Override
public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
root.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha);
public void renderToBuffer(PoseStack poseStack, VertexConsumer consumer, int packedLightIn, int packedOverlayIn, int color) {
root.render(poseStack, consumer, packedLightIn, packedOverlayIn, color);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@

public class ChocoboRenderer extends MobRenderer<AbstractChocobo, EntityModel<AbstractChocobo>> {
private static final Map<ChocoboColor, ResourceLocation> CHOCOBO_PER_COLOR = Util.make(Maps.newHashMap(), (map) -> {
map.put(ChocoboColor.YELLOW, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/yellowchocobo.png"));
map.put(ChocoboColor.GREEN, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/greenchocobo.png"));
map.put(ChocoboColor.BLUE, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/bluechocobo.png"));
map.put(ChocoboColor.WHITE, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/whitechocobo.png"));
map.put(ChocoboColor.BLACK, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/blackchocobo.png"));
map.put(ChocoboColor.GOLD, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/goldchocobo.png"));
map.put(ChocoboColor.PINK, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/pinkchocobo.png"));
map.put(ChocoboColor.RED, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/redchocobo.png"));
map.put(ChocoboColor.PURPLE, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/purplechocobo.png"));
map.put(ChocoboColor.FLAME, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/flamechocobo.png"));
map.put(ChocoboColor.YELLOW, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/yellowchocobo.png"));
map.put(ChocoboColor.GREEN, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/greenchocobo.png"));
map.put(ChocoboColor.BLUE, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/bluechocobo.png"));
map.put(ChocoboColor.WHITE, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/whitechocobo.png"));
map.put(ChocoboColor.BLACK, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/blackchocobo.png"));
map.put(ChocoboColor.GOLD, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/goldchocobo.png"));
map.put(ChocoboColor.PINK, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/pinkchocobo.png"));
map.put(ChocoboColor.RED, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/redchocobo.png"));
map.put(ChocoboColor.PURPLE, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/purplechocobo.png"));
map.put(ChocoboColor.FLAME, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/flamechocobo.png"));
});
private static final Map<ChocoboColor, ResourceLocation> CHICOBO_PER_COLOR = Util.make(Maps.newHashMap(), (map) -> {
map.put(ChocoboColor.YELLOW, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/yellowchocobo.png"));
map.put(ChocoboColor.GREEN, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/greenchocobo.png"));
map.put(ChocoboColor.BLUE, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/bluechocobo.png"));
map.put(ChocoboColor.WHITE, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/whitechocobo.png"));
map.put(ChocoboColor.BLACK, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/blackchocobo.png"));
map.put(ChocoboColor.GOLD, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/goldchocobo.png"));
map.put(ChocoboColor.PINK, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/pinkchocobo.png"));
map.put(ChocoboColor.RED, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/redchocobo.png"));
map.put(ChocoboColor.PURPLE, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/purplechocobo.png"));
map.put(ChocoboColor.FLAME, new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/flamechocobo.png"));
map.put(ChocoboColor.YELLOW, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/yellowchocobo.png"));
map.put(ChocoboColor.GREEN, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/greenchocobo.png"));
map.put(ChocoboColor.BLUE, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/bluechocobo.png"));
map.put(ChocoboColor.WHITE, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/whitechocobo.png"));
map.put(ChocoboColor.BLACK, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/blackchocobo.png"));
map.put(ChocoboColor.GOLD, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/goldchocobo.png"));
map.put(ChocoboColor.PINK, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/pinkchocobo.png"));
map.put(ChocoboColor.RED, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/redchocobo.png"));
map.put(ChocoboColor.PURPLE, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/purplechocobo.png"));
map.put(ChocoboColor.FLAME, ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/flamechocobo.png"));
});

private final EntityModel<AbstractChocobo> chicoboModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import net.minecraft.resources.ResourceLocation;

public class LayerCollar extends RenderLayer<AbstractChocobo, EntityModel<AbstractChocobo>> {
private final ResourceLocation COLLAR_CHOCOBO = new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/collar.png");
private final ResourceLocation COLLAR_CHICOBO = new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chicobos/collar.png");
private final ResourceLocation COLLAR_CHOCOBO = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/collar.png");
private final ResourceLocation COLLAR_CHICOBO = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chicobos/collar.png");

public LayerCollar(RenderLayerParent<AbstractChocobo, EntityModel<AbstractChocobo>> rendererIn) {
super(rendererIn);
Expand All @@ -20,7 +20,7 @@ public LayerCollar(RenderLayerParent<AbstractChocobo, EntityModel<AbstractChocob
@Override
public void render(PoseStack poseStack, MultiBufferSource bufferSource, int packedLightIn, AbstractChocobo chocoboEntity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if (chocoboEntity.isTame() && !chocoboEntity.isInvisible()) {
renderColoredCutoutModel(this.getParentModel(), chocoboEntity.isBaby() ? COLLAR_CHICOBO : COLLAR_CHOCOBO, poseStack, bufferSource, packedLightIn, chocoboEntity, 1.0F, 1.0F, 1.0F);
renderColoredCutoutModel(this.getParentModel(), chocoboEntity.isBaby() ? COLLAR_CHICOBO : COLLAR_CHOCOBO, poseStack, bufferSource, packedLightIn, chocoboEntity, -1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class LayerPlumage extends RenderLayer<AbstractChocobo, EntityModel<AbstractChocobo>> {

private final ResourceLocation PLUMAGE = new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/plumage.png");
private final ResourceLocation PLUMAGE = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/plumage.png");

public LayerPlumage(RenderLayerParent<AbstractChocobo, EntityModel<AbstractChocobo>> rendererIn) {
super(rendererIn);
Expand All @@ -20,7 +20,7 @@ public LayerPlumage(RenderLayerParent<AbstractChocobo, EntityModel<AbstractChoco
@Override
public void render(PoseStack poseStack, MultiBufferSource bufferSource, int packedLightIn, AbstractChocobo chocoboEntity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if (!chocoboEntity.isInvisible() && chocoboEntity.isMale() && !chocoboEntity.isBaby()) {
renderColoredCutoutModel(this.getParentModel(), PLUMAGE, poseStack, bufferSource, packedLightIn, chocoboEntity, 1.0F, 1.0F, 1.0F);
renderColoredCutoutModel(this.getParentModel(), PLUMAGE, poseStack, bufferSource, packedLightIn, chocoboEntity, -1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
import net.minecraft.world.item.ItemStack;

public class LayerSaddle extends RenderLayer<AbstractChocobo, EntityModel<AbstractChocobo>> {
private final ResourceLocation SADDLE = new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/saddle.png");
private final ResourceLocation SADDLE_BAG = new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/saddle_bag.png");
private final ResourceLocation PACK_BAG = new ResourceLocation(Chococraft.MOD_ID, "textures/entities/chocobos/pack_bag.png");
private final ResourceLocation SADDLE = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/saddle.png");
private final ResourceLocation SADDLE_BAG = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/saddle_bag.png");
private final ResourceLocation PACK_BAG = ResourceLocation.fromNamespaceAndPath(Chococraft.MOD_ID, "textures/entities/chocobos/pack_bag.png");

public LayerSaddle(RenderLayerParent<AbstractChocobo, EntityModel<AbstractChocobo>> rendererIn) {
super(rendererIn);
Expand All @@ -38,7 +38,7 @@ public void render(PoseStack poseStack, MultiBufferSource bufferSource, int pack
}
}

renderColoredCutoutModel(this.getParentModel(), saddleTexture, poseStack, bufferSource, packedLightIn, chocoboEntity, 1.0F, 1.0F, 1.0F);
renderColoredCutoutModel(this.getParentModel(), saddleTexture, poseStack, bufferSource, packedLightIn, chocoboEntity, -1);
}
}
}
Loading

0 comments on commit 8a27312

Please sign in to comment.