amulet-core 2.0a7__cp311-cp311-win_amd64.whl → 2.0a8__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of amulet-core might be problematic. Click here for more details.

Files changed (80) hide show
  1. amulet/__init__.cp311-win_amd64.pyd +0 -0
  2. amulet/__init__.py.cpp +2 -0
  3. amulet/__init__.pyi +2 -0
  4. amulet/_version.py +3 -3
  5. amulet/chunk.hpp +2 -1
  6. amulet/level/abc/_chunk_handle.py +45 -22
  7. amulet/mesh/block/__init__.pyi +301 -0
  8. amulet/mesh/block/_cube.py +198 -0
  9. amulet/mesh/block/{missing_block.py → _missing_block.py} +2 -2
  10. amulet/mesh/block/block_mesh.cpp +107 -0
  11. amulet/mesh/block/block_mesh.hpp +207 -0
  12. amulet/resource_pack/__init__.py +16 -15
  13. amulet/resource_pack/abc/resource_pack_manager.py +3 -5
  14. amulet/resource_pack/java/resource_pack_manager.py +185 -173
  15. amulet/utils/cast.py +10 -0
  16. amulet/utils/shareable_lock.py +2 -2
  17. {amulet_core-2.0a7.dist-info → amulet_core-2.0a8.dist-info}/METADATA +2 -2
  18. {amulet_core-2.0a7.dist-info → amulet_core-2.0a8.dist-info}/RECORD +21 -75
  19. {amulet_core-2.0a7.dist-info → amulet_core-2.0a8.dist-info}/WHEEL +1 -1
  20. amulet/mesh/block/__init__.py +0 -1
  21. amulet/mesh/block/block_mesh.py +0 -369
  22. amulet/mesh/block/cube.py +0 -149
  23. amulet/resource_pack/bedrock/__init__.py +0 -2
  24. amulet/resource_pack/bedrock/bedrock_vanilla_fix/pack_icon.png +0 -0
  25. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_carried.png +0 -0
  26. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/grass_side_carried.png +0 -0
  27. amulet/resource_pack/bedrock/bedrock_vanilla_fix/textures/blocks/water.png +0 -0
  28. amulet/resource_pack/bedrock/blockshapes/__init__.py +0 -31
  29. amulet/resource_pack/bedrock/blockshapes/air.py +0 -35
  30. amulet/resource_pack/bedrock/blockshapes/base_blockshape.py +0 -29
  31. amulet/resource_pack/bedrock/blockshapes/bubble_column.py +0 -29
  32. amulet/resource_pack/bedrock/blockshapes/cake.py +0 -46
  33. amulet/resource_pack/bedrock/blockshapes/chest.py +0 -54
  34. amulet/resource_pack/bedrock/blockshapes/comparator.py +0 -51
  35. amulet/resource_pack/bedrock/blockshapes/cross_texture.py +0 -186
  36. amulet/resource_pack/bedrock/blockshapes/cross_texture0.py +0 -17
  37. amulet/resource_pack/bedrock/blockshapes/cross_texture_green.py +0 -16
  38. amulet/resource_pack/bedrock/blockshapes/cube.py +0 -38
  39. amulet/resource_pack/bedrock/blockshapes/default.py +0 -14
  40. amulet/resource_pack/bedrock/blockshapes/door.py +0 -38
  41. amulet/resource_pack/bedrock/blockshapes/door1.py +0 -14
  42. amulet/resource_pack/bedrock/blockshapes/door2.py +0 -14
  43. amulet/resource_pack/bedrock/blockshapes/door3.py +0 -14
  44. amulet/resource_pack/bedrock/blockshapes/door4.py +0 -14
  45. amulet/resource_pack/bedrock/blockshapes/door5.py +0 -14
  46. amulet/resource_pack/bedrock/blockshapes/door6.py +0 -14
  47. amulet/resource_pack/bedrock/blockshapes/double_plant.py +0 -40
  48. amulet/resource_pack/bedrock/blockshapes/enchanting_table.py +0 -22
  49. amulet/resource_pack/bedrock/blockshapes/farmland.py +0 -22
  50. amulet/resource_pack/bedrock/blockshapes/fence.py +0 -22
  51. amulet/resource_pack/bedrock/blockshapes/flat.py +0 -55
  52. amulet/resource_pack/bedrock/blockshapes/flat_wall.py +0 -55
  53. amulet/resource_pack/bedrock/blockshapes/furnace.py +0 -44
  54. amulet/resource_pack/bedrock/blockshapes/furnace_lit.py +0 -14
  55. amulet/resource_pack/bedrock/blockshapes/green_cube.py +0 -39
  56. amulet/resource_pack/bedrock/blockshapes/ladder.py +0 -36
  57. amulet/resource_pack/bedrock/blockshapes/lilypad.py +0 -14
  58. amulet/resource_pack/bedrock/blockshapes/partial_block.py +0 -57
  59. amulet/resource_pack/bedrock/blockshapes/piston.py +0 -44
  60. amulet/resource_pack/bedrock/blockshapes/piston_arm.py +0 -72
  61. amulet/resource_pack/bedrock/blockshapes/portal_frame.py +0 -22
  62. amulet/resource_pack/bedrock/blockshapes/pressure_plate.py +0 -29
  63. amulet/resource_pack/bedrock/blockshapes/pumpkin.py +0 -36
  64. amulet/resource_pack/bedrock/blockshapes/pumpkin_carved.py +0 -14
  65. amulet/resource_pack/bedrock/blockshapes/pumpkin_lit.py +0 -14
  66. amulet/resource_pack/bedrock/blockshapes/red_dust.py +0 -14
  67. amulet/resource_pack/bedrock/blockshapes/repeater.py +0 -53
  68. amulet/resource_pack/bedrock/blockshapes/slab.py +0 -33
  69. amulet/resource_pack/bedrock/blockshapes/slab_double.py +0 -15
  70. amulet/resource_pack/bedrock/blockshapes/tree.py +0 -41
  71. amulet/resource_pack/bedrock/blockshapes/turtle_egg.py +0 -15
  72. amulet/resource_pack/bedrock/blockshapes/vine.py +0 -52
  73. amulet/resource_pack/bedrock/blockshapes/wall.py +0 -22
  74. amulet/resource_pack/bedrock/blockshapes/water.py +0 -38
  75. amulet/resource_pack/bedrock/download_resources.py +0 -147
  76. amulet/resource_pack/bedrock/resource_pack.py +0 -40
  77. amulet/resource_pack/bedrock/resource_pack_manager.py +0 -361
  78. amulet/resource_pack/bedrock/sort_blockshapes.py +0 -15
  79. {amulet_core-2.0a7.dist-info → amulet_core-2.0a8.dist-info}/entry_points.txt +0 -0
  80. {amulet_core-2.0a7.dist-info → amulet_core-2.0a8.dist-info}/top_level.txt +0 -0
@@ -1,38 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.mesh.block.block_mesh import BlockMesh, Transparency
3
- from amulet.mesh.block.cube import get_unit_cube
4
- from amulet.resource_pack.bedrock.blockshapes.default import Default
5
-
6
-
7
- class Cube(Default):
8
- @property
9
- def blockshape(self) -> str:
10
- return "cube"
11
-
12
- def get_block_model(
13
- self,
14
- block: Block,
15
- down: str,
16
- up: str,
17
- north: str,
18
- east: str,
19
- south: str,
20
- west: str,
21
- transparency: tuple[bool, bool, bool, bool, bool, bool],
22
- ) -> BlockMesh:
23
- return get_unit_cube(
24
- down,
25
- up,
26
- north,
27
- east,
28
- south,
29
- west,
30
- (
31
- Transparency.FullTranslucent
32
- if any(transparency)
33
- else Transparency.FullOpaque
34
- ),
35
- )
36
-
37
-
38
- BlockShape = Cube()
@@ -1,14 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.base_blockshape import (
3
- BaseBlockShape,
4
- )
5
-
6
-
7
- class Default(BaseBlockShape):
8
- def is_valid(self, block: Block) -> bool:
9
- """Does the given block have the correct properties to use this blockshape"""
10
- return True
11
-
12
- def texture_index(self, block: Block, aux_value: int) -> int:
13
- """The texture index to use within the list for the given Block"""
14
- return aux_value % 16
@@ -1,38 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.mesh.block import BlockMesh
3
- from amulet.resource_pack.bedrock.blockshapes.cube import Cube
4
- import amulet_nbt
5
-
6
-
7
- class Door(Cube):
8
- def is_valid(self, block: Block) -> bool:
9
- return isinstance(block.properties.get("upper_block_bit"), amulet_nbt.TAG_Byte)
10
-
11
- @property
12
- def blockshape(self) -> str:
13
- return "door"
14
-
15
- def texture_index(self, block: Block, aux_value: int) -> int:
16
- return 0
17
-
18
- def get_block_model(
19
- self,
20
- block: Block,
21
- down: str,
22
- up: str,
23
- north: str,
24
- east: str,
25
- south: str,
26
- west: str,
27
- transparency: tuple[bool, bool, bool, bool, bool, bool],
28
- ) -> BlockMesh:
29
- if block.properties["upper_block_bit"].py_data:
30
- return super().get_block_model(
31
- block, north, north, north, north, north, north, transparency
32
- )
33
- return super().get_block_model(
34
- block, down, down, down, down, down, down, transparency
35
- )
36
-
37
-
38
- BlockShape = Door()
@@ -1,14 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.door import Door
3
-
4
-
5
- class Door1(Door):
6
- @property
7
- def blockshape(self) -> str:
8
- return "door1"
9
-
10
- def texture_index(self, block: Block, aux_value: int) -> int:
11
- return 1
12
-
13
-
14
- BlockShape = Door1()
@@ -1,14 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.door import Door
3
-
4
-
5
- class Door2(Door):
6
- @property
7
- def blockshape(self) -> str:
8
- return "door2"
9
-
10
- def texture_index(self, block: Block, aux_value: int) -> int:
11
- return 2
12
-
13
-
14
- BlockShape = Door2()
@@ -1,14 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.door import Door
3
-
4
-
5
- class Door3(Door):
6
- @property
7
- def blockshape(self) -> str:
8
- return "door3"
9
-
10
- def texture_index(self, block: Block, aux_value: int) -> int:
11
- return 3
12
-
13
-
14
- BlockShape = Door3()
@@ -1,14 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.door import Door
3
-
4
-
5
- class Door4(Door):
6
- @property
7
- def blockshape(self) -> str:
8
- return "door4"
9
-
10
- def texture_index(self, block: Block, aux_value: int) -> int:
11
- return 4
12
-
13
-
14
- BlockShape = Door4()
@@ -1,14 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.door import Door
3
-
4
-
5
- class Door5(Door):
6
- @property
7
- def blockshape(self) -> str:
8
- return "door5"
9
-
10
- def texture_index(self, block: Block, aux_value: int) -> int:
11
- return 5
12
-
13
-
14
- BlockShape = Door5()
@@ -1,14 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.door import Door
3
-
4
-
5
- class Door6(Door):
6
- @property
7
- def blockshape(self) -> str:
8
- return "door6"
9
-
10
- def texture_index(self, block: Block, aux_value: int) -> int:
11
- return 6
12
-
13
-
14
- BlockShape = Door6()
@@ -1,40 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.cross_texture import (
3
- Cross,
4
- )
5
- from amulet.mesh.block import BlockMesh
6
- import amulet_nbt
7
-
8
-
9
- class DoublePlant(Cross):
10
- def is_valid(self, block: Block) -> bool:
11
- return isinstance(block.properties.get("upper_block_bit"), amulet_nbt.TAG_Byte)
12
-
13
- @property
14
- def blockshape(self) -> str:
15
- return "double_plant"
16
-
17
- def texture_index(self, block: Block, aux_value: int) -> int:
18
- return aux_value % 8
19
-
20
- def get_block_model(
21
- self,
22
- block: Block,
23
- down: str,
24
- up: str,
25
- north: str,
26
- east: str,
27
- south: str,
28
- west: str,
29
- transparency: tuple[bool, bool, bool, bool, bool, bool],
30
- ) -> BlockMesh:
31
- if block.properties["upper_block_bit"].py_data:
32
- return super().get_block_model(block, up, up, up, up, up, up, transparency)
33
- else:
34
- return super().get_block_model(
35
- block, down, down, down, down, down, down, transparency
36
- )
37
- # TODO: add the sunflower face and tint the required blocks
38
-
39
-
40
- BlockShape = DoublePlant()
@@ -1,22 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.partial_block import (
3
- PartialBlock,
4
- )
5
-
6
-
7
- class EnchantingTable(PartialBlock):
8
- @property
9
- def blockshape(self) -> str:
10
- return "enchanting_table"
11
-
12
- def bounds(
13
- self, block: Block
14
- ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
15
- return (0, 1), (0, 12 / 16), (0, 1)
16
-
17
- @property
18
- def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
19
- return False, True, False, False, False, False
20
-
21
-
22
- BlockShape = EnchantingTable()
@@ -1,22 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.partial_block import (
3
- PartialBlock,
4
- )
5
-
6
-
7
- class FarmLand(PartialBlock):
8
- @property
9
- def blockshape(self) -> str:
10
- return "farmland"
11
-
12
- def bounds(
13
- self, block: Block
14
- ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
15
- return (0, 1), (0, 15 / 16), (0, 1)
16
-
17
- @property
18
- def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
19
- return False, True, False, False, False, False
20
-
21
-
22
- BlockShape = FarmLand()
@@ -1,22 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.partial_block import (
3
- PartialBlock,
4
- )
5
-
6
-
7
- class Fence(PartialBlock):
8
- @property
9
- def blockshape(self) -> str:
10
- return "fence"
11
-
12
- def bounds(
13
- self, block: Block
14
- ) -> tuple[tuple[float, float], tuple[float, float], tuple[float, float]]:
15
- return (6 / 16, 1 - 6 / 16), (0, 1), (6 / 16, 1 - 6 / 16)
16
-
17
- @property
18
- def do_not_cull(self) -> tuple[bool, bool, bool, bool, bool, bool]:
19
- return False, False, True, True, True, True
20
-
21
-
22
- BlockShape = Fence()
@@ -1,55 +0,0 @@
1
- import numpy
2
-
3
- from amulet.block import Block
4
- from amulet.mesh.block.block_mesh import BlockMesh, Transparency
5
- from amulet.resource_pack.bedrock.blockshapes.default import Default
6
-
7
-
8
- class Flat(Default):
9
- @property
10
- def tint(self) -> tuple[float, float, float]:
11
- return 1, 1, 1
12
-
13
- def get_block_model(
14
- self,
15
- block: Block,
16
- down: str,
17
- up: str,
18
- north: str,
19
- east: str,
20
- south: str,
21
- west: str,
22
- transparency: tuple[bool, bool, bool, bool, bool, bool],
23
- ) -> BlockMesh:
24
- return BlockMesh(
25
- 3,
26
- {
27
- None: numpy.array(
28
- [
29
- 0.0,
30
- 0.0625,
31
- 1.0,
32
- 1.0,
33
- 0.0625,
34
- 1.0,
35
- 1.0,
36
- 0.0625,
37
- 0.0,
38
- 0.0,
39
- 0.0625,
40
- 0.0,
41
- ],
42
- dtype=numpy.float32,
43
- )
44
- },
45
- {
46
- None: numpy.array(
47
- [0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0], numpy.float32
48
- )
49
- },
50
- {None: numpy.array(self.tint * 4, numpy.float32)},
51
- {None: numpy.array([0, 1, 2, 0, 2, 3], numpy.uint32)},
52
- {None: numpy.array([0, 0], numpy.uint32)},
53
- (up,),
54
- Transparency.Partial,
55
- )
@@ -1,55 +0,0 @@
1
- import numpy
2
-
3
- from amulet.block import Block
4
- from amulet.mesh.block.block_mesh import BlockMesh, Transparency
5
- from amulet.resource_pack.bedrock.blockshapes.default import Default
6
-
7
-
8
- class FlatWall(Default):
9
- @property
10
- def tint(self) -> tuple[float, float, float]:
11
- return 1, 1, 1
12
-
13
- def get_block_model(
14
- self,
15
- block: Block,
16
- down: str,
17
- up: str,
18
- north: str,
19
- east: str,
20
- south: str,
21
- west: str,
22
- transparency: tuple[bool, bool, bool, bool, bool, bool],
23
- ) -> BlockMesh:
24
- return BlockMesh(
25
- 3,
26
- {
27
- None: numpy.array(
28
- [
29
- 0.0,
30
- 0.0,
31
- 1 / 16,
32
- 1.0,
33
- 0.0,
34
- 1 / 16,
35
- 1.0,
36
- 1.0,
37
- 1 / 16,
38
- 0.0,
39
- 1.0,
40
- 1 / 16,
41
- ],
42
- dtype=numpy.float32,
43
- )
44
- },
45
- {
46
- None: numpy.array(
47
- [0.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0], numpy.float32
48
- )
49
- },
50
- {None: numpy.array(self.tint * 4, numpy.float32)},
51
- {None: numpy.array([0, 1, 2, 0, 2, 3], numpy.uint32)},
52
- {None: numpy.array([0, 0], numpy.uint32)},
53
- (up,),
54
- Transparency.Partial,
55
- )
@@ -1,44 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.mesh.block import BlockMesh
3
- from amulet.resource_pack.bedrock.blockshapes.cube import Cube
4
- import amulet_nbt
5
-
6
-
7
- class Furnace(Cube):
8
- def is_valid(self, block: Block) -> bool:
9
- return isinstance(block.properties.get("facing_direction"), amulet_nbt.TAG_Int)
10
-
11
- @property
12
- def blockshape(self) -> str:
13
- return "furnace"
14
-
15
- def texture_index(self, block: Block, aux_value: int) -> int:
16
- return 0
17
-
18
- @property
19
- def rotation_map(self) -> dict[int, int]:
20
- return {2: 2, 3: 0, 4: 1, 5: 3}
21
-
22
- def get_block_model(
23
- self,
24
- block: Block,
25
- down: str,
26
- up: str,
27
- north: str,
28
- east: str,
29
- south: str,
30
- west: str,
31
- transparency: tuple[bool, bool, bool, bool, bool, bool],
32
- ) -> BlockMesh:
33
- rotation = self.rotation_map.get(
34
- block.properties["facing_direction"].py_data, 0
35
- )
36
-
37
- return (
38
- super()
39
- .get_block_model(block, down, up, north, east, south, west, transparency)
40
- .rotate(0, rotation)
41
- )
42
-
43
-
44
- BlockShape = Furnace()
@@ -1,14 +0,0 @@
1
- from amulet.resource_pack.bedrock.blockshapes.furnace import Furnace
2
-
3
-
4
- class FurnaceLit(Furnace):
5
- @property
6
- def blockshape(self) -> str:
7
- return "furnace_lit"
8
-
9
- @property
10
- def rotation_map(self) -> dict[int, int]:
11
- return {2: 3, 3: 1, 4: 2, 5: 0}
12
-
13
-
14
- BlockShape = FurnaceLit()
@@ -1,39 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.mesh.block.block_mesh import BlockMesh, Transparency
3
- from amulet.mesh.block.cube import get_unit_cube
4
- from amulet.resource_pack.bedrock.blockshapes.cube import Cube
5
-
6
-
7
- class GreenCube(Cube):
8
- @property
9
- def blockshape(self) -> str:
10
- return "greencube"
11
-
12
- def get_block_model(
13
- self,
14
- block: Block,
15
- down: str,
16
- up: str,
17
- north: str,
18
- east: str,
19
- south: str,
20
- west: str,
21
- transparency: tuple[bool, bool, bool, bool, bool, bool],
22
- ) -> BlockMesh:
23
- return get_unit_cube(
24
- down,
25
- up,
26
- north,
27
- east,
28
- south,
29
- west,
30
- (
31
- Transparency.FullTranslucent
32
- if any(transparency)
33
- else Transparency.FullOpaque
34
- ),
35
- (0, 1, 0),
36
- )
37
-
38
-
39
- BlockShape = GreenCube()
@@ -1,36 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.resource_pack.bedrock.blockshapes.flat_wall import (
3
- FlatWall,
4
- )
5
- from amulet.mesh.block import BlockMesh
6
-
7
-
8
- class Ladder(FlatWall):
9
- @property
10
- def blockshape(self) -> str:
11
- return "ladder"
12
-
13
- def get_block_model(
14
- self,
15
- block: Block,
16
- down: str,
17
- up: str,
18
- north: str,
19
- east: str,
20
- south: str,
21
- west: str,
22
- transparency: tuple[bool, bool, bool, bool, bool, bool],
23
- modify_uv: bool = True,
24
- ) -> BlockMesh:
25
- rotation = {2: 2, 3: 0, 4: 1, 5: 3}.get(
26
- block.properties["facing_direction"].py_data, 0
27
- )
28
-
29
- return (
30
- super()
31
- .get_block_model(block, down, up, north, east, south, west, transparency)
32
- .rotate(0, rotation)
33
- )
34
-
35
-
36
- BlockShape = Ladder()
@@ -1,14 +0,0 @@
1
- from amulet.resource_pack.bedrock.blockshapes.flat import Flat
2
-
3
-
4
- class LilyPad(Flat):
5
- @property
6
- def blockshape(self) -> str:
7
- return "lilypad"
8
-
9
- @property
10
- def tint(self) -> tuple[float, float, float]:
11
- return 0, 1, 0
12
-
13
-
14
- BlockShape = LilyPad()
@@ -1,57 +0,0 @@
1
- from typing import Optional
2
-
3
- from amulet.block import Block
4
- from amulet.mesh.block.block_mesh import BlockMesh, Transparency
5
- from amulet.mesh.block.cube import get_cube
6
- from amulet.resource_pack.bedrock.blockshapes.default import Default
7
-
8
- BoundsType = tuple[tuple[float, float], tuple[float, float], tuple[float, float]]
9
- DoNotCullType = tuple[bool, bool, bool, bool, bool, bool]
10
-
11
-
12
- class PartialBlock(Default):
13
- def bounds(self, block: Block) -> BoundsType:
14
- return (0, 1), (0, 1), (0, 1)
15
-
16
- @property
17
- def do_not_cull(self) -> DoNotCullType:
18
- return False, False, False, False, False, False
19
-
20
- def get_block_model(
21
- self,
22
- block: Block,
23
- down: str,
24
- up: str,
25
- north: str,
26
- east: str,
27
- south: str,
28
- west: str,
29
- transparency: tuple[bool, bool, bool, bool, bool, bool],
30
- modify_uv: bool = True,
31
- bounds: Optional[BoundsType] = None,
32
- do_not_cull: Optional[DoNotCullType] = None,
33
- ) -> BlockMesh:
34
- bounds = bounds or self.bounds(block)
35
- if modify_uv:
36
- uv = (
37
- (bounds[0][0], bounds[2][0], bounds[0][1], bounds[2][1]),
38
- (bounds[0][0], bounds[2][0], bounds[0][1], bounds[2][1]),
39
- (bounds[0][0], 1 - bounds[1][1], bounds[0][1], 1 - bounds[1][0]),
40
- (bounds[2][0], 1 - bounds[1][1], bounds[2][1], 1 - bounds[1][0]),
41
- (bounds[0][0], 1 - bounds[1][1], bounds[0][1], 1 - bounds[1][0]),
42
- (bounds[2][0], 1 - bounds[1][1], bounds[2][1], 1 - bounds[1][0]),
43
- )
44
- else:
45
- uv = ((0, 0, 1, 1),) * 6
46
- return get_cube(
47
- down,
48
- up,
49
- north,
50
- east,
51
- south,
52
- west,
53
- Transparency.Partial,
54
- bounds=bounds,
55
- texture_uv=uv,
56
- do_not_cull=do_not_cull or self.do_not_cull,
57
- )
@@ -1,44 +0,0 @@
1
- from amulet.block import Block
2
- from amulet.mesh.block import BlockMesh
3
- from amulet.resource_pack.bedrock.blockshapes.cube import Cube
4
- import amulet_nbt
5
-
6
-
7
- class Piston(Cube):
8
- def is_valid(self, block: Block) -> bool:
9
- return isinstance(block.properties.get("facing_direction"), amulet_nbt.TAG_Int)
10
-
11
- @property
12
- def blockshape(self) -> str:
13
- return "piston"
14
-
15
- def texture_index(self, block: Block, aux_value: int) -> int:
16
- return 0
17
-
18
- @property
19
- def rotation_map(self) -> dict[int, tuple[int, int]]:
20
- return {0: (2, 0), 1: (0, 0), 2: (1, 2), 3: (1, 0), 4: (1, 1), 5: (1, 3)}
21
-
22
- def get_block_model(
23
- self,
24
- block: Block,
25
- down: str,
26
- up: str,
27
- north: str,
28
- east: str,
29
- south: str,
30
- west: str,
31
- transparency: tuple[bool, bool, bool, bool, bool, bool],
32
- ) -> BlockMesh:
33
- rotation = self.rotation_map.get(
34
- block.properties["facing_direction"].py_data, (0, 0)
35
- )
36
-
37
- return (
38
- super()
39
- .get_block_model(block, down, up, north, east, south, west, transparency)
40
- .rotate(*rotation)
41
- )
42
-
43
-
44
- BlockShape = Piston()