Skip to content

Commit

Permalink
Merge branch 'master' into feature/custom-blocks
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
#	server/world/mcdb/leveldat/data.go
  • Loading branch information
TwistedAsylumMC committed Dec 9, 2023
2 parents 17073c1 + 2b7130d commit 79f1c57
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 32 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ require (
github.com/cespare/xxhash v1.1.0
github.com/df-mc/atomic v1.10.0
github.com/df-mc/goleveldb v1.1.9
github.com/df-mc/worldupgrader v1.0.10
github.com/df-mc/worldupgrader v1.0.11
github.com/go-gl/mathgl v1.0.0
github.com/google/uuid v1.3.0
github.com/pelletier/go-toml v1.9.5
github.com/rogpeppe/go-internal v1.9.0
github.com/sandertv/gophertunnel v1.33.0
github.com/sandertv/gophertunnel v1.34.0
github.com/segmentio/fasthash v1.0.3
github.com/sirupsen/logrus v1.9.0
go.uber.org/atomic v1.10.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ github.com/df-mc/atomic v1.10.0 h1:0ZuxBKwR/hxcFGorKiHIp+hY7hgY+XBTzhCYD2NqSEg=
github.com/df-mc/atomic v1.10.0/go.mod h1:Gw9rf+rPIbydMjA329Jn4yjd/O2c/qusw3iNp4tFGSc=
github.com/df-mc/goleveldb v1.1.9 h1:ihdosZyy5jkQKrxucTQmN90jq/2lUwQnJZjIYIC/9YU=
github.com/df-mc/goleveldb v1.1.9/go.mod h1:+NHCup03Sci5q84APIA21z3iPZCuk6m6ABtg4nANCSk=
github.com/df-mc/worldupgrader v1.0.10 h1:zR0GyIRmt89SpZU/AO3XplklXyuVMisqtHL4X+1NxO0=
github.com/df-mc/worldupgrader v1.0.10/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk=
github.com/df-mc/worldupgrader v1.0.11 h1:7dlebxDXY8QND3MnDPnty7qeAqtxJE8kVqvs6VDs1YI=
github.com/df-mc/worldupgrader v1.0.11/go.mod h1:tsSOLTRm9mpG7VHvYpAjjZrkRHWmSbKZAm9bOLNnlDk=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-gl/mathgl v1.0.0 h1:t9DznWJlXxxjeeKLIdovCOVJQk/GzDEL7h/h+Ro2B68=
github.com/go-gl/mathgl v1.0.0/go.mod h1:yhpkQzEiH9yPyxDUGzkmgScbaBVlhC06qodikEM0ZwQ=
Expand Down Expand Up @@ -49,8 +49,8 @@ github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZV
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/sandertv/go-raknet v1.12.0 h1:olUzZlIJyX/pgj/mrsLCZYjKLNDsYiWdvQ4NIm3z0DA=
github.com/sandertv/go-raknet v1.12.0/go.mod h1:Gx+WgZBMQ0V2UoouGoJ8Wj6CDrMBQ4SB2F/ggpl5/+Y=
github.com/sandertv/gophertunnel v1.33.0 h1:agNDZVSvy14DXEXnADUe408bG/9teYfPPnPwHipwe58=
github.com/sandertv/gophertunnel v1.33.0/go.mod h1:+Dbhj3bs74gZoSkyab7kglx1Rbq8S5G7sJd/wr5Qm9g=
github.com/sandertv/gophertunnel v1.34.0 h1:fHXTPL4+hUJFF5xObM9T07GpXkTdSvKmYAvx65k0IAw=
github.com/sandertv/gophertunnel v1.34.0/go.mod h1:+Dbhj3bs74gZoSkyab7kglx1Rbq8S5G7sJd/wr5Qm9g=
github.com/segmentio/fasthash v1.0.3 h1:EI9+KE1EwvMLBWwjpRDc+fEM+prwxDYbslddQGtrmhM=
github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
Expand Down
14 changes: 2 additions & 12 deletions server/block/planks.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,12 @@ func (Planks) FuelInfo() item.FuelInfo {

// EncodeItem ...
func (p Planks) EncodeItem() (name string, meta int16) {
switch p.Wood {
case OakWood(), SpruceWood(), BirchWood(), JungleWood(), AcaciaWood(), DarkOakWood():
return "minecraft:planks", int16(p.Wood.Uint8())
default:
return "minecraft:" + p.Wood.String() + "_planks", 0
}
return "minecraft:" + p.Wood.String() + "_planks", 0
}

// EncodeBlock ...
func (p Planks) EncodeBlock() (name string, properties map[string]any) {
switch p.Wood {
case OakWood(), SpruceWood(), BirchWood(), JungleWood(), AcaciaWood(), DarkOakWood():
return "minecraft:planks", map[string]any{"wood_type": p.Wood.String()}
default:
return "minecraft:" + p.Wood.String() + "_planks", nil
}
return "minecraft:" + p.Wood.String() + "_planks", nil
}

// allPlanks returns all planks types.
Expand Down
26 changes: 13 additions & 13 deletions server/block/stone.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,53 +73,53 @@ func (s Stone) EncodeBlock() (string, map[string]any) {
if s.Smooth {
return "minecraft:smooth_stone", nil
}
return "minecraft:stone", map[string]any{"stone_type": "stone"}
return "minecraft:stone", nil
}

// EncodeItem ...
func (a Andesite) EncodeItem() (name string, meta int16) {
if a.Polished {
return "minecraft:stone", 6
return "minecraft:polished_andesite", 0
}
return "minecraft:stone", 5
return "minecraft:andesite", 0
}

// EncodeBlock ...
func (a Andesite) EncodeBlock() (string, map[string]any) {
if a.Polished {
return "minecraft:stone", map[string]any{"stone_type": "andesite_smooth"}
return "minecraft:polished_andesite", nil
}
return "minecraft:stone", map[string]any{"stone_type": "andesite"}
return "minecraft:andesite", nil
}

// EncodeItem ...
func (d Diorite) EncodeItem() (name string, meta int16) {
if d.Polished {
return "minecraft:stone", 4
return "minecraft:polished_diorite", 0
}
return "minecraft:stone", 3
return "minecraft:diorite", 0
}

// EncodeBlock ...
func (d Diorite) EncodeBlock() (string, map[string]any) {
if d.Polished {
return "minecraft:stone", map[string]any{"stone_type": "diorite_smooth"}
return "minecraft:polished_diorite", nil
}
return "minecraft:stone", map[string]any{"stone_type": "diorite"}
return "minecraft:diorite", nil
}

// EncodeItem ...
func (g Granite) EncodeItem() (name string, meta int16) {
if g.Polished {
return "minecraft:stone", 2
return "minecraft:polished_granite", 0
}
return "minecraft:stone", 1
return "minecraft:granite", 0
}

// EncodeBlock ...
func (g Granite) EncodeBlock() (string, map[string]any) {
if g.Polished {
return "minecraft:stone", map[string]any{"stone_type": "granite_smooth"}
return "minecraft:polished_granite", nil
}
return "minecraft:stone", map[string]any{"stone_type": "granite"}
return "minecraft:granite", nil
}
Binary file modified server/item/creative/creative_items.nbt
Binary file not shown.
1 change: 0 additions & 1 deletion server/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,6 @@ func (s *Session) registerHandlers() {
packet.IDClientCacheBlobStatus: &ClientCacheBlobStatusHandler{},
packet.IDCommandRequest: &CommandRequestHandler{},
packet.IDContainerClose: &ContainerCloseHandler{},
packet.IDCraftingEvent: nil,
packet.IDEmote: &EmoteHandler{},
packet.IDEmoteList: nil,
packet.IDFilterText: nil,
Expand Down
Binary file modified server/world/block_states.nbt
Binary file not shown.
Binary file modified server/world/item_runtime_ids.nbt
Binary file not shown.
2 changes: 2 additions & 0 deletions server/world/mcdb/leveldat/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ type Data struct {
PlayersSleepingPercentage int32 `nbt:"playerssleepingpercentage"`
RecipesUnlock bool `nbt:"recipesunlock"`
NaturalGeneration bool `nbt:"naturalgeneration"`
ProjectilesCanBreakBlocks bool `nbt:"projectilescanbreakblocks"`
ShowRecipeMessages bool `nbt:"showrecipemessages"`
}

// FillDefault fills out d with all the default level.dat values.
Expand Down

0 comments on commit 79f1c57

Please sign in to comment.