Skip to content

Commit

Permalink
Fixed patreon rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
Buuz135 committed Jan 22, 2022
1 parent 75a50f3 commit be0e790
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 9 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish action

on:
create:
tag:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk 17
uses: actions/setup-java@v1
with:
java-version: "17"
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: Publish Minecraft Mods Forge
uses: Kir-Antipov/[email protected]
with:
curseforge-id: 452500
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
files-primary: build/libs/!(*-@(dev|sources)).jar
files-secondary: build/libs/*-@(dev|sources).jar
version-type: beta
loaders: forge
game-versions: 1.18.1
java: 17
name: ""
changelog: "https://github.com/Buuz135/SushiGoCrafting/commits/1.18"
dependencies: |
titanium | depends
patchouli | depends
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx8G
org.gradle.jvmargs=-Xmx2G
modGroup=com.buuz135
modVersion=0.3.1
modVersion=0.3.2
modBaseName=sushigocrafting
minecraftVersion=1.18.1
16 changes: 10 additions & 6 deletions src/main/java/com/buuz135/sushigocrafting/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.buuz135.sushigocrafting.proxy.SushiContent;
import com.hrznstudio.titanium.event.handler.EventManager;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
Expand All @@ -25,6 +24,8 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.client.event.EntityRenderersEvent;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ForgeModelBakery;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

Expand All @@ -40,7 +41,6 @@ public static void register() {
event.registerBlockEntityRenderer(SushiContent.TileEntities.CUTTING_BOARD.get(), p_173571_ -> new CuttingBoardRenderer());
}).subscribe();
EventManager.mod(EntityRenderersEvent.AddLayers.class).process(event -> {
Minecraft instance = Minecraft.getInstance();
for (String skin : event.getSkins()) {
PlayerRenderer renderer = event.getSkin(skin);
renderer.addLayer(new ContributorsBackRender(renderer));
Expand All @@ -49,6 +49,14 @@ public static void register() {
EventManager.mod(EntityRenderersEvent.RegisterLayerDefinitions.class).process(event -> {
event.registerLayerDefinition(new ModelLayerLocation(new ResourceLocation(SushiGoCrafting.MOD_ID, "shrimp"), "main"), ShrimpModel::createBodyLayer);
}).subscribe();
EventManager.mod(ModelRegistryEvent.class).process(event -> {
ForgeModelBakery.addSpecialModel(new ResourceLocation(SushiGoCrafting.MOD_ID, "block/salmon_back"));
ForgeModelBakery.addSpecialModel(new ResourceLocation(SushiGoCrafting.MOD_ID, "block/tuna_back"));
}).subscribe();
EventManager.mod(ModelBakeEvent.class).process(event -> {
SALMON_BACK = event.getModelRegistry().get(new ResourceLocation(SushiGoCrafting.MOD_ID, "block/salmon_back"));
TUNA_BACK = event.getModelRegistry().get(new ResourceLocation(SushiGoCrafting.MOD_ID, "block/tuna_back"));
}).subscribe();
}

public void fmlClient(FMLClientSetupEvent fml) {
Expand All @@ -62,10 +70,6 @@ public void fmlClient(FMLClientSetupEvent fml) {
ItemBlockRenderTypes.setRenderLayer(SushiContent.Blocks.SEAWEED.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(SushiContent.Blocks.SEAWEED_PLANT.get(), RenderType.cutout());
ItemBlockRenderTypes.setRenderLayer(SushiContent.Blocks.SESAME_CROP.get(), RenderType.cutout());
EventManager.mod(ModelBakeEvent.class).process(event -> {
SALMON_BACK = event.getModelRegistry().get(new ResourceLocation(SushiGoCrafting.MOD_ID, "block/salmon_back"));
TUNA_BACK = event.getModelRegistry().get(new ResourceLocation(SushiGoCrafting.MOD_ID, "block/tuna_back"));
}).subscribe();
EventManager.forge(ItemTooltipEvent.class).process(event -> {
IFoodIngredient ingredient = FoodAPI.get().getIngredientFromItem(event.getItemStack().getItem());
if (!ingredient.isEmpty() && ingredient.getEffect() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public ContributorsBackRender(RenderLayerParent<AbstractClientPlayer, PlayerMode
public void render(PoseStack stack, MultiBufferSource buffer, int p_225628_3_, AbstractClientPlayer entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if (!ClientRewardStorage.REWARD_STORAGE.getRewards().containsKey(entitylivingbaseIn.getUUID())) return;
if (!ClientRewardStorage.REWARD_STORAGE.getRewards().get(entitylivingbaseIn.getUUID()).getEnabled().containsKey(new ResourceLocation(SushiGoCrafting.MOD_ID, "back")))
return;
return;
stack.pushPose();
if (entitylivingbaseIn.isCrouching()) {
stack.translate(0D, 0.2D, 0D);
Expand All @@ -62,6 +62,7 @@ public void render(PoseStack stack, MultiBufferSource buffer, int p_225628_3_, A
stack.translate(-0.53, -0.55, -0.37);
RenderSystem.setShaderTexture(0, TextureAtlas.LOCATION_BLOCKS);
BakedModel selected = null;

switch (ClientRewardStorage.REWARD_STORAGE.getRewards().get(entitylivingbaseIn.getUUID()).getEnabled().getOrDefault(new ResourceLocation(SushiGoCrafting.MOD_ID, "back"), "salmon")) {
case "tuna":
selected = ClientProxy.TUNA_BACK;
Expand Down

0 comments on commit be0e790

Please sign in to comment.