Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Netease 1.18 Support
Browse files Browse the repository at this point in the history
  • Loading branch information
LNSSPsd committed Jun 30, 2022
1 parent 86cc755 commit 2c89f58
Show file tree
Hide file tree
Showing 90 changed files with 2,272 additions and 1,004 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endif
ifneq ($(wildcard /usr/bin/aarch64-linux-gnu-gcc),)
TARGETS:=${TARGETS} current-arm64-executable
endif
ifneq ($(wildcard `pwd`/openwrt-sdk-21.02.2-ramips-mt7620_gcc-8.4.0_musl.Linux-x86_64),)
ifneq ($(wildcard openwrt-sdk-21.02.2-ramips-mt7620_gcc-8.4.0_musl.Linux-x86_64),)
TARGETS:=${TARGETS} openwrt-mt7620-mipsel_24kc
endif

Expand Down
6 changes: 3 additions & 3 deletions fastbuilder/world_provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func DoCache(pkt *packet.LevelChunk) {
}

func quickCache(pkt *packet.LevelChunk) {
ChunkCache[world.ChunkPos{pkt.ChunkX,pkt.ChunkZ}]=pkt
ChunkCache[world.ChunkPos{pkt.Position[0],pkt.Position[1]}]=pkt
}

func wander(env *environment.PBEnvironment, position world.ChunkPos) {
Expand Down Expand Up @@ -101,8 +101,8 @@ func (p *OnlineWorldProvider) LoadChunk(position world.ChunkPos) (c *chunk.Chunk
select {
case inp=<-ChunkInput:
quickCache(inp)
fmt.Printf("Waiting for chunk: current: %d, %d | expected: %v\n",inp.ChunkX,inp.ChunkZ,position)
if(inp.ChunkX!=position[0]||inp.ChunkZ!=position[1]) {
fmt.Printf("Waiting for chunk: current: %d, %d | expected: %v\n",inp.Position[0],inp.Position[1],position)
if(inp.Position[0]!=position[0]||inp.Position[1]!=position[1]) {
continue
}
case <-time.After(2*time.Second):
Expand Down
8 changes: 5 additions & 3 deletions io/special_tasks/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func CreateExportTask(commandLine string, env *environment.PBEnvironment) *task.
cmdsender.Output(fmt.Sprintf("Failed to parse command: %v",err))
return nil
}
cmdsender.Output("Sorry, but compatibility works haven't been done yet, please use lexport.")
return nil
beginPos := cfg.Position
endPos := cfg.End
startX,endX,startZ,endZ:=0,0,0,0
Expand Down Expand Up @@ -109,7 +111,7 @@ func CreateExportTask(commandLine string, env *environment.PBEnvironment) *task.
}
providerChunksMap:=make(map[world_provider.ChunkPosDefine]world_provider.ChunkDefine)
for _,chunk:=range chunkPool{
providerChunksMap[world_provider.ChunkPosDefine{chunk.ChunkX,chunk.ChunkZ}]=world_provider.ChunkDefine(chunk)
providerChunksMap[world_provider.ChunkPosDefine{chunk.Position[0],chunk.Position[1]}]=world_provider.ChunkDefine(chunk)
}
var offlineWorld *world.World
offlineWorld=world.New(&world_provider.StubLogger{},32)
Expand Down Expand Up @@ -161,7 +163,7 @@ func CreateExportTask(commandLine string, env *environment.PBEnvironment) *task.
if(block=="command_block"){
mode=packet.CommandBlockImpulse
}else if(block=="repeating_command_block"){
mode=packet.CommandBlockRepeat
mode=packet.CommandBlockRepeating
}else if(block=="chain_command_block"){
mode=packet.CommandBlockChain
}
Expand Down Expand Up @@ -394,7 +396,7 @@ func CreateLegacyExportTask(commandLine string, env *environment.PBEnvironment)
if(curblockname=="command_block"){
mode=packet.CommandBlockImpulse
}else if(curblockname=="repeating_command_block"){
mode=packet.CommandBlockRepeat
mode=packet.CommandBlockRepeating
}else if(curblockname=="chain_command_block"){
mode=packet.CommandBlockChain
}
Expand Down
21 changes: 3 additions & 18 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,22 +506,10 @@ func runClient(env *environment.PBEnvironment) {
}
env.UQHolder.(*uqHolder.UQHolder).UpdateFromConn(conn)
for {
pk, data, err := conn.ReadPacketAndBytes()
pk, err := conn.ReadPacket()
if err != nil {
panic(err)
}
if captureFp != nil {
buf := make([]byte, 4)
binary.LittleEndian.PutUint32(buf, uint32(len(data)))
_, err := captureFp.Write(buf)
if err != nil {
panic("dump to capture file (len hdr) fail " + err.Error())
}
_, err = captureFp.Write(data)
if err != nil {
panic("dump to capture file fail " + err.Error())
}
}
if env.OmegaAdaptorHolder != nil {
env.OmegaAdaptorHolder.(*embed.EmbeddedAdaptor).FeedPacket(pk)
continue
Expand All @@ -536,9 +524,6 @@ func runClient(env *environment.PBEnvironment) {
}
return string(marshal)
}
if env.ExternalConnectionHandler != nil {
env.ExternalConnectionHandler.(*external.ExternalConnectionHandler).PacketChannel <- data
}

switch p := pk.(type) {
case *packet.PyRpc:
Expand Down Expand Up @@ -678,8 +663,8 @@ func runClient(env *environment.PBEnvironment) {
if args.ShouldEnableOmegaSystem() {
world_provider.GlobalLRUMemoryChunkCacher.AdjustCacheLevel(7)
}
world_provider.GlobalLRUMemoryChunkCacher.OnNewChunk(world_provider.ChunkPosDefine{p.ChunkX, p.ChunkZ}, p)
world_provider.GlobalChunkFeeder.OnNewChunk(world_provider.ChunkPosDefine{p.ChunkX, p.ChunkZ}, p)
world_provider.GlobalLRUMemoryChunkCacher.OnNewChunk(world_provider.ChunkPosDefine{p.Position[0], p.Position[1]}, p)
world_provider.GlobalChunkFeeder.OnNewChunk(world_provider.ChunkPosDefine{p.Position[0], p.Position[1]}, p)
case *packet.UpdateBlock:
channel, h := commandSender.BlockUpdateSubscribeMap.LoadAndDelete(p.Position)
if h {
Expand Down
22 changes: 0 additions & 22 deletions minecraft/LICENSE

This file was deleted.

2 changes: 0 additions & 2 deletions minecraft/NOTE

This file was deleted.

Loading

0 comments on commit 2c89f58

Please sign in to comment.