Update uncrafter menu texture

This commit is contained in:
Zontreck 2024-03-03 21:54:02 -07:00
parent 07923c885a
commit 47cb43305b
8 changed files with 24 additions and 9 deletions

View file

@ -1,12 +1,12 @@
{ {
"variants": { "variants": {
"facing=north": {
"model": "otemod:block/uncrafter"
},
"facing=east": { "facing=east": {
"model": "otemod:block/uncrafter", "model": "otemod:block/uncrafter",
"y": 90 "y": 90
}, },
"facing=north": {
"model": "otemod:block/uncrafter"
},
"facing=south": { "facing=south": {
"model": "otemod:block/uncrafter", "model": "otemod:block/uncrafter",
"y": 180 "y": 180

View file

@ -0,0 +1,3 @@
{
"parent": "otemod:block/custommodel/uncrafter"
}

View file

@ -0,0 +1,3 @@
{
"parent": "otemod:block/uncrafter"
}

View file

@ -82,7 +82,7 @@ public class UncrafterBlockEntity extends BlockEntity implements MenuProvider
} }
}; };
protected final ItemStackHandler outputItems = new ItemStackHandler((3*9)){ protected final ItemStackHandler outputItems = new ItemStackHandler(1){
@Override @Override
protected void onContentsChanged(int slot) { protected void onContentsChanged(int slot) {
setChanged(); setChanged();
@ -107,7 +107,7 @@ public class UncrafterBlockEntity extends BlockEntity implements MenuProvider
@Override @Override
public Component getDisplayName() { public Component getDisplayName() {
return Component.literal("Uncrafter"); return Component.literal("Uncrafting Factory");
} }
@Nullable @Nullable

View file

@ -75,7 +75,7 @@ public class ModBlockStatesProvider extends BlockStateProvider {
stairBlock(ModBlocks.DIRTY_GREEN_POOL_TILE_STAIRS, ModBlocks.DIRTY_GREEN_POOL_TILE); stairBlock(ModBlocks.DIRTY_GREEN_POOL_TILE_STAIRS, ModBlocks.DIRTY_GREEN_POOL_TILE);
slabBlock(ModBlocks.DIRTY_GREEN_POOL_TILE_SLAB, ModBlocks.DIRTY_GREEN_POOL_TILE); slabBlock(ModBlocks.DIRTY_GREEN_POOL_TILE_SLAB, ModBlocks.DIRTY_GREEN_POOL_TILE);
blockWithExistingModel(ModBlocks.UNCRAFTER, "block/custommodels/uncrafter", true); blockWithExistingModel(ModBlocks.UNCRAFTER, "block/custommodel/uncrafter", true);
} }

View file

@ -12,15 +12,24 @@ import java.util.List;
public class PartialItem extends Item public class PartialItem extends Item
{ {
int uncraftSteps = 0; private static final String TAG_UNCRAFT_REMAIN = "remaining";
public PartialItem() { public PartialItem() {
super (new Properties().fireResistant()); super (new Properties().fireResistant());
} }
@Override @Override
public void appendHoverText(ItemStack p_41421_, @Nullable Level p_41422_, List<Component> tooltip, TooltipFlag p_41424_) { public void appendHoverText(ItemStack stack, @Nullable Level p_41422_, List<Component> tooltip, TooltipFlag p_41424_) {
tooltip.add(ChatHelpers.macro("!Yellow!This is a partially deconstructed item.")); tooltip.add(ChatHelpers.macro("!Yellow!This is a partially deconstructed item."));
tooltip.add(ChatHelpers.macro("!Dark_Red!Steps remaining to uncraft: [0]", "!Yellow!" + uncraftSteps));
if(stack.getTag()!= null)
{
if(stack.getTag().contains(TAG_UNCRAFT_REMAIN))
{
tooltip.add(ChatHelpers.macro("!Dark_Red!Number of uncraft steps remaining: [0]", "!Yellow!" + stack.getTag().getInt(TAG_UNCRAFT_REMAIN)));
}
} else {
tooltip.add(ChatHelpers.macro("!Dark_Red!This partial item appears to be invalid, and contains no item fragments."));
}
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 19 KiB