diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88df3cc..3bc8372 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,10 +49,9 @@ jobs: - todo: document changes draft: true - prerelease: ${{ steps.version_type.outputs.result != 'release' }} - name: Publish id: publish - if: ${{ steps.version_type.outputs.result != 'alpha' && success() }} + if: ${{ success() }} uses: gradle/gradle-build-action@v2 with: arguments: curseforge diff --git a/src/main/java/com/eerussianguy/betterfoliage/Helpers.java b/src/main/java/com/eerussianguy/betterfoliage/Helpers.java index 85ab05d..a8f085b 100644 --- a/src/main/java/com/eerussianguy/betterfoliage/Helpers.java +++ b/src/main/java/com/eerussianguy/betterfoliage/Helpers.java @@ -5,7 +5,6 @@ import java.util.List; import java.util.Map; import java.util.function.Function; -import java.util.stream.Collectors; import com.google.gson.JsonObject; import net.minecraft.client.Minecraft; @@ -16,6 +15,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.model.BlockModelRotation; import net.minecraft.client.resources.model.Material; +import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.client.resources.model.SimpleBakedModel; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -25,12 +25,14 @@ import net.minecraft.world.level.block.state.BlockState; import com.eerussianguy.betterfoliage.particle.SpritePicker; +import com.mojang.blaze3d.vertex.PoseStack; import static com.eerussianguy.betterfoliage.BetterFoliage.MOD_ID; public class Helpers { public static final Direction[] DIRECTIONS = Direction.values(); + public static final ModelResourceLocation BACKING_DIRT_MODEL = new ModelResourceLocation("minecraft", "dirt", "inventory"); public static ResourceLocation identifier(String name) { @@ -75,7 +77,7 @@ public static ResourceLocation identifierOrEmpty(JsonObject json, String member) public static Collection makeMaterials(ResourceLocation... textures) { //noinspection deprecation - return Arrays.stream(textures).map(texture -> new Material(TextureAtlas.LOCATION_BLOCKS, texture)).collect(Collectors.toList()); + return Arrays.stream(textures).map(texture -> new Material(TextureAtlas.LOCATION_BLOCKS, texture)).toList(); } public static BakedQuad makeBakedQuad(BlockElement BlockElement, BlockElementFace partFace, TextureAtlasSprite atlasSprite, Direction dir, BlockModelRotation modelRotation, ResourceLocation modelResLoc) @@ -156,4 +158,9 @@ static void addTintedParticle(TextureSheetParticle particle, List mapFacesIn = Maps.newEnumMap(Direction.class); for (Direction d : Helpers.DIRECTIONS) { - mapFacesIn.put(d, tint ? Helpers.makeTintedFace(Helpers.UV_DEFAULT) : Helpers.makeFace(Helpers.UV_DEFAULT)); + mapFacesIn.put(d, tint ? Helpers.makeTintedFace(Helpers.UV_DEFAULT, true) : Helpers.makeFace(Helpers.UV_DEFAULT, true)); } BlockElement part = new BlockElement(new Vector3f(0f, 0f, 0f), new Vector3f(16f, 16f, 16f), mapFacesIn, null, true); SimpleBakedModel.Builder builder = new SimpleBakedModel.Builder(blockModel, ItemOverrides.EMPTY, false).particle(tex); @@ -178,4 +179,10 @@ public TextureAtlasSprite getParticleIcon() return Objects.requireNonNull(leavesTex); } + @Override + public BakedModel applyTransform(ItemTransforms.TransformType transformType, PoseStack poseStack, boolean applyLeftHandTransform) + { + Helpers.applyTransform(transformType, poseStack, applyLeftHandTransform); + return this; + } }