Skip to content

Commit

Permalink
block/sandstone.go: Fix invalid sandstone variant item ids
Browse files Browse the repository at this point in the history
Blame Seb!
  • Loading branch information
DaPigGuy committed Nov 16, 2024
1 parent dbfbed6 commit 43645da
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions server/block/sandstone.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ func (s Sandstone) BreakInfo() BreakInfo {

// EncodeItem ...
func (s Sandstone) EncodeItem() (name string, meta int16) {
var prefix string
if s.Type != NormalSandstone() {
prefix = s.Type.String() + "_"
}
if s.Red {
return "minecraft:red_sandstone", int16(s.Type.Uint8())
return "minecraft:" + prefix + "red_sandstone", 0
}
return "minecraft:sandstone", int16(s.Type.Uint8())
return "minecraft:" + prefix + "sandstone", 0
}

// EncodeBlock ...
Expand All @@ -40,11 +44,10 @@ func (s Sandstone) EncodeBlock() (string, map[string]any) {
if s.Type != NormalSandstone() {
prefix = s.Type.String() + "_"
}
suffix := "sandstone"
if s.Red {
suffix = "red_sandstone"
return "minecraft:" + prefix + "red_sandstone", nil
}
return "minecraft:" + prefix + suffix, nil
return "minecraft:" + prefix + "sandstone", nil
}

// SmeltInfo ...
Expand Down

0 comments on commit 43645da

Please sign in to comment.