Skip to content

Commit

Permalink
fix not visible knight metal shields
Browse files Browse the repository at this point in the history
  • Loading branch information
marlester-dev committed Sep 28, 2024
1 parent 9dd7531 commit 3a8a187
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 83 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// 1.20.1 2023-08-25T23:29:00.7355173 atlases generator for twilightforest
aebef09d33f3500705949d8b6494d661eb6c306d assets/minecraft/atlases/chests.json
9d3cddb8e4eac9773c9dedc0f22b4f1593f5a070 assets/minecraft/atlases/magic_paintings.json
91ec0b65040a29530fb79145fa81b3636a3885b1 assets/minecraft/atlases/shield_patterns.json
9d3cddb8e4eac9773c9dedc0f22b4f1593f5a070 assets/minecraft/atlases/magic_paintings.json

This file was deleted.

23 changes: 0 additions & 23 deletions src/main/java/twilightforest/client/ISTER.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import com.mojang.authlib.GameProfile;
import com.mojang.blaze3d.platform.Lighting;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import io.github.fabricators_of_create.porting_lib.util.RegistryObject;
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry;
Expand All @@ -14,14 +13,10 @@
import net.minecraft.client.model.SkullModelBase;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.Sheets;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.Material;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -44,15 +39,11 @@
import twilightforest.block.TFChestBlock;
import twilightforest.block.entity.KeepsakeCasketBlockEntity;
import twilightforest.block.entity.TwilightChestEntity;
import twilightforest.client.model.TFModelLayers;
import twilightforest.client.model.entity.KnightmetalShieldModel;
import twilightforest.client.model.tileentity.GenericTrophyModel;
import twilightforest.client.renderer.tileentity.SkullCandleTileEntityRenderer;
import twilightforest.client.renderer.tileentity.TrophyTileEntityRenderer;
import twilightforest.enums.BossVariant;
import twilightforest.init.TFBlocks;
import twilightforest.item.GiantItem;
import twilightforest.item.KnightmetalShieldItem;
import twilightforest.item.WearableItem;

import java.util.HashMap;
Expand All @@ -76,8 +67,6 @@ public class ISTER implements BuiltinItemRendererRegistry.DynamicItemRenderer, R
makeInstance(map, TFBlocks.SORTING_CHEST);
});
@Nullable
private KnightmetalShieldModel shield;
@Nullable
private Map<BossVariant, GenericTrophyModel> trophies;

