fix more codefactor issues

This commit is contained in:
Holly Stubbs 2023-04-09 04:51:30 +01:00
parent 16c7b5ddcc
commit e5ba93ce9c
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E
5 changed files with 11 additions and 5 deletions

View file

@ -2,7 +2,6 @@ import { Block } from "../blocks/Block";
import { Chunk } from "../Chunk";
import { IGenerator } from "./IGenerator";
import { Noise2D, makeNoise2D } from "../../external/OpenSimplex2D";
import shuffle_seed from "../../external/shuffle_seed";
export class HillyGenerator implements IGenerator {
private seed:number;

View file

@ -6,11 +6,16 @@ export class PacketDisconnectKick implements IPacket {
public packetId = Packets.DisconnectKick;
public reason:string;
public constructor(reason:string) {
this.reason = reason;
public constructor(reason?:string) {
if (typeof(reason) === "string") {
this.reason = reason;
} else {
this.reason = "";
}
}
public readData(reader:Reader) {
this.reason = reader.readString();
return this;
}

View file

@ -1,4 +1,4 @@
import { Reader, Writer } from "../../bufferStuff";
import { Reader } from "../../bufferStuff";
import { Packets } from "../enums/Packets";
export interface IPacket {

View file

@ -7,6 +7,7 @@ export class PacketKeepAlive implements IPacket {
private static readonly KeepAliveBuffer:Buffer = new Writer(1).writeByte(Packets.KeepAlive).toBuffer();
public readData(reader:Reader) {
reader;
return this;
}

View file

@ -25,7 +25,8 @@ export class PacketMapChunk implements IPacket {
}
public readData(reader:Reader) {
// TODO: Implement MapChunk reading
reader.readBool();
return this;
}