add entitytype registry
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
// Code generated by data/registry/generate.go; DO NOT EDIT.
|
||||
|
||||
package blockentitytype
|
||||
|
||||
type BlockEntityType int
|
||||
|
266
data/registry/entitytype/entitytype.go
Normal file
266
data/registry/entitytype/entitytype.go
Normal file
@ -0,0 +1,266 @@
|
||||
// Code generated by data/registry/generate.go; DO NOT EDIT.
|
||||
|
||||
package entitytype
|
||||
|
||||
type EntityType int
|
||||
|
||||
func (n EntityType) String() string {
|
||||
if n < 0 || int(n) >= len(names) {
|
||||
return "<invalid EntityType>"
|
||||
}
|
||||
return names[n]
|
||||
}
|
||||
|
||||
const (
|
||||
Allay EntityType = iota
|
||||
AreaEffectCloud
|
||||
ArmorStand
|
||||
Arrow
|
||||
Axolotl
|
||||
Bat
|
||||
Bee
|
||||
Blaze
|
||||
BlockDisplay
|
||||
Boat
|
||||
Camel
|
||||
Cat
|
||||
CaveSpider
|
||||
ChestBoat
|
||||
ChestMinecart
|
||||
Chicken
|
||||
Cod
|
||||
CommandBlockMinecart
|
||||
Cow
|
||||
Creeper
|
||||
Dolphin
|
||||
Donkey
|
||||
DragonFireball
|
||||
Drowned
|
||||
Egg
|
||||
ElderGuardian
|
||||
EndCrystal
|
||||
EnderDragon
|
||||
EnderPearl
|
||||
Enderman
|
||||
Endermite
|
||||
Evoker
|
||||
EvokerFangs
|
||||
ExperienceBottle
|
||||
ExperienceOrb
|
||||
EyeOfEnder
|
||||
FallingBlock
|
||||
FireworkRocket
|
||||
Fox
|
||||
Frog
|
||||
FurnaceMinecart
|
||||
Ghast
|
||||
Giant
|
||||
GlowItemFrame
|
||||
GlowSquid
|
||||
Goat
|
||||
Guardian
|
||||
Hoglin
|
||||
HopperMinecart
|
||||
Horse
|
||||
Husk
|
||||
Illusioner
|
||||
Interaction
|
||||
IronGolem
|
||||
Item
|
||||
ItemDisplay
|
||||
ItemFrame
|
||||
Fireball
|
||||
LeashKnot
|
||||
LightningBolt
|
||||
Llama
|
||||
LlamaSpit
|
||||
MagmaCube
|
||||
Marker
|
||||
Minecart
|
||||
Mooshroom
|
||||
Mule
|
||||
Ocelot
|
||||
Painting
|
||||
Panda
|
||||
Parrot
|
||||
Phantom
|
||||
Pig
|
||||
Piglin
|
||||
PiglinBrute
|
||||
Pillager
|
||||
PolarBear
|
||||
Potion
|
||||
Pufferfish
|
||||
Rabbit
|
||||
Ravager
|
||||
Salmon
|
||||
Sheep
|
||||
Shulker
|
||||
ShulkerBullet
|
||||
Silverfish
|
||||
Skeleton
|
||||
SkeletonHorse
|
||||
Slime
|
||||
SmallFireball
|
||||
Sniffer
|
||||
SnowGolem
|
||||
Snowball
|
||||
SpawnerMinecart
|
||||
SpectralArrow
|
||||
Spider
|
||||
Squid
|
||||
Stray
|
||||
Strider
|
||||
Tadpole
|
||||
TextDisplay
|
||||
Tnt
|
||||
TntMinecart
|
||||
TraderLlama
|
||||
Trident
|
||||
TropicalFish
|
||||
Turtle
|
||||
Vex
|
||||
Villager
|
||||
Vindicator
|
||||
WanderingTrader
|
||||
Warden
|
||||
Witch
|
||||
Wither
|
||||
WitherSkeleton
|
||||
WitherSkull
|
||||
Wolf
|
||||
Zoglin
|
||||
Zombie
|
||||
ZombieHorse
|
||||
ZombieVillager
|
||||
ZombifiedPiglin
|
||||
Player
|
||||
FishingBobber
|
||||
)
|
||||
|
||||
var names = []string{
|
||||
"minecraft:allay",
|
||||
"minecraft:area_effect_cloud",
|
||||
"minecraft:armor_stand",
|
||||
"minecraft:arrow",
|
||||
"minecraft:axolotl",
|
||||
"minecraft:bat",
|
||||
"minecraft:bee",
|
||||
"minecraft:blaze",
|
||||
"minecraft:block_display",
|
||||
"minecraft:boat",
|
||||
"minecraft:camel",
|
||||
"minecraft:cat",
|
||||
"minecraft:cave_spider",
|
||||
"minecraft:chest_boat",
|
||||
"minecraft:chest_minecart",
|
||||
"minecraft:chicken",
|
||||
"minecraft:cod",
|
||||
"minecraft:command_block_minecart",
|
||||
"minecraft:cow",
|
||||
"minecraft:creeper",
|
||||
"minecraft:dolphin",
|
||||
"minecraft:donkey",
|
||||
"minecraft:dragon_fireball",
|
||||
"minecraft:drowned",
|
||||
"minecraft:egg",
|
||||
"minecraft:elder_guardian",
|
||||
"minecraft:end_crystal",
|
||||
"minecraft:ender_dragon",
|
||||
"minecraft:ender_pearl",
|
||||
"minecraft:enderman",
|
||||
"minecraft:endermite",
|
||||
"minecraft:evoker",
|
||||
"minecraft:evoker_fangs",
|
||||
"minecraft:experience_bottle",
|
||||
"minecraft:experience_orb",
|
||||
"minecraft:eye_of_ender",
|
||||
"minecraft:falling_block",
|
||||
"minecraft:firework_rocket",
|
||||
"minecraft:fox",
|
||||
"minecraft:frog",
|
||||
"minecraft:furnace_minecart",
|
||||
"minecraft:ghast",
|
||||
"minecraft:giant",
|
||||
"minecraft:glow_item_frame",
|
||||
"minecraft:glow_squid",
|
||||
"minecraft:goat",
|
||||
"minecraft:guardian",
|
||||
"minecraft:hoglin",
|
||||
"minecraft:hopper_minecart",
|
||||
"minecraft:horse",
|
||||
"minecraft:husk",
|
||||
"minecraft:illusioner",
|
||||
"minecraft:interaction",
|
||||
"minecraft:iron_golem",
|
||||
"minecraft:item",
|
||||
"minecraft:item_display",
|
||||
"minecraft:item_frame",
|
||||
"minecraft:fireball",
|
||||
"minecraft:leash_knot",
|
||||
"minecraft:lightning_bolt",
|
||||
"minecraft:llama",
|
||||
"minecraft:llama_spit",
|
||||
"minecraft:magma_cube",
|
||||
"minecraft:marker",
|
||||
"minecraft:minecart",
|
||||
"minecraft:mooshroom",
|
||||
"minecraft:mule",
|
||||
"minecraft:ocelot",
|
||||
"minecraft:painting",
|
||||
"minecraft:panda",
|
||||
"minecraft:parrot",
|
||||
"minecraft:phantom",
|
||||
"minecraft:pig",
|
||||
"minecraft:piglin",
|
||||
"minecraft:piglin_brute",
|
||||
"minecraft:pillager",
|
||||
"minecraft:polar_bear",
|
||||
"minecraft:potion",
|
||||
"minecraft:pufferfish",
|
||||
"minecraft:rabbit",
|
||||
"minecraft:ravager",
|
||||
"minecraft:salmon",
|
||||
"minecraft:sheep",
|
||||
"minecraft:shulker",
|
||||
"minecraft:shulker_bullet",
|
||||
"minecraft:silverfish",
|
||||
"minecraft:skeleton",
|
||||
"minecraft:skeleton_horse",
|
||||
"minecraft:slime",
|
||||
"minecraft:small_fireball",
|
||||
"minecraft:sniffer",
|
||||
"minecraft:snow_golem",
|
||||
"minecraft:snowball",
|
||||
"minecraft:spawner_minecart",
|
||||
"minecraft:spectral_arrow",
|
||||
"minecraft:spider",
|
||||
"minecraft:squid",
|
||||
"minecraft:stray",
|
||||
"minecraft:strider",
|
||||
"minecraft:tadpole",
|
||||
"minecraft:text_display",
|
||||
"minecraft:tnt",
|
||||
"minecraft:tnt_minecart",
|
||||
"minecraft:trader_llama",
|
||||
"minecraft:trident",
|
||||
"minecraft:tropical_fish",
|
||||
"minecraft:turtle",
|
||||
"minecraft:vex",
|
||||
"minecraft:villager",
|
||||
"minecraft:vindicator",
|
||||
"minecraft:wandering_trader",
|
||||
"minecraft:warden",
|
||||
"minecraft:witch",
|
||||
"minecraft:wither",
|
||||
"minecraft:wither_skeleton",
|
||||
"minecraft:wither_skull",
|
||||
"minecraft:wolf",
|
||||
"minecraft:zoglin",
|
||||
"minecraft:zombie",
|
||||
"minecraft:zombie_horse",
|
||||
"minecraft:zombie_villager",
|
||||
"minecraft:zombified_piglin",
|
||||
"minecraft:player",
|
||||
"minecraft:fishing_bobber",
|
||||
}
|
@ -7,6 +7,7 @@ import (
|
||||
"go/format"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"text/template"
|
||||
|
||||
"github.com/Tnze/go-mc/internal/generateutils"
|
||||
@ -49,7 +50,11 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
r := registries["minecraft:block_entity_type"]
|
||||
generateRegistry(registries["minecraft:block_entity_type"], "BlockEntityType", "blockentitytype")
|
||||
generateRegistry(registries["minecraft:entity_type"], "EntityType", "entitytype")
|
||||
}
|
||||
|
||||
func generateRegistry(r registry, typeName, packageName string) {
|
||||
entries := make([]string, len(r.Entries))
|
||||
for name, v := range r.Entries {
|
||||
entries[v.ProtocolID] = name
|
||||
@ -57,10 +62,10 @@ func main() {
|
||||
|
||||
var buff bytes.Buffer
|
||||
err := temp.Execute(&buff, tempData{
|
||||
PackageName: "blockentitytype",
|
||||
PackageName: packageName,
|
||||
Default: r.Default,
|
||||
Entries: entries,
|
||||
TypeName: "BlockEntityType",
|
||||
TypeName: typeName,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@ -71,7 +76,7 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
err = os.WriteFile("blockentitytype/blockentitytype.go", formattedSource, 0o666)
|
||||
err = os.WriteFile(filepath.Join(packageName, packageName+".go"), formattedSource, 0o666)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
// Code generated by {{Generator}}; DO NOT EDIT.
|
||||
|
||||
package {{ .PackageName }}
|
||||
|
||||
{{ $typeName := .TypeName}}
|
||||
|
Reference in New Issue
Block a user