-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add item DataComponent implements (part 4)
- Loading branch information
Showing
17 changed files
with
519 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/nbt/dynbt" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*BlockEntityData)(nil) | ||
|
||
type BlockEntityData struct { | ||
dynbt.Value | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (BlockEntityData) ID() string { | ||
return "minecraft:block_entity_data" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (b *BlockEntityData) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&b.Value).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (b *BlockEntityData) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&b.Value).WriteTo(w) | ||
} | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/nbt/dynbt" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*BlockEntityData)(nil) | ||
|
||
type BlockEntityData struct { | ||
dynbt.Value | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (BlockEntityData) ID() string { | ||
return "minecraft:block_entity_data" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (b *BlockEntityData) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&b.Value).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (b *BlockEntityData) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&b.Value).WriteTo(w) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/nbt/dynbt" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*BucketEntityData)(nil) | ||
|
||
type BucketEntityData struct { | ||
dynbt.Value | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (BucketEntityData) ID() string { | ||
return "minecraft:bucket_entity_data" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (b *BucketEntityData) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&b.Value).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (b *BucketEntityData) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&b.Value).WriteTo(w) | ||
} | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/nbt/dynbt" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*BucketEntityData)(nil) | ||
|
||
type BucketEntityData struct { | ||
dynbt.Value | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (BucketEntityData) ID() string { | ||
return "minecraft:bucket_entity_data" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (b *BucketEntityData) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&b.Value).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (b *BucketEntityData) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&b.Value).WriteTo(w) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package component | ||
|
||
import "io" | ||
|
||
var _ DataComponent = (*BundleContents)(nil) | ||
|
||
type BundleContents struct { | ||
// TODO | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (BundleContents) ID() string { | ||
return "minecraft:bundle_contents" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (b *BundleContents) ReadFrom(r io.Reader) (n int64, err error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (b *BundleContents) WriteTo(w io.Writer) (n int64, err error) { | ||
panic("unimplemented") | ||
} | ||
package component | ||
|
||
import "io" | ||
|
||
var _ DataComponent = (*BundleContents)(nil) | ||
|
||
type BundleContents struct { | ||
// TODO | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (BundleContents) ID() string { | ||
return "minecraft:bundle_contents" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (b *BundleContents) ReadFrom(r io.Reader) (n int64, err error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (b *BundleContents) WriteTo(w io.Writer) (n int64, err error) { | ||
panic("unimplemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package component | ||
|
||
import "io" | ||
|
||
var _ DataComponent = (*ChargedProjectiles)(nil) | ||
|
||
type ChargedProjectiles struct { | ||
// TODO | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (ChargedProjectiles) ID() string { | ||
return "minecraft:charged_projectiles" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (c *ChargedProjectiles) ReadFrom(r io.Reader) (n int64, err error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (c *ChargedProjectiles) WriteTo(w io.Writer) (n int64, err error) { | ||
panic("unimplemented") | ||
} | ||
package component | ||
|
||
import "io" | ||
|
||
var _ DataComponent = (*ChargedProjectiles)(nil) | ||
|
||
type ChargedProjectiles struct { | ||
// TODO | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (ChargedProjectiles) ID() string { | ||
return "minecraft:charged_projectiles" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (c *ChargedProjectiles) ReadFrom(r io.Reader) (n int64, err error) { | ||
panic("unimplemented") | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (c *ChargedProjectiles) WriteTo(w io.Writer) (n int64, err error) { | ||
panic("unimplemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/level/block" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*DebugStickState)(nil) | ||
|
||
type DebugStickState struct { | ||
Data block.State | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (DebugStickState) ID() string { | ||
return "minecraft:debug_stick_state" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (d *DebugStickState) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&d.Data).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (d *DebugStickState) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&d.Data).WriteTo(w) | ||
} | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/level/block" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*DebugStickState)(nil) | ||
|
||
type DebugStickState struct { | ||
Data block.State | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (DebugStickState) ID() string { | ||
return "minecraft:debug_stick_state" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (d *DebugStickState) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&d.Data).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (d *DebugStickState) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&d.Data).WriteTo(w) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/nbt/dynbt" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*EntityData)(nil) | ||
|
||
type EntityData struct { | ||
dynbt.Value | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (EntityData) ID() string { | ||
return "minecraft:entity_data" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (e *EntityData) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&e.Value).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (e *EntityData) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&e.Value).WriteTo(w) | ||
} | ||
package component | ||
|
||
import ( | ||
"io" | ||
|
||
"github.com/Tnze/go-mc/nbt/dynbt" | ||
pk "github.com/Tnze/go-mc/net/packet" | ||
) | ||
|
||
var _ DataComponent = (*EntityData)(nil) | ||
|
||
type EntityData struct { | ||
dynbt.Value | ||
} | ||
|
||
// ID implements DataComponent. | ||
func (EntityData) ID() string { | ||
return "minecraft:entity_data" | ||
} | ||
|
||
// ReadFrom implements DataComponent. | ||
func (e *EntityData) ReadFrom(r io.Reader) (n int64, err error) { | ||
return pk.NBT(&e.Value).ReadFrom(r) | ||
} | ||
|
||
// WriteTo implements DataComponent. | ||
func (e *EntityData) WriteTo(w io.Writer) (n int64, err error) { | ||
return pk.NBT(&e.Value).WriteTo(w) | ||
} |
Oops, something went wrong.