Code Monkey home page Code Monkey logo

spectastic's People

Contributors

mbax avatar

Watchers

 avatar  avatar

spectastic's Issues

Safe Spawning

So we all know people are going to be a******* and place blocks where someone spectates. Therefore, I propose the following algorithm for determining a "safe spawn":

safe(pos) =
(a) no lava or harmful liquid above or below the position without a separating block.
(b) no blocks that could suffocate or trap the player (spider webs?)
(c) a player could AFK there safely (without drowning).

  1. Get the block where the player came from. If it's safe, go there. Otherwise, continue.
  2. Calculate the next element of the golden spiral, based on the original position. Check all blocks in that element for safety. If at any point a block is safe, escape the algorithm.
  3. If there is no safe block in the spiral, go back to 2.
  4. If after a configurable amount of steps no safe location was found, teleport to the top of wherever their original location was (if it's safe as well) or to spawn or another configurable strategy.

This has the benefit of returning them as close to their original location as possible while progressively broadening the search.

A notice from the console during start up

[Server thread/WARN] [Sponge]: A custom DataBuilder is not extending AbstractDataBuilder! It is recommended that the custom data builder does extend it to gain automated content versioning updates and maintain simplicity. The offending builder's class is: class org.kitteh.spectastic.data.gamemode.PastGameModeDataManipulatorBuilder

Spongeforge v5.2.0β2320
Spectastic v1.1.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.