Skip to content

Commit

Permalink
Further improvements to the Water Purifier's model/textures
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Jan 2, 2024
1 parent a26ec4e commit 40001ee
Show file tree
Hide file tree
Showing 15 changed files with 228 additions and 175 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.4 2024-01-02T11:28:21.5564694 Recipes
// 1.20.4 2024-01-02T14:30:50.6090734 Recipes
09252bd5a872203de304820e8d5c5493afe96cf4 data/toughasnails/advancements/recipes/combat/leaf_boots.json
2da825265e95f5dfc0dd4026e0dafee70c17512c data/toughasnails/advancements/recipes/combat/leaf_chestplate.json
6d96cd4baff66d426c9405852ceed3aa8a3cde8f data/toughasnails/advancements/recipes/combat/leaf_helmet.json
Expand Down Expand Up @@ -68,7 +68,7 @@ e4a98b0325be4fb27194eb56a079871cdc8d4114 data/toughasnails/recipes/pumpkin_juice
2512026dc3a027f39db7e77e023a7017de386b9c data/toughasnails/recipes/sweet_berry_juice.json
e636bfd4fab8d516083454e872c8115f5c15cf27 data/toughasnails/recipes/temperature_gauge.json
b75d1caa0b1dcb9ae14dc02e47bba2a3c4b4a4dc data/toughasnails/recipes/thermometer.json
b0bd031a8ff3aa063ccd97f5f915733a3c94935e data/toughasnails/recipes/water_purifier.json
db1c57e8de0ba741ce1687b038a33505cd4c3a73 data/toughasnails/recipes/water_purifier.json
30229579a58927cae7011781b0936f7ca87888a4 data/toughasnails/recipes/wool_boots.json
25ff54ef0230fd94b0f881f7866b571f4729d254 data/toughasnails/recipes/wool_chestplate.json
0c83d0143c53a5071bda3e30a314be62876186f9 data/toughasnails/recipes/wool_helmet.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
},
"pattern": [
"WGW",
"GCG",
"WCW",
"G G",
"WWW"
],
"result": {
Expand Down
13 changes: 13 additions & 0 deletions common/src/main/java/toughasnails/block/WaterPurifierBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
******************************************************************************/
package toughasnails.block;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.mojang.serialization.MapCodec;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
Expand All @@ -15,6 +17,7 @@
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.entity.BlockEntity;
Expand All @@ -25,14 +28,18 @@
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.DirectionProperty;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;
import toughasnails.api.blockentity.TANBlockEntityTypes;
import toughasnails.block.entity.WaterPurifierBlockEntity;

import javax.annotation.Nullable;
import java.util.Map;

public class WaterPurifierBlock extends BaseEntityBlock
{
public static final MapCodec<WaterPurifierBlock> CODEC = simpleCodec(WaterPurifierBlock::new);
private static final Map<Direction, VoxelShape> SHAPES = Maps.newEnumMap(ImmutableMap.of(Direction.NORTH, Block.box(0.0D, 0.0D, 2.0D, 16.0D, 16.0D, 16.0D), Direction.SOUTH, Block.box(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 14.0D), Direction.EAST, Block.box(0.0D, 0.0D, 0.0D, 14.0D, 16.0D, 16.0D), Direction.WEST, Block.box(2.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D)));
public static final DirectionProperty FACING = HorizontalDirectionalBlock.FACING;
public static final BooleanProperty PURIFYING = BooleanProperty.create("filtering");

Expand All @@ -48,6 +55,12 @@ protected MapCodec<? extends BaseEntityBlock> codec()
return CODEC;
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter reader, BlockPos pos, CollisionContext selectionContext)
{
return SHAPES.get(state.getValue(FACING));
}

@Override
public InteractionResult use(BlockState state, Level worldIn, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,55 +13,55 @@
"to": [ 2, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 2 ],
"to": [ 14, 4, 14 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#inside", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"up": { "texture": "#inside" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 14, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side", "cullface": "east" }
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 0 ],
"to": [ 14, 16, 2 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 14 ],
"to": [ 14, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 16, 2 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@
"to": [ 2, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 2 ],
"to": [ 14, 4, 14 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#inside", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"up": { "texture": "#inside" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 14, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side", "cullface": "east" }
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 0 ],
"to": [ 14, 16, 2 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 14 ],
"to": [ 14, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 16, 2 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@
"to": [ 2, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 2 ],
"to": [ 14, 4, 14 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#inside", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"up": { "texture": "#inside" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 14, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side", "cullface": "east" }
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 0 ],
"to": [ 14, 16, 2 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 14 ],
"to": [ 14, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 16, 2 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,55 @@
"to": [ 2, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 2 ],
"to": [ 14, 4, 14 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#inside", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"up": { "texture": "#inside" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 14, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"south": { "texture": "#side", "cullface": "south" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side", "cullface": "east" }
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 0 ],
"to": [ 14, 16, 2 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"north": { "texture": "#side", "cullface": "north" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 0, 14 ],
"to": [ 14, 16, 16 ],
"faces": {
"down": { "texture": "#bottom" },
"up": { "texture": "#top", "cullface": "up" },
"up": { "texture": "#top" },
"north": { "texture": "#side" },
"south": { "texture": "#side", "cullface": "south" },
"west": { "texture": "#side", "cullface": "west" },
"east": { "texture": "#side", "cullface": "east" }
"south": { "texture": "#side" },
"west": { "texture": "#side" },
"east": { "texture": "#side" }
}
},
{ "from": [ 2, 16, 2 ],
Expand Down
Loading

0 comments on commit 40001ee

Please sign in to comment.