-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag '1.4.0+1.20.1' into 1.20.2
- Loading branch information
Showing
110 changed files
with
394 additions
and
314 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,8 @@ | |
|
||
name: build | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
- workflow_call | ||
- workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
|
@@ -20,8 +19,6 @@ jobs: | |
# and run on both Linux and Windows | ||
os: [ubuntu-22.04, windows-2022] | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: write # Required to create releases | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v3 | ||
|
@@ -43,11 +40,3 @@ jobs: | |
with: | ||
name: Artifacts | ||
path: build/libs/ | ||
- name: create release | ||
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} | ||
uses: marvinpinto/[email protected] | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
draft: true | ||
prerelease: false | ||
files: "build/libs/*.jar" |
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,26 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
release: | ||
needs: [ build ] | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Artifacts | ||
path: ./ | ||
- name: Draft release | ||
uses: ncipollo/[email protected] | ||
with: | ||
artifacts: ./*.jar | ||
artifactErrorsFailBuild: true | ||
draft: true |
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
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,6 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minecraft Code Breaking Changes | ||
### 1.19.4 | ||
Current master | ||
|
||
### 1.20.0 | ||
- Crafting recipes and CrafitnScreenHandler receive a `RecipeInputInventory` instead of a `CraftingInventory`. | ||
- Data pack format changed to 15. (Format range not supported in this version.) (Not really a breaking change.) | ||
|
||
### 1.20.2 | ||
- Recipe constructors no longer take an ID | ||
- Recipe `Serializer` must be backed up by a `Codec` | ||
- Loot functions require a `Codec` instead of a `Serializer` | ||
- Loot functions take conditions as a `List` instead of as an arrays. | ||
- Trades should also be registered for the Trade Rebalance feature. | ||
- CraftingScreenHandler receives recipes wrapped inside a `RecipeEntry` | ||
|
||
### 1.20.3 | ||
- ~~Text serialization method moved elsewhere~~ (Yarn mapping change) | ||
- Crafting category deserialization method was removed (Avoidable by using other methods) | ||
- The field `CraftingRecipeCategory::CODEC` had its signature changed (Avoidable by getting it from elsewhere) |
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
69 changes: 69 additions & 0 deletions
69
src/client/java/tk/estecka/invarpaint/UnbakedPaintingItem.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,69 @@ | ||
package tk.estecka.invarpaint; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
import java.util.function.Function; | ||
import org.jetbrains.annotations.Nullable; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.render.model.BakedModel; | ||
import net.minecraft.client.render.model.Baker; | ||
import net.minecraft.client.render.model.ModelBakeSettings; | ||
import net.minecraft.client.render.model.UnbakedModel; | ||
import net.minecraft.client.render.model.json.JsonUnbakedModel; | ||
import net.minecraft.client.texture.Sprite; | ||
import net.minecraft.client.util.SpriteIdentifier; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class UnbakedPaintingItem | ||
implements UnbakedModel | ||
{ | ||
static private final String ARBITRARY_MODEL = """ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "%s" | ||
} | ||
} | ||
"""; | ||
|
||
private final Identifier texture; | ||
private final @Nullable Identifier fallback; | ||
public final JsonUnbakedModel inner; | ||
|
||
static public JsonUnbakedModel CreateJson(Identifier id){ | ||
return JsonUnbakedModel.deserialize(ARBITRARY_MODEL.formatted(id.toString())); | ||
} | ||
|
||
public UnbakedPaintingItem(Identifier textureId, @Nullable Identifier fallbackId){ | ||
this.texture = textureId.withPrefixedPath("textures/").withSuffixedPath(".png"); | ||
this.fallback = fallbackId; | ||
this.inner = CreateJson(textureId); | ||
} | ||
|
||
@Override | ||
public Collection<Identifier> getModelDependencies(){ | ||
var deps = List.copyOf(inner.getModelDependencies()); | ||
deps.add(fallback); | ||
return deps; | ||
} | ||
|
||
@Override | ||
public void setParents(Function<Identifier, UnbakedModel> modelLoader){ | ||
inner.setParents(modelLoader); | ||
} | ||
|
||
/** | ||
* Will only be called when the texture is missing, thanks to the janky | ||
* implementation of `ModelLoader$BakerImpl`. | ||
*/ | ||
@Override | ||
public @Nullable BakedModel bake(Baker baker, Function<SpriteIdentifier, Sprite> spriteGetter, ModelBakeSettings settings, Identifier id){ | ||
return baker.bake(fallback, settings); | ||
} | ||
|
||
public boolean ShouldFallback(){ | ||
return this.fallback != null | ||
&& MinecraftClient.getInstance().getResourceManager().getResource(texture).isEmpty() | ||
; | ||
} | ||
} |
Oops, something went wrong.