Skip to content

Commit

Permalink
Fix chest rendering
Browse files Browse the repository at this point in the history
Signed-off-by: Noaaan <[email protected]>
  • Loading branch information
Noaaan committed Nov 6, 2023
1 parent d704b38 commit 3289ed9
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Environment(EnvType.CLIENT)
public class CompactingChestBlockEntityRenderer implements BlockEntityRenderer<CompactingChestBlockEntity> {

private static final SpriteIdentifier SPRITE_IDENTIFIER = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, SpectrumCommon.locate("entity/compacting_chest"));
private static final SpriteIdentifier SPRITE_IDENTIFIER = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, SpectrumCommon.locate("block/compacting_chest"));
private final ModelPart root;
private final ModelPart lid;
private final ModelPart column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Environment(EnvType.CLIENT)
public class RestockingChestBlockEntityRenderer implements BlockEntityRenderer<RestockingChestBlockEntity> {

private static final SpriteIdentifier spriteIdentifier = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, SpectrumCommon.locate("entity/restocking_chest"));
private static final SpriteIdentifier spriteIdentifier = new SpriteIdentifier(PlayerScreenHandler.BLOCK_ATLAS_TEXTURE, SpectrumCommon.locate("block/restocking_chest"));
private final ModelPart root;
private final ModelPart lid;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import net.minecraft.util.shape.*;
import net.minecraft.world.*;

import static net.minecraft.client.render.TexturedRenderLayers.*;
import static net.minecraft.client.texture.SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE;

public abstract class SpectrumChestBlock extends BlockWithEntity {

Expand Down Expand Up @@ -135,7 +135,7 @@ public BlockState getPlacementState(ItemPlacementContext ctx) {
}

public SpriteIdentifier getTexture() {
return new SpriteIdentifier(CHEST_ATLAS_TEXTURE, SpectrumCommon.locate("entity/heartbound_chest"));
return new SpriteIdentifier(BLOCK_ATLAS_TEXTURE, SpectrumCommon.locate("block/heartbound_chest"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import net.minecraft.world.*;
import org.jetbrains.annotations.*;

import static net.minecraft.client.render.TexturedRenderLayers.*;
import static net.minecraft.client.texture.SpriteAtlasTexture.*;

public class TreasureChestBlock extends SpectrumChestBlock {

Expand Down Expand Up @@ -45,9 +45,10 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, Block
return world.isClient ? checkType(type, SpectrumBlockEntities.PRESERVATION_CHEST, TreasureChestBlockEntity::clientTick) : null;
}

@SuppressWarnings("deprecation")
@Override
public SpriteIdentifier getTexture() {
return new SpriteIdentifier(CHEST_ATLAS_TEXTURE, SpectrumCommon.locate("entity/preservation_chest"));
return new SpriteIdentifier(BLOCK_ATLAS_TEXTURE, SpectrumCommon.locate("block/preservation_chest"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,4 @@ public static void registerClient() {
BlockEntityRendererFactories.register(SpectrumBlockEntities.COLOR_PICKER, ColorPickerBlockEntityRenderer::new);
}

private static void registerTextureAtlasCallback() {
// TODO - Fix chest textures
// textures that are only referenced in code have to be added to the texture atlas manually
// Register textures in chest atlas
// ClientSpriteRegistryCallback.event(TexturedRenderLayers.CHEST_ATLAS_TEXTURE).register((texture, registry) -> {
// registry.register(SpectrumCommon.locate("entity/private_chest"));
// registry.register(SpectrumCommon.locate("entity/preservation_chest"));
// });
//
// //Register textures in block atlas
// ClientSpriteRegistryCallback.event(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE).register((texture, registry) -> {
// registry.register(SpectrumCommon.locate("entity/pedestal_upgrade_speed"));
// registry.register(SpectrumCommon.locate("entity/pastel_line"));
// });
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
64
],
"textures": {
"1": "spectrum:entity/compacting_chest",
"particle": "spectrum:entity/compacting_chest"
"1": "spectrum:block/compacting_chest",
"particle": "spectrum:block/compacting_chest"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
64
],
"textures": {
"0": "spectrum:entity/heartbound_chest",
"particle": "spectrum:entity/heartbound_chest"
"0": "spectrum:block/heartbound_chest",
"particle": "spectrum:block/heartbound_chest"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "minecraft:block/block",
"textures": {
"0": "spectrum:entity/treasure_chest",
"0": "spectrum:block/preservation_chest",
"particle": "spectrum:block/preservation_stone"
},
"elements": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
64
],
"textures": {
"1": "spectrum:entity/restocking_chest",
"particle": "spectrum:entity/restocking_chest"
"1": "spectrum:block/restocking_chest",
"particle": "spectrum:block/restocking_chest"
},
"elements": [
{
Expand Down

0 comments on commit 3289ed9

Please sign in to comment.