// Use the cached INSTANCE.get instead
Expand All @@ -86,7 +75,6 @@ private ISTER() {

@Override
public void onResourceManagerReload(ResourceManager manager) {
this.shield = new KnightmetalShieldModel(Minecraft.getInstance().getEntityModels().bakeLayer(TFModelLayers.KNIGHTMETAL_SHIELD));
this.trophies = TrophyTileEntityRenderer.createTrophyRenderers(Minecraft.getInstance().getEntityModels());

TwilightForestMod.LOGGER.debug("Reloaded ISTER!");
Expand Down Expand Up @@ -177,17 +165,6 @@ public void render(ItemStack stack, ItemDisplayContext camera, PoseStack ms, Mul
ms.popPose();
}
}
} else {
if (item instanceof KnightmetalShieldItem) {
ms.pushPose();
ms.scale(1.0F, -1.0F, -1.0F);
Material material = new Material(Sheets.SHIELD_SHEET, new ResourceLocation(TwilightForestMod.ID, "model/knightmetal_shield"));
if (this.shield != null) {
VertexConsumer vertexconsumer = material.sprite().wrap(ItemRenderer.getFoilBufferDirect(buffers, this.shield.renderType(material.atlasLocation()), true, stack.hasFoil()));
this.shield.renderToBuffer(ms, vertexconsumer, light, overlay, 1.0F, 1.0F, 1.0F, 1.0F);
}
ms.popPose();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,5 @@ public static void registerLayers() {
EntityModelLayerRegistry.registerModelLayer(TFModelLayers.MOONWORM, MoonwormModel::create);

EntityModelLayerRegistry.registerModelLayer(TFModelLayers.RED_THREAD, RedThreadModel::create);

EntityModelLayerRegistry.registerModelLayer(TFModelLayers.KNIGHTMETAL_SHIELD, KnightmetalShieldModel::create);
}
}
2 changes: 0 additions & 2 deletions src/main/java/twilightforest/client/model/TFModelLayers.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ public class TFModelLayers {

public static final ModelLayerLocation RED_THREAD = register("red_thread");

public static final ModelLayerLocation KNIGHTMETAL_SHIELD = register("knightmetal_shield");

public static final ModelLayerLocation CHARM_OF_LIFE = register("charm_of_life");

private static ModelLayerLocation register(String p_171294_) {
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/twilightforest/data/AtlasGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public AtlasGenerator(FabricDataOutput output) {
protected void addSources() {
TwilightChestRenderer.MATERIALS.values().stream().flatMap(e -> e.values().stream()).map(Material::texture)
.forEach(resourceLocation -> this.atlas(CHESTS_ATLAS).addSource(new SingleFile(resourceLocation, Optional.empty())));
this.atlas(SHIELD_PATTERNS_ATLAS).addSource(new SingleFile(TwilightForestMod.prefix("model/knightmetal_shield"), Optional.empty()));

this.atlas(MagicPaintingTextureManager.ATLAS_INFO_LOCATION).addSource(new SingleFile(MagicPaintingTextureManager.BACK_SPRITE_LOCATION, Optional.empty()));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"parent": "builtin/entity",
"gui_light": "front",
"textures": {
"particle": "twilightforest:block/towerwood"
},
"display": {
"thirdperson_righthand": {
"rotation": [ 0, 90, 0 ],
Expand All @@ -27,7 +22,7 @@
},
"gui": {
"rotation": [ 15, -25, -5 ],
"translation": [ 3, 2, 0 ],
"translation": [ 2, 3, 0 ],
"scale": [ 0.65, 0.65, 0.65 ]
},
"fixed": {
Expand All @@ -41,6 +36,32 @@
"scale":[ 0.25, 0.25, 0.25]
}
},
"textures": {
"k_shield": "twilightforest:item/knightmetal_shield",
"v_shield": "minecraft:entity/shield_base"
},
"elements": [{
"from": [ -6, -10, -0.5 ],
"to" : [ 6, 10, 1.5 ],
"faces": {
"down": { "uv": [ 7, 0, 13, 1 ], "texture": "#k_shield" },
"up": { "uv": [ 1, 0, 7, 1 ], "texture": "#k_shield" },
"north": { "uv": [ 8, 1, 14, 11 ], "texture": "#k_shield" },
"south": { "uv": [ 1, 1, 7, 11 ], "texture": "#k_shield" },
"west": { "uv": [ 7, 1, 8, 11 ], "texture": "#k_shield" },
"east": { "uv": [ 0, 1, 1, 11 ], "texture": "#k_shield" }
}
}, {
"from": [ -1, -3, -5.5 ],
"to" : [ 1, 3, -0.5 ],
"faces": {
"down": { "uv": [ 8.5, 0 , 9 , 1.5 ], "texture": "#v_shield" },
"up": { "uv": [ 8 , 0 , 8.5, 1.5 ], "texture": "#v_shield" },
"north": { "uv": [ 8 , 1.5, 8.5, 3 ], "texture": "#v_shield" },
"west": { "uv": [ 8.5, 1.5, 10 , 3 ], "texture": "#v_shield" },
"east": { "uv": [ 6.5, 1.5, 8 , 3 ], "texture": "#v_shield" }
}
}],
"overrides": [{
"predicate": { "blocking": 1 },
"model": "twilightforest:item/knightmetal_shield_blocking"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"parent": "builtin/entity",
"gui_light": "front",
"textures": {
"particle": "twilightforest:block/towerwood"
},
"parent": "twilightforest:item/knightmetal_shield",
"display": {
"thirdperson_righthand": {
"rotation": [ 45, 135, 0 ],
Expand All @@ -27,7 +23,7 @@
},
"gui": {
"rotation": [ 15, -25, -5 ],
"translation": [ 3, 2, 0 ],
"translation": [ 2, 3, 0 ],
"scale": [ 0.65, 0.65, 0.65 ]
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 3a8a187

Please sign in to comment.