fix more codefactor issues
This commit is contained in:
parent
16c7b5ddcc
commit
e5ba93ce9c
5 changed files with 11 additions and 5 deletions
|
@ -2,7 +2,6 @@ import { Block } from "../blocks/Block";
|
||||||
import { Chunk } from "../Chunk";
|
import { Chunk } from "../Chunk";
|
||||||
import { IGenerator } from "./IGenerator";
|
import { IGenerator } from "./IGenerator";
|
||||||
import { Noise2D, makeNoise2D } from "../../external/OpenSimplex2D";
|
import { Noise2D, makeNoise2D } from "../../external/OpenSimplex2D";
|
||||||
import shuffle_seed from "../../external/shuffle_seed";
|
|
||||||
|
|
||||||
export class HillyGenerator implements IGenerator {
|
export class HillyGenerator implements IGenerator {
|
||||||
private seed:number;
|
private seed:number;
|
||||||
|
|
|
@ -6,11 +6,16 @@ export class PacketDisconnectKick implements IPacket {
|
||||||
public packetId = Packets.DisconnectKick;
|
public packetId = Packets.DisconnectKick;
|
||||||
public reason:string;
|
public reason:string;
|
||||||
|
|
||||||
public constructor(reason:string) {
|
public constructor(reason?:string) {
|
||||||
this.reason = reason;
|
if (typeof(reason) === "string") {
|
||||||
|
this.reason = reason;
|
||||||
|
} else {
|
||||||
|
this.reason = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public readData(reader:Reader) {
|
public readData(reader:Reader) {
|
||||||
|
this.reason = reader.readString();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Reader, Writer } from "../../bufferStuff";
|
import { Reader } from "../../bufferStuff";
|
||||||
import { Packets } from "../enums/Packets";
|
import { Packets } from "../enums/Packets";
|
||||||
|
|
||||||
export interface IPacket {
|
export interface IPacket {
|
||||||
|
|
|
@ -7,6 +7,7 @@ export class PacketKeepAlive implements IPacket {
|
||||||
private static readonly KeepAliveBuffer:Buffer = new Writer(1).writeByte(Packets.KeepAlive).toBuffer();
|
private static readonly KeepAliveBuffer:Buffer = new Writer(1).writeByte(Packets.KeepAlive).toBuffer();
|
||||||
|
|
||||||
public readData(reader:Reader) {
|
public readData(reader:Reader) {
|
||||||
|
reader;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@ export class PacketMapChunk implements IPacket {
|
||||||
}
|
}
|
||||||
|
|
||||||
public readData(reader:Reader) {
|
public readData(reader:Reader) {
|
||||||
|
// TODO: Implement MapChunk reading
|
||||||
|
reader.readBool();
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue