Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Machine Panes #291

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,18 @@
import java.util.function.Function;

public class OxygenSealerSpriteProvider implements MachineModelRegistry.SpriteProvider {
private final TextureAtlasSprite left;
private final TextureAtlasSprite right;
private final TextureAtlasSprite top;
private final TextureAtlasSprite machineSide;
private final TextureAtlasSprite machine;

public OxygenSealerSpriteProvider(JsonObject json, Function<net.minecraft.client.resources.model.Material, TextureAtlasSprite> function) {
this.right = function.apply(new net.minecraft.client.resources.model.Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation(GsonHelper.getAsString(json, "right"))));
this.left = function.apply(new net.minecraft.client.resources.model.Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation(GsonHelper.getAsString(json, "left"))));
this.top = function.apply(new net.minecraft.client.resources.model.Material(TextureAtlas.LOCATION_BLOCKS, new ResourceLocation(GsonHelper.getAsString(json, "top"))));
this.machine = function.apply(MachineBakedModel.MACHINE);
this.machineSide = function.apply(MachineBakedModel.MACHINE_SIDE);
}

@Override
public @NotNull TextureAtlasSprite getSpritesForState(@NotNull MachineRenderData renderData, @NotNull BlockFace face) {
if (face == BlockFace.LEFT) return this.left;
if (face == BlockFace.RIGHT) return this.right;
if (face == BlockFace.TOP) return this.top;
if (face.side()) return this.machineSide;
return this.machine;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2023 Team Galacticraft
* Copyright (c) 2019-2024 Team Galacticraft
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"machinelib:generate": "machinelib:z_axis",
"machinelib:generate": "machinelib:front_face",
"sprites": {
"front": "galacticraft:block/circuit_fabricator",
"back": "galacticraft:block/machine_power_input",
"sided": true
"sprite": "galacticraft:block/circuit_fabricator"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"machinelib:generate": "machinelib:z_axis",
"machinelib:generate": "machinelib:front_face",
"sprites": {
"front": "galacticraft:block/coal_generator",
"back": "galacticraft:block/machine_power_output",
"sided": true
"sprite": "galacticraft:block/coal_generator"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"machinelib:generate": "machinelib:z_axis",
"machinelib:generate": "machinelib:front_face",
"sprites": {
"front": "galacticraft:block/electric_compressor",
"back": "galacticraft:block/machine_power_input",
"sided": true
"sprite": "galacticraft:block/electric_compressor"
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"machinelib:generate": "galacticraft:oxygen_sealer",
"sprites": {
"right": "galacticraft:block/machine_power_input",
"left": "galacticraft:block/machine_fluid_input",
"top": "galacticraft:block/oxygen_sealer_top"
},
"textures": {
"up": "galacticraft:block/oxygen_sealer_top",
"down": "galacticraft:block/machine",
"north": "galacticraft:block/machine_side",
"south": "galacticraft:block/machine_side",
"east": "galacticraft:block/machine_power_input",
"west": "galacticraft:block/machine_fluid_input",
"east": "galacticraft:block/machine_side",
"west": "galacticraft:block/machine_side",
"particle": "galacticraft:block/machine"
}
}
Loading