-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smithing templates + Table and Armour Trims #861
Conversation
server/session/player.go
Outdated
@@ -135,6 +135,34 @@ func (s *Session) sendRecipes() { | |||
s.writePacket(&packet.CraftingData{Recipes: recipes, ClearRecipes: true}) | |||
} | |||
|
|||
// sendArmourTrimData sends the armour trim data. | |||
func (s *Session) sendArmourTrimData() { | |||
var trimPatters []protocol.TrimPattern |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var trimPatters []protocol.TrimPattern | |
var trimPatterns []protocol.TrimPattern |
server/internal/nbtconv/write.go
Outdated
@@ -111,6 +112,16 @@ func writeEnchantments(m map[string]any, s item.Stack) { | |||
} | |||
} | |||
|
|||
// writeArmourTrim writes the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writes the ...?
return ArmourSmithingTemplate{7} | ||
} | ||
|
||
// TemplateShaper returns the Raiser Template. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TemplateShaper returns the Raiser Template. | |
// TemplateShaper returns the Shaper Template. |
server/item/armour_trim.go
Outdated
type ArmourTrimMaterial interface { | ||
// TrimMaterial returns the material name used for reading and writing trim data. | ||
TrimMaterial() string | ||
// MaterialColour returns the color code used for internal text formatting. Use text.Colourf for proper formatting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change "color" to "colour", can probably remove the text.Colourf
reference now we return the constant
server/item/recipe/recipe.go
Outdated
// in the parameters. If the block given a crafting table, the recipe can also be crafted in the 2x2 crafting grid in | ||
// the player's inventory. This is almost identical to SmithingTransform except there is no output item. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing about the crafting grid here
server/item/smithing_template.go
Outdated
@@ -0,0 +1,16 @@ | |||
package item | |||
|
|||
// SmithingTemplate is an item used in smithing tables to alter tools and armor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use "armour" instead of "armor"
server/item/stack.go
Outdated
@@ -42,6 +44,26 @@ func NewStack(t world.Item, count int) Stack { | |||
return Stack{item: t, count: count, id: newID()} | |||
} | |||
|
|||
// WithArmourTrim returns a new stack with the ArmorTrim passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"ArmourTrim" instead of "ArmorTrim"
server/item/stack.go
Outdated
// ArmourTrim returns the ArmourTrim. | ||
// if this returns false it does not have an armor trim, or it is not an armour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar could be better here, maybe "ArmourTrim returns the ArmourTrim and true if present, otherwise false is returned."
server/session/handler_smithing.go
Outdated
@@ -11,6 +11,8 @@ const ( | |||
smithingInputSlot = 0x33 | |||
// smithingMaterialSlot is the slot index of the material in the smithing table. | |||
smithingMaterialSlot = 0x34 | |||
// smithingTemplateSlot is the slot index of the template item in the smithing table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
End with a "." for proper punctuation
# Conflicts: # go.mod # go.sum # server/item/recipe/vanilla.go
Thank you for the contribution! |
Co-authored-by: Flonja
Everything works properly but the smithing recipes are still missing
would like some help generating the smithing_data.nbt file.