aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-10-24 20:32:08 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-10-24 20:32:08 +0200
commit7cb5e9ef04da044adaed4834397c574fb31c1300 (patch)
tree9773b15d191b137dbb047705ec48de893d994e2a
parentad9e5400648e2d52d55705ccb3a7592bdaea310d (diff)
downloadberryclient-7cb5e9ef04da044adaed4834397c574fb31c1300.tar.gz
berryclient-7cb5e9ef04da044adaed4834397c574fb31c1300.zip
build house accurately
-rw-r--r--BerryClient/addons/blockworld.py2
-rw-r--r--BerryClient/models/House.py2
-rw-r--r--BerryClient/models/Wall.py19
-rw-r--r--BerryClient/models/WallWithDoor.py18
-rw-r--r--BerryClient/models/WallWithWindow.py6
5 files changed, 24 insertions, 23 deletions
diff --git a/BerryClient/addons/blockworld.py b/BerryClient/addons/blockworld.py
index 0de9f2c..2de6fd5 100644
--- a/BerryClient/addons/blockworld.py
+++ b/BerryClient/addons/blockworld.py
@@ -5,7 +5,7 @@ from BerryClient.models.House import House
MATERIAL_MAPPING = {
"air": mcpi.block.AIR,
- "stone": mcpi.block.STONE,
+ "stone": mcpi.block.STONE_SLAB_DOUBLE,
"brick": mcpi.block.BRICK_BLOCK,
}
diff --git a/BerryClient/models/House.py b/BerryClient/models/House.py
index 72ae549..ce4d2e8 100644
--- a/BerryClient/models/House.py
+++ b/BerryClient/models/House.py
@@ -35,7 +35,7 @@ class House:
self.wallBack = Wall(corner_top_left, bw)
- roof_corner = (x, y + Wall.height, z)
+ roof_corner = (x, y + Wall.height-1, z)
self.roof = Roof(roof_corner, bw)
def build(self):
diff --git a/BerryClient/models/Wall.py b/BerryClient/models/Wall.py
index cbd761a..9904ebb 100644
--- a/BerryClient/models/Wall.py
+++ b/BerryClient/models/Wall.py
@@ -12,17 +12,16 @@ class Wall:
self._bw = bw
def build(self):
- for h in range(self.height):
- x, y, z = self.pos
- y += h
+ x, y, z = self.pos
- from_pos = (x,y,z)
+ from_pos = (x,y,z)
- if self.rotated:
- z += self.width - 1
- else:
- x += self.width - 1
+ if self.rotated:
+ z += self.width - 1
+ else:
+ x += self.width - 1
+ y += self.height-1
- to_pos = (x,y,z)
+ to_pos = (x,y,z)
- self._bw.set_blocks(*from_pos, *to_pos, self.material_id)
+ self._bw.set_blocks(*from_pos, *to_pos, self.material_id)
diff --git a/BerryClient/models/WallWithDoor.py b/BerryClient/models/WallWithDoor.py
index 3205ca8..7eb8ead 100644
--- a/BerryClient/models/WallWithDoor.py
+++ b/BerryClient/models/WallWithDoor.py
@@ -13,14 +13,14 @@ class WallWithDoor(Wall):
else:
x += (self.width / 2)-1
- for i in range(2):
- if i:
- if self.rotated:
- z += 1
- else:
- x += 1
+ from_pos = (x, y, z)
- from_pos = (x, y, z)
- to_pos = (x, y+1, z)
+ if self.rotated:
+ z += 1
+ else:
+ x += 1
+ y += 2
+
+ to_pos = (x, y, z)
- self._bw.set_blocks(*from_pos, *to_pos, self.door_material_id)
+ self._bw.set_blocks(*from_pos, *to_pos, self.door_material_id)
diff --git a/BerryClient/models/WallWithWindow.py b/BerryClient/models/WallWithWindow.py
index bde405b..38f2f1f 100644
--- a/BerryClient/models/WallWithWindow.py
+++ b/BerryClient/models/WallWithWindow.py
@@ -11,14 +11,16 @@ class WallWithWindow(Wall):
z += (self.width / 2)
else:
x += (self.width / 2)
+ y += 1
- from_pos = (x, y+1, z)
+ from_pos = (x, y, z)
if self.rotated:
z -= 1
else:
x -= 1
+ y += 1
- to_pos = (x, y+1, z)
+ to_pos = (x, y, z)
self._bw.set_blocks(*from_pos, *to_pos, self.window_material_id) \ No newline at end of file