Code Monkey home page Code Monkey logo

tuubescraft's People

Contributors

theelectronwill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tuubescraft's Issues

Handle the player connection

  • Basic packets auto generated for MC 1.12.2
  • Network system improved and bugs fixed
  • Handshake, status request and login request handled
  • Chunk management
  • Send 7x7 chunks around the spawn location, after LoginSuccess is sent

NBT Library?

Which library should I choose?
I need one that works with Niol as simply as possible.

Wrong packet size

Got size 2048 for the first packet sent by the client, which is obviously wrong.

PacketRegistry trait

  • PacketConstructor[A <: Packet] : NiolBuffer => A
  • get packet constructor NiolBuffer => A by id
  • register packet

Type-safe packet builder

Example of how this could be done :

class PacketSomething(var number: Int, var infos: String)
class PacketSomethingBuilder[P <: PacketSomething] {
  private var number: Int = _
  private var infos: String = _

  def withNumber(n: Int): Builder[P with Number] {
    number=n
    this.asInstanceOf[Builder[P with Number]]
  }
  def withInfos(s: String): Builder[P with Infos] {
    infos=s
    this.asInstanceOf[Builder[P with Infos]]
  }
  def build()(implicit evidence: P =:= Complete) {
    new PacketSomething(number, infos)
  }
object PacketSomethingBuilder {
  sealed trait Number
  sealed trait Infos
  type Complete = PacketSomething with Number with Infos
}

We could also provide a way to construct a NiolBuffer directly, if the performance benefit is worth it.

Crash when loading TuubesCraft 1.12

00:44:10 DEBUG [main] TuubesCore: Creating an instance of each plugin
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.tuubes.craft.mc1_12.TuubesCraft1_12.<init>(TuubesCraft1_12.scala:8)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at org.tuubes.core.plugins.ScalaPluginLoader.$anonfun$load$8(ScalaPluginLoader.scala:70)
	at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:789)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:52)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:788)
	at org.tuubes.core.plugins.ScalaPluginLoader.load(ScalaPluginLoader.scala:65)
	at org.tuubes.core.TuubesServer$.main(TuubesServer.scala:36)
	at org.tuubes.core.TuubesServer.main(TuubesServer.scala)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 254
	at scala.runtime.ScalaRunTime$.array_update(ScalaRunTime.scala:71)
	at com.electronwill.collections.ArrayMap.update(ArrayMap.scala:38)
	at org.tuubes.craft.MinecraftProtocol.registerPacket(MinecraftProtocol.scala:17)
	at org.tuubes.craft.mc1_12.handshaking.HandshakingProtocol$.<init>(HandshakingProtocol.scala:9)
	at org.tuubes.craft.mc1_12.handshaking.HandshakingProtocol$.<clinit>(HandshakingProtocol.scala)
	... 15 more

Implement a Niol ClientAttach

Implement a Niol ClientAttach MinecraftClientAttach that uses a PacketRegistry depending on the current protocol and protocol state.

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.