Skip to content

Commit

Permalink
did item stufff
Browse files Browse the repository at this point in the history
  • Loading branch information
NedHuman committed Aug 10, 2024
1 parent ce5d31f commit e841c15
Show file tree
Hide file tree
Showing 43 changed files with 83 additions and 291 deletions.
2 changes: 1 addition & 1 deletion server/world/level/item/banner_patterns.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package item

type BannerPattern struct {
Color string `nbt:"color"`
Pattern string `nbt:"pattern"`
Pattern any `nbt:"pattern"`
}
5 changes: 0 additions & 5 deletions server/world/level/item/block_entity_data.go

This file was deleted.

6 changes: 0 additions & 6 deletions server/world/level/item/block_state.go

This file was deleted.

4 changes: 2 additions & 2 deletions server/world/level/item/bucket_entity_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type BucketEntityData struct {
Invulnerable bool `nbt:"Invulnerable"`
Health float32 `nbt:"Health"`
Age int32 `nbt:"Age"`
Variant string `nbt:"Variant"`
HuntingCooldown int32 `nbt:"HuntingCooldown"`
Variant int32 `nbt:"Variant"`
HuntingCooldown int64 `nbt:"HuntingCooldown"`
BucketVariantTag int32 `nbt:"BucketVariantTag"`
}
7 changes: 0 additions & 7 deletions server/world/level/item/bundle_contents.go

This file was deleted.

18 changes: 0 additions & 18 deletions server/world/level/item/can_break.go

This file was deleted.

16 changes: 16 additions & 0 deletions server/world/level/item/can_do.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package item

// Both CanBreak and CanPlace have the same contents so im using the same class
type CanDo struct {
ShowInTooltip bool `nbt:"show_in_tooltip"`
State any `nbt:"state"` // Have to put any cause theres an infinite amount of key value pairs there could be
Blocks any `nbt:"blocks"` //Can be string, or list
NBT string `nbt:"nbt"`
Predicates []Predicates `nbt:"predicates"`
}

type Predicates struct {
State any `nbt:"state"`
Blocks any `nbt:"blocks"`
NBT string `nbt:"nbt"`
}
7 changes: 0 additions & 7 deletions server/world/level/item/charged_projectiles.go

This file was deleted.

11 changes: 0 additions & 11 deletions server/world/level/item/container.go

This file was deleted.

2 changes: 1 addition & 1 deletion server/world/level/item/container_loot.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package item

type ContainerLoot struct {
LootTable string `nbt:"loot_table"`
Seed int32 `nbt:"seed"`
Seed int64 `nbt:"seed"`
}
5 changes: 0 additions & 5 deletions server/world/level/item/custom_data.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/custom_model_data.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/custom_name.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/damage.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/debug_stick_state.go

This file was deleted.

6 changes: 0 additions & 6 deletions server/world/level/item/dyed_color.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/enchantment_glint_override.go

This file was deleted.

5 changes: 1 addition & 4 deletions server/world/level/item/enchantments.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@ package item

type Enchantments struct {
ShowInTooltip bool `nbt:"show_in_tooltip"`
}

type Levels struct {
EnchantmentID int32 `nbt:"enchantment_id"` // ????????
Levels any `nbt:"levels"`
}
4 changes: 3 additions & 1 deletion server/world/level/item/entity_data.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package item

import "github.com/zeppelinmc/zeppelin/server/entity"

type EntityData struct {
Data int32 `nbt:"entity_data"` // NBT
EntityData entity.LevelEntity `nbt:"minecraft:entity_data"` // NBT
}
5 changes: 3 additions & 2 deletions server/world/level/item/fireworks.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package item

type Fireworks struct {
FlightDuration byte `nbt:"flight_duration"`
FlightDuration int8 `nbt:"flight_duration"`
Explosions []Explosion `nbt:"explosions"`
}

type Explosions *struct {
type Explosion struct {
Shape string `nbt:"shape"`
Colors []int32 `nbt:"colors"`
FadeColors []int32 `nbt:"fade_colors"`
Expand Down
31 changes: 16 additions & 15 deletions server/world/level/item/food.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package item

type Food struct {
Nutrition int32 `nbt:"nutrition"`
Saturation float32 `nbt:"saturation"`
CanAlwaysEat bool `nbt:"can_always_eat"`
EatSeconds float32 `nbt:"eat_seconds"`
Nutrition int32 `nbt:"nutrition"`
Saturation float32 `nbt:"saturation"`
CanAlwaysEat bool `nbt:"can_always_eat"`
EatSeconds float32 `nbt:"eat_seconds"`
UsingConvertsTo Item `nbt:"using_converts_to"`
Effects []Effect `nbt:"effects"`
}

type UsingConvertsTo struct {
ID string `nbt:"id"`
// components TAG ????
type Effects struct {
Effect Effect `nbt:"effect"`
Probability float32 `nbt:"probability"`
}

type Effect *struct {
ID string `nbt:"id"`
Amplifier byte `nbt:"amplifier"`
Duration int32 `nbt:"duration"`
Ambient bool `nbt:"ambient"`
ShowParticles bool `nbt:"show_particles"`
ShowIcon bool `nbt:"show_icon"`
Probability float32 `nbt:"probability"`
type Effect struct {
ID string `nbt:"id"`
Amplifier int8 `nbt:"amplifier"`
Duration int32 `nbt:"duration"`
Ambient bool `nbt:"ambient"`
ShowParticles bool `nbt:"show_particles"`
ShowIcon bool `nbt:"show_icon"`
}
12 changes: 0 additions & 12 deletions server/world/level/item/instrument.go

This file was deleted.

67 changes: 34 additions & 33 deletions server/world/level/item/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,53 +61,54 @@ type Item struct {
Id string `nbt:"id"`
// Components of this item (https://minecraft.wiki/w/Data_component_format#List_of_components)
Components struct{} `nbt:"components"` /*struct {
AttributeModifiers AttributeModifiers `nbt:"minecraft:attribute_modifiers"`
AttributeModifiers any `nbt:"minecraft:attribute_modifiers"`
BannerPatterns []BannerPattern `nbt:"minecraft:banner_patterns"`
BaseColor string `nbt:"minecraft:base_color"`
Bees []Bee `nbt:"minecraft:bees"`
BlockEntityData BlockEntityData `nbt:"minecraft:block_entity_data"`
BlockState BlockState `nbt:"minecraft:block_state"`
BlockEntityData any `nbt:"minecraft:block_entity_data"`
BlockState any `nbt:"minecraft:block_state"`
BucketEntityData BucketEntityData `nbt:"minecraft:bucket_entity_data"`
BundleContents []BundleContent `nbt:"minecraft_bundle_contents"`
CanBreak CanBreak `nbt:"minecraft:can_break"`
ChargedProjectiles []ChargedProjectile `nbt:"minecraft:charged_projectiles"`
Container []Container `nbt:"minecraft:container"`
BundleContents []Item `nbt:"minecraft_bundle_contents"`
CanBreak CanDo `nbt:"minecraft:can_break"`
CanPlaceOn CanDo `nbt:"minecraft:can_place_on"`
ChargedProjectiles []Item `nbt:"minecraft:charged_projectiles"`
Container []Item `nbt:"minecraft:container"`
ContainerLoot ContainerLoot `nbt:"minecraft_container_loot"`
CustomData CustomData `nbt:"minecraft:custom_data"`
CustomModelData CustomModelData `nbt:"minecraft:custom_model_data"`
CustomName CustomName `nbt:"minecraft:custom_name"`
Damage Damage `nbt:"minecraft:damage"`
DebugStickState DebugStickState `nbt:"minecraft:debug_stick_state"`
DyedColor DyedColor `nbt:"minecraft:dyed_color"`
EnchantmentGlintOverride EnchantmentGlintOverride `nbt:"minecraft:enchantment_glint_override"`
CustomData any `nbt:"minecraft:custom_data"`
CustomModelData int32 `nbt:"minecraft:custom_model_data"`
CustomName string `nbt:"minecraft:custom_name"`
Damage int32 `nbt:"minecraft:damage"`
DebugStickState any `nbt:"minecraft:debug_stick_state"`
DyedColor any `nbt:"minecraft:dyed_color"`
EnchantmentGlintOverride bool `nbt:"minecraft:enchantment_glint_override"`
Enchantments Enchantments `nbt:"minecraft:enchantments"`
EntityData EntityData `nbt:"minecraft:entity_data"`
EntityData entity.LevelEntity `nbt:"minecraft:entity_data"`
FireResistant FireResistant `nbt:"minecraft:fire_resistant"`
FireworkExplosion FireworkExplosion `nbt:"minecraft:firework_explosion"`
Fireworks Fireworks `nbt:"minecraft:fireworks"`
Food Food `nbt:"minecraft:food"`
HideAdditionalTooltip HideAdditionalTooltip `nbt:"minecraft:hide_additional_tooltip"`
HideTooltip HideTooltip `nbt:"minecraft:hide_tooltip"`
Instrument Instrument `nbt:"minecraft:instrument"`
Instrument any `nbt:"minecraft:instrument"`
IntangibleProjectile IntangibleProjectile `nbt:"minecraft:intangible_projectile"`
ItemName ItemName `nbt:"minecraft:item_name"`
ItemName string `nbt:"minecraft:item_name"`
JukeboxPlayable JukeboxPlayable `nbt:"minecraft:jukebox_playable"`
Lock Lock `nbt:"minecraft:lock"`
Lock string `nbt:"minecraft:lock"`
LodestoneTracker LodestoneTracker `nbt:"minecraft:lodestone_tracker"`
Lore []Lore `nbt:"minecraft:lore"`
MapColor MapColor `nbt:"minecraft:map_color"`
MapDecorations MapDecorations `nbt:"minecraft:map_decorations"`
MapID MapID `nbt:"minecraft:map_id"`
MaxDamage MaxDamage `nbt:"minecraft:max_damage"`
MaxStackSize MaxStackSize `nbt:"minecraft:max_stack_size"`
NoteBlockSound NoteBlockSound `nbt:"minecraft:note_block_sound"`
OminousBottleAmplifier OminousBottleAmplifier `nbt:"minecraft:ominous_bottle_amplifier"`
PotDecorations []PotDecoration `nbt:"minecraft:pot_decorations"`
PotionContents PotionContents `nbt:"minecraft:potion_contents"`
Profile Profile `nbt:"minecraft:profile"`
Rarity Rarity `nbt:"minecraft:rarity"`
Recipes []Recipe `nbt:"minecraft:recipes"`
RepairCost RepairCost `nbt:"minecraft:repair_cost"`
Lore []string `nbt:"minecraft:lore"`
MapColor int32 `nbt:"minecraft:map_color"`
MapDecorations any `nbt:"minecraft:map_decorations"`
MapID int32 `nbt:"minecraft:map_id"`
MaxDamage int32 `nbt:"minecraft:max_damage"`
MaxStackSize int32 `nbt:"minecraft:max_stack_size"`
NoteBlockSound string `nbt:"minecraft:note_block_sound"`
OminousBottleAmplifier int32 `nbt:"minecraft:ominous_bottle_amplifier"`
PotDecorations []string `nbt:"minecraft:pot_decorations"`
PotionContents any `nbt:"minecraft:potion_contents"`
Profile any `nbt:"minecraft:profile"`
Rarity string `nbt:"minecraft:rarity"`
Recipes []string `nbt:"minecraft:recipes"`
RepairCost int32 `nbt:"minecraft:repair_cost"`
StoredEnchantments StoredEnchantments `nbt:"minecraft:stored_enchantments"`
SuspiciousStewEffects []SuspiciousStewEffect `nbt:"minecraft:suspicious_stew_effects"`
Tool Tool `nbt:"minecraft:tool"`
Expand All @@ -116,7 +117,7 @@ type Item struct {
WritableBookContent WritableBookContent `nbt:"minecraft:writable_book_content"`
WrittenBookContent WrittenBookContent `nbt:"minecraft:written_book_content"`
CreativeSlotLock CreativeSlotLock `nbt:"minecraft:creative_slot_lock"`
MapPostProcessing MapPostProcessing `nbt:"minecraft:map_post_processing"`
MapPostProcessing int32 `nbt:"minecraft:map_post_processing"`
} `nbt:"components"`*/
}

Expand Down
5 changes: 0 additions & 5 deletions server/world/level/item/item_name.go

This file was deleted.

7 changes: 0 additions & 7 deletions server/world/level/item/lock.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/lore.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/map_color.go

This file was deleted.

8 changes: 0 additions & 8 deletions server/world/level/item/map_decorations.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/map_id.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/max_damage.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/max_stack_size.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/note_block_sound.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/ominous_bottle_amplifier.go

This file was deleted.

5 changes: 0 additions & 5 deletions server/world/level/item/pot_decorations.go

This file was deleted.

Loading

0 comments on commit e841c15

Please sign in to comment.