schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Move player_selection_switches #16

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

This is current an instance method of the MinecraftBreeder class. Turn this method into a stand-alone function by making all values referenced via self into function parameters. Then move the function to the module minecraft_structures.py.

See the other functions in minecraft_structures.py for examples of how to do this.

schrum2 commented 2 years ago

Also, while you are working on this, pull out the portion of this function responsible for generating a single switch and put that into its own stand-alone function, also in minecraft_structures.py. Make this function return the location where the redstone block moves when activated as a 3-tuple (int,int,int)

schrum2 commented 2 years ago

One more thing. Before placing any components of the switch, fill the region and some of the surrounding area with ground blocks. This should be done in case the ground has been previously obliterated (by TNT explosions for example). Remember that one single command can fill a whole region with a block of one type

schrum2 commented 2 years ago

This does not work currently. Since player_selection_switches is a standalone function now, it cannot use self anywhere. Instead, every use of self in player_selection_switches needs to instead rely on a parameter sent to player_selection_switches. @alejmedinajr did this a lot when making minecraft_structures.py in the first place, so ask him for help.

schrum2 commented 2 years ago

This issue is about moving the code, which still needs to be fixed. However, the placement of the switches in the game world also needs to be improved ... though you may need to work with @MuellMark to assure consistency with what he is doing on issue #7

richeyme commented 2 years ago

I have correctly moved the code over to minecraft_structures, shifted the selection switches over to be center with the structure before it, and fixed the issue with the dirt block spawning in with the redstone lamp