Skip to content
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

Merged
merged 16 commits into from Apr 29, 2024

Conversation

xNatsuri
Copy link
Contributor

Co-authored-by: Flonja

Everything works properly but the smithing recipes are still missing
would like some help generating the smithing_data.nbt file.

@xNatsuri xNatsuri changed the title Armor Trims Smithing templates + Table and Armour Trims Apr 13, 2024
server/item/armour_trim.go Outdated Show resolved Hide resolved
server/item/armour_trim.go Outdated Show resolved Hide resolved
server/item/armour_trim.go Outdated Show resolved Hide resolved
server/item/register.go Outdated Show resolved Hide resolved
server/item/stack.go Outdated Show resolved Hide resolved
server/session/player.go Outdated Show resolved Hide resolved
server/item/armour_trim.go Outdated Show resolved Hide resolved
server/item/armour_trim.go Outdated Show resolved Hide resolved
server/item/template_type.go Outdated Show resolved Hide resolved
server/item/template_type.go Outdated Show resolved Hide resolved
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var trimPatters []protocol.TrimPattern
var trimPatterns []protocol.TrimPattern

@@ -111,6 +112,16 @@ func writeEnchantments(m map[string]any, s item.Stack) {
}
}

// writeArmourTrim writes the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

writes the ...?

server/item/recipe/recipe.go Show resolved Hide resolved
return ArmourSmithingTemplate{7}
}

// TemplateShaper returns the Raiser Template.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TemplateShaper returns the Raiser Template.
// TemplateShaper returns the Shaper Template.

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.
Copy link
Member

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

Comment on lines 56 to 57
// 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.
Copy link
Member

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

@@ -0,0 +1,16 @@
package item

// SmithingTemplate is an item used in smithing tables to alter tools and armor.
Copy link
Member

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"

@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ArmourTrim" instead of "ArmorTrim"

Comment on lines 58 to 59
// ArmourTrim returns the ArmourTrim.
// if this returns false it does not have an armor trim, or it is not an armour
Copy link
Member

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."

@@ -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
Copy link
Member

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

@TwistedAsylumMC TwistedAsylumMC merged commit 97fdfe2 into df-mc:master Apr 29, 2024
1 check passed
@TwistedAsylumMC
Copy link
Member

Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants