-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass at an update to 1.21.2. (#95)
* First pass at an update to 1.21.2. - Make it build against 1.21.2 - Fix broken things - Replace basically all of the boat API * I forgot about PillarLogHelper... - PillarLogHelper.of methods removed - PillarLogHelper.settings methods added They provide AbstractBlock.Settings instead of PillarLog - Improvements to the testmod * Darn it IDEA, why do you keep removing this change from my commits? * Adjust name of new pillar log helpers. I was trying to keep them short, but I didn't really like the names either, so I'm fine with this. Co-authored-by: haykam821 <[email protected]> * Update ancillary gradle cruft to match version 8.8. * Update to 1.21.2-rc1. Fix wood test. * Fix the raft entity renderers. * Add DFU support so old boats can become new boats. This is the nice clean way I wanted to do but can't because somebody decided the DFU should init before mods do... * Version which enables mods to register boat IDs early. - Provide a hook for mods to give us their boat IDs (so datafixer retains the boat type instead of using oak) This is the icky version I hate to have to make, but the DFU initializes way too early to do this in any nice way... --------- Co-authored-by: haykam821 <[email protected]>
- Loading branch information
1 parent
a7ac9de
commit 74c77f1
Showing
57 changed files
with
901 additions
and
1,134 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
org.gradle.jvmargs=-Xmx2G | ||
org.gradle.parallel=true | ||
fabric.loom.multiProjectOptimisation=true | ||
|
||
maven_group=com.terraformersmc.terraform-api | ||
version=11.0.0-alpha.1 | ||
version=12.0.0-alpha.1 | ||
|
||
minecraft_version=1.21 | ||
yarn_mappings=1.21+build.7 | ||
loader_version=0.15.11 | ||
fabric_version=0.100.4+1.21 | ||
minecraft_version=1.21.2 | ||
yarn_mappings=1.21.2+build.1 | ||
loader_version=0.16.7 | ||
fabric_version=0.106.1+1.21.2 |
Binary file not shown.
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
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
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
86 changes: 0 additions & 86 deletions
86
...rm-wood-api-v1/src/main/java/com/terraformersmc/terraform/boat/api/TerraformBoatType.java
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
...api-v1/src/main/java/com/terraformersmc/terraform/boat/api/TerraformBoatTypeRegistry.java
This file was deleted.
Oops, something went wrong.
78 changes: 15 additions & 63 deletions
78
...src/main/java/com/terraformersmc/terraform/boat/api/client/TerraformBoatClientHelper.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 |
---|---|---|
@@ -1,83 +1,35 @@ | ||
package com.terraformersmc.terraform.boat.api.client; | ||
|
||
import com.terraformersmc.terraform.boat.impl.client.TerraformBoatClientHelperImpl; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry; | ||
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry.TexturedModelDataProvider; | ||
import net.minecraft.client.render.entity.model.BoatEntityModel; | ||
import net.minecraft.client.render.entity.model.ChestBoatEntityModel; | ||
import net.minecraft.client.render.entity.model.ChestRaftEntityModel; | ||
import net.minecraft.client.render.entity.BoatEntityRenderer; | ||
import net.minecraft.client.render.entity.model.EntityModelLayer; | ||
import net.minecraft.client.render.entity.model.RaftEntityModel; | ||
import net.minecraft.util.Identifier; | ||
|
||
@Environment(EnvType.CLIENT) | ||
/** | ||
* This class provides useful helpers for registering a {@linkplain com.terraformersmc.terraform.boat.api.TerraformBoatType Terraform boat} on the client. | ||
* This class provides useful helpers for registering a {@linkplain net.minecraft.entity.vehicle.BoatEntity boat} on the client. | ||
*/ | ||
@Environment(EnvType.CLIENT) | ||
@SuppressWarnings("unused") | ||
public final class TerraformBoatClientHelper { | ||
private TerraformBoatClientHelper() { | ||
return; | ||
} | ||
|
||
/** | ||
* Gets the identifier of a {@linkplain EntityModelLayer model layer} for a boat of a given type. | ||
* @param boatId the {@linkplain net.minecraft.util.Identifier identifier} of the {@linkplain com.terraformersmc.terraform.boat.api.TerraformBoatType boat} | ||
* @param raft whether the boat is a raft | ||
* @param chest whether the boat contains a chest | ||
*/ | ||
private static Identifier getLayerId(Identifier boatId, boolean raft, boolean chest) { | ||
String prefix = raft ? (chest ? "chest_raft/" : "raft/") : (chest ? "chest_boat/" : "boat/"); | ||
return boatId.withPrefixedPath(prefix); | ||
} | ||
|
||
/** | ||
* Creates a {@linkplain EntityModelLayer model layer} for a boat of a given type. | ||
* @param boatId the {@linkplain net.minecraft.util.Identifier identifier} of the {@linkplain com.terraformersmc.terraform.boat.api.TerraformBoatType boat} | ||
* @param raft whether the boat is a raft | ||
* @param chest whether the boat contains a chest | ||
* | ||
* <pre>{@code | ||
* EntityModelLayer layer = TerraformBoatClientHelper.getLayer(Identifier.of("examplemod", "mahogany"), false, false); | ||
* }</pre> | ||
*/ | ||
public static EntityModelLayer getLayer(Identifier boatId, boolean raft, boolean chest) { | ||
return new EntityModelLayer(getLayerId(boatId, raft, chest), "main"); | ||
} | ||
|
||
private static TexturedModelDataProvider getTexturedModelDataProvider(boolean raft, boolean chest) { | ||
if (raft) { | ||
return chest ? ChestRaftEntityModel::getTexturedModelData : RaftEntityModel::getTexturedModelData; | ||
} else { | ||
return chest ? ChestBoatEntityModel::getTexturedModelData : BoatEntityModel::getTexturedModelData; | ||
} | ||
} | ||
|
||
/** | ||
* Registers a {@linkplain EntityModelLayer model layer} for a boat of a given type. | ||
* @param boatId the {@linkplain net.minecraft.util.Identifier identifier} of the {@linkplain com.terraformersmc.terraform.boat.api.TerraformBoatType boat} | ||
* @param raft whether the boat is a raft | ||
* @param chest whether the boat contains a chest | ||
* | ||
* <pre>{@code | ||
* TerraformBoatClientHelper.registerModelLayer(Identifier.of("examplemod", "mahogany"), false, false); | ||
* }</pre> | ||
*/ | ||
private static void registerModelLayer(Identifier boatId, boolean raft, boolean chest) { | ||
EntityModelLayerRegistry.registerModelLayer(getLayer(boatId, raft, chest), getTexturedModelDataProvider(raft, chest)); | ||
} | ||
|
||
/** | ||
* Registers {@linkplain EntityModelLayer model layers} for a given boat type. | ||
* @param boatId the {@linkplain net.minecraft.util.Identifier identifier} of the {@linkplain com.terraformersmc.terraform.boat.api.TerraformBoatType boat type} | ||
* @param raft whether the boat is a raft | ||
* | ||
* Registers {@linkplain EntityModelLayer model layers} and | ||
* {@linkplain BoatEntityRenderer entity renderers} for all boats of given boat type. | ||
* The provided identifier must match the identifier used to | ||
* {@linkplain com.terraformersmc.terraform.boat.api.item.TerraformBoatItemHelper#registerBoatItem register the boat type}. | ||
* | ||
* <pre>{@code | ||
* TerraformBoatClientHelper.registerModelLayers(Identifier.of("examplemod", "mahogany"), false); | ||
* TerraformBoatClientHelper.registerModelLayers(Identifier.of("examplemod", "mahogany")); | ||
* }</pre> | ||
* | ||
* @param id the {@linkplain net.minecraft.util.Identifier identifier} of the boat type. | ||
*/ | ||
public static void registerModelLayers(Identifier boatId, boolean raft) { | ||
registerModelLayer(boatId, raft, false); | ||
registerModelLayer(boatId, raft, true); | ||
public static void registerModelLayers(Identifier id) { | ||
TerraformBoatClientHelperImpl.registerModelLayers(id); | ||
} | ||
} |
Oops, something went wrong.