aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-10-20 08:07:01 +0200
committerJan200101 <sentrycraft123@gmail.com>2023-02-16 08:38:07 +0100
commit2af492f4496e09cb27b493107160a395d0728914 (patch)
treec34eff73e1d47a5d6856b85d3689657aed11a64b
parent378aee62fe833b00042330505852b1166c28ddff (diff)
downloadberryclient-no-model.tar.gz
berryclient-no-model.zip
remove modelsno-model
-rw-r--r--BerryClient/addons/blockworld.py4
-rw-r--r--BerryClient/models/House.py52
-rw-r--r--BerryClient/models/Roof.py22
-rw-r--r--BerryClient/models/Wall.py30
-rw-r--r--BerryClient/models/WallWithDoor.py26
-rw-r--r--BerryClient/models/WallWithWindow.py26
6 files changed, 1 insertions, 159 deletions
diff --git a/BerryClient/addons/blockworld.py b/BerryClient/addons/blockworld.py
index ad9b9ab..dd518ca 100644
--- a/BerryClient/addons/blockworld.py
+++ b/BerryClient/addons/blockworld.py
@@ -1,7 +1,6 @@
import mcpi.block
from BerryClient.commands import command
-from BerryClient.models.House import House
MATERIAL_MAPPING = {
"air": mcpi.block.AIR,
@@ -44,5 +43,4 @@ def b(core):
"""
bw = BlockWorld(core)
- h = House(bw.player_position(), bw)
- h.build()
+ # build house here
diff --git a/BerryClient/models/House.py b/BerryClient/models/House.py
deleted file mode 100644
index 241fbd8..0000000
--- a/BerryClient/models/House.py
+++ /dev/null
@@ -1,52 +0,0 @@
-from BerryClient.models.Roof import Roof
-from BerryClient.models.Wall import Wall
-from BerryClient.models.WallWithDoor import WallWithDoor
-from BerryClient.models.WallWithWindow import WallWithWindow
-
-class House:
- wallFront: Wall
- wallLeft: Wall
- wallRight: Wall
- wallBack: Wall
- pos: tuple
- roof: Roof
- __bw: "BlockWorld"
-
- def __init__(self, pos, bw):
- self.pos = pos
- self.__bw = bw
-
- x, y, z = self.pos
-
- x -= (Wall.width/2)
- z -= (Wall.width/2)
-
- corner_bottom_left = (x, y, z)
- corner_bottom_right = (x + Wall.width-1, y, z)
- corner_top_left = (x, y, z + Wall.width-1)
-
- self.wallFront = WallWithDoor(corner_bottom_left, bw)
-
- self.wallLeft = WallWithWindow(corner_bottom_left, bw)
- self.wallLeft.rotated = True
-
- self.wallRight = WallWithWindow(corner_bottom_right, bw)
- self.wallRight.rotated = True
-
- self.wallBack = Wall(corner_top_left, bw)
-
- roof_corner = (x, y + Wall.height-1, z)
- self.roof = Roof(roof_corner, bw)
-
- def build(self):
- self.wallFront.build()
- self.wallLeft.build()
- self.wallRight.build()
- self.wallBack.build()
- self.roof.build()
-
- def change_wall_material(self, new_material_id: str):
- self.wallFront.material_id = new_material_id
- self.wallLeft.material_id = new_material_id
- self.wallRight.material_id = new_material_id
- self.wallBack.material_id = new_material_id
diff --git a/BerryClient/models/Roof.py b/BerryClient/models/Roof.py
deleted file mode 100644
index 5bef395..0000000
--- a/BerryClient/models/Roof.py
+++ /dev/null
@@ -1,22 +0,0 @@
-
-class Roof:
- width: int = 6
- depth: int = 6
- roof_material_id: str = "brick"
- pos: tuple
- __bw: "BlockWorld"
-
- def __init__(self, pos, bw):
- self.pos = pos
- self.__bw = bw
-
- def build(self):
-
- for d in range(self.depth):
- x, y, z = self.pos
- z += d
-
- from_pos = (x, y, z)
- to_pos = (x + self.width-1, y, z)
-
- self.__bw.set_blocks(*from_pos, *to_pos, self.roof_material_id)
diff --git a/BerryClient/models/Wall.py b/BerryClient/models/Wall.py
deleted file mode 100644
index 07c259e..0000000
--- a/BerryClient/models/Wall.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import logging
-
-log = logging.getLogger(__name__)
-
-class Wall:
- width: int = 6
- height: int = 5
- pos: tuple
- rotated: bool = False
- material_id: str = "stone"
- _bw: "BlockWorld"
-
- def __init__(self, pos, bw):
- self.pos = pos
- self._bw = bw
-
- def build(self):
- x, y, z = self.pos
-
- from_pos = (x,y,z)
-
- if self.rotated:
- z += self.width - 1
- else:
- x += self.width - 1
- y += self.height-1
-
- to_pos = (x,y,z)
-
- self._bw.set_blocks(*from_pos, *to_pos, self.material_id)
diff --git a/BerryClient/models/WallWithDoor.py b/BerryClient/models/WallWithDoor.py
deleted file mode 100644
index 7eb8ead..0000000
--- a/BerryClient/models/WallWithDoor.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from BerryClient.models.Wall import Wall
-
-class WallWithDoor(Wall):
- door_material_id: str = "air"
-
- def build(self):
- super().build()
-
- x, y, z = self.pos
-
- if self.rotated:
- z += (self.width / 2)-1
- else:
- x += (self.width / 2)-1
-
- from_pos = (x, y, 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)
diff --git a/BerryClient/models/WallWithWindow.py b/BerryClient/models/WallWithWindow.py
deleted file mode 100644
index 38f2f1f..0000000
--- a/BerryClient/models/WallWithWindow.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from BerryClient.models.Wall import Wall
-
-class WallWithWindow(Wall):
- window_material_id: str = "air"
-
- def build(self):
- super().build()
-
- x, y, z = self.pos
- if self.rotated:
- z += (self.width / 2)
- else:
- x += (self.width / 2)
- y += 1
-
- from_pos = (x, y, z)
-
- if self.rotated:
- z -= 1
- else:
- x -= 1
- y += 1
-
- to_pos = (x, y, z)
-
- self._bw.set_blocks(*from_pos, *to_pos, self.window_material_id) \ No newline at end of file