Skip to content

Commit fecb5a6

Browse files
committed
chore: [ci skip] write README.md
1 parent 014bf3c commit fecb5a6

File tree

3 files changed

+134
-67
lines changed

3 files changed

+134
-67
lines changed

BANNER.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,32 @@
22

33
![](https://github.com/user-attachments/assets/89e191ba-ed4f-44ab-bb98-634cfe568dca)
44

5+
# BetterModel
6+
*- Modern Bedrock model engine for Bukkit -*
7+
58
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/plugin/bettermodel)
69
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/hangar_vector.svg)](https://hangar.papermc.io/toxicity188/BetterModel)
710
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/github_vector.svg)](https://github.com/toxicity188/BetterModel)
811

912
</div>
1013

11-
# ⚡ What is BetterModel?
1214
* * *
1315
![](https://github.com/user-attachments/assets/5a6c1a8c-6fe2-4a67-a10e-e63e40825d35)
1416
![](https://github.com/user-attachments/assets/ff515577-6a72-48ba-9943-81f00dddb375)
1517
* * *
1618

17-
**BetterModel** is a plugin-based engine that provide runtime BlockBench model rendering & animating for Minecraft Java Edition.
19+
# ⚡ What is BetterModel?
20+
21+
**BetterModel** is a plugin-based engine that provides runtime BlockBench model rendering & animating for Minecraft Java Edition.
1822

19-
It implements **fully server-side 3D model** by using an item display entity packet.
23+
It implements **fully server-side 3D models** by using an item display entity packet.
2024

2125
- Importing Generic BlockBench model `.bbmodel`
2226
- Auto-generating resource pack
2327
- Playing animation
2428
- Syncing with base entity
2529
- Custom hit box
26-
- Supports 12-limb player animation
30+
- 12-limb player animation
2731

2832
## 🔥 Why do I create BetterModel even though ModelEngine already exists?
2933
The main reason I created it is:

README.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,31 @@
1717
![](https://github.com/user-attachments/assets/ff515577-6a72-48ba-9943-81f00dddb375)
1818
* * *
1919

20-
**BetterModel** is a plugin-based engine that provide runtime BlockBench model rendering & animating for Minecraft Java Edition.
20+
# ⚡ Introduction
2121

22-
It implements **fully server-side 3D model** by using an item display entity packet.
22+
**BetterModel** is a plugin-based engine that provides runtime BlockBench model rendering & animating for Minecraft Java Edition.
23+
24+
It implements **fully server-side 3D models** by using an item display entity packet.
2325

2426
- Importing Generic BlockBench model `.bbmodel`
2527
- Auto-generating resource pack
2628
- Playing animation
2729
- Syncing with base entity
2830
- Custom hit box
29-
- Supports 12-limb player animation
31+
- 12-limb player animation
32+
33+
## 🔥 Key Features & Focus
34+
BetterModel aims to be a reliable engine that provides stable, high-quality animations for Paper-based high-traffic servers.
35+
36+
- **Stability First**: We take a conservative approach to feature expansion. By avoiding the implementation of features that are difficult to maintain or have limited use cases, we focus on providing a stable API and ensuring overall operational safety.
37+
- **Performance Optimized**: Our goal is to minimize runtime computation, memory footprint, and network overhead. Through asynchronous design and optimized packet handling, we ensure the engine runs efficiently even under heavy server loads.
38+
- **Tailored for Large-scale Servers**: We provide essential features specifically designed for high-population servers and MMORPG content creation.
39+
- **Per-player Animation**: Individual animation control tailored to each player's perspective.
40+
- **Player Model Animation**: Support for sophisticated 12-limb animations based on player models.
41+
42+
## 📗 Wiki
43+
[![](https://img.shields.io/badge/Github%20Wiki-181717?logo=github&logoColor=white)](https://github.com/toxicity188/BetterModel/wiki)
44+
[![](https://deepwiki.com/badge.svg)](https://deepwiki.com/toxicity188/BetterModel)
3045

3146
## 🔧 Build info
3247

@@ -50,10 +65,6 @@ It implements **fully server-side 3D model** by using an item display entity pac
5065
- [libby](https://github.com/AlessioDP/libby): runtime library downloader
5166

5267

53-
## 📗 Wiki
54-
[![](https://img.shields.io/badge/Github%20Wiki-181717?logo=github&logoColor=white)](https://github.com/toxicity188/BetterModel/wiki)
55-
[![](https://deepwiki.com/badge.svg)](https://deepwiki.com/toxicity188/BetterModel)
56-
5768
## 💻 API
5869

5970
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/maven-central_vector.svg)](https://central.sonatype.com/artifact/io.github.toxicity188/bettermodel)
@@ -92,4 +103,4 @@ dependencies {
92103
## 💖 Support
93104
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/donate/buymeacoffee-singular_vector.svg)](https://buymeacoffee.com/toxicity188)
94105
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/donate/ghsponsors-singular_vector.svg)](https://github.com/sponsors/toxicity188)
95-
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/donate/paypal-singular_vector.svg)](https://www.paypal.com/paypalme/toxicity188?country.x=KR&locale.x=en_US)
106+
[![](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/donate/paypal-singular_vector.svg)](https://www.paypal.com/paypalme/toxicity188?country.x=KR&locale.x=en_US)

api/src/main/java/kr/toxicity/model/api/BetterModel.java

Lines changed: 107 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -22,194 +22,246 @@
2222
import static kr.toxicity.model.api.util.ReflectionUtil.classExists;
2323

2424
/**
25-
* A provider class for BetterModel plugin instance.
25+
* The main entry point for the BetterModel API.
26+
* <p>
27+
* This class provides static access to the plugin instance, configuration, model managers,
28+
* NMS handlers, and entity registries. It serves as a service provider for interacting with the BetterModel engine.
29+
* </p>
30+
*
31+
* @since 1.15.2
2632
*/
2733
public final class BetterModel {
2834

2935
/**
30-
* Private initializer
36+
* Private initializer to prevent instantiation.
3137
*/
3238
private BetterModel() {
3339
throw new RuntimeException();
3440
}
3541

3642
/**
37-
* Check a running platform is Folia.
43+
* Checks if the server is running on the Folia platform.
44+
* @since 1.15.2
3845
*/
3946
public static final boolean IS_FOLIA = classExists("io.papermc.paper.threadedregions.RegionizedServer");
4047
/**
41-
* Check a running platform is Purpur.
48+
* Checks if the server is running on the Purpur platform.
49+
* @since 1.15.2
4250
*/
4351
public static final boolean IS_PURPUR = classExists("org.purpurmc.purpur.PurpurConfig");
4452
/**
45-
* Check a running platform is Paper.
53+
* Checks if the server is running on the Paper platform (or a fork like Purpur/Folia).
54+
* @since 1.15.2
4655
*/
4756
public static final boolean IS_PAPER = IS_PURPUR || IS_FOLIA || classExists("io.papermc.paper.configuration.PaperConfigurations");
4857

4958
/**
50-
* Plugin instance.
59+
* The singleton plugin instance.
5160
*/
5261
private static BetterModelPlugin instance;
5362

5463
/**
55-
* Gets config manager
56-
* @return config
64+
* Returns the plugin configuration manager.
65+
*
66+
* @return the configuration manager
67+
* @since 1.15.2
5768
*/
5869
public static @NotNull BetterModelConfig config() {
5970
return plugin().config();
6071
}
6172

6273
/**
63-
* Gets model renderer by name
64-
* @param name name
65-
* @return optional renderer
74+
* Retrieves a model renderer by its name, wrapped in an Optional.
75+
*
76+
* @param name the name of the model
77+
* @return an optional containing the renderer if found
78+
* @since 1.15.2
6679
*/
6780
public static @NotNull Optional<ModelRenderer> model(@NotNull String name) {
6881
return Optional.ofNullable(modelOrNull(name));
6982
}
7083

7184
/**
72-
* Gets model renderer or null by name
73-
* @param name name
74-
* @return nullable renderer
85+
* Retrieves a model renderer by its name, or null if not found.
86+
*
87+
* @param name the name of the model
88+
* @return the renderer, or null
89+
* @since 1.15.2
7590
*/
7691
public static @Nullable ModelRenderer modelOrNull(@NotNull String name) {
7792
return plugin().modelManager().model(name);
7893
}
7994

8095
/**
81-
* Gets player animation renderer by name
82-
* @param name name
83-
* @return optional renderer
96+
* Retrieves a player limb renderer by its name, wrapped in an Optional.
97+
*
98+
* @param name the name of the limb model
99+
* @return an optional containing the renderer if found
100+
* @since 1.15.2
84101
*/
85102
public static @NotNull Optional<ModelRenderer> limb(@NotNull String name) {
86103
return Optional.ofNullable(limbOrNull(name));
87104
}
88105

89106
/**
90-
* Gets player animation renderer or null by name
91-
* @param name name
92-
* @return nullable renderer
107+
* Retrieves a player limb renderer by its name, or null if not found.
108+
*
109+
* @param name the name of the limb model
110+
* @return the renderer, or null
111+
* @since 1.15.2
93112
*/
94113
public static @Nullable ModelRenderer limbOrNull(@NotNull String name) {
95114
return plugin().modelManager().limb(name);
96115
}
97116

98117
/**
99-
* Gets player channel by uuid.
100-
* @param uuid uuid
101-
* @return optional channel
118+
* Retrieves a player channel handler by the player's UUID.
119+
*
120+
* @param uuid the player's UUID
121+
* @return an optional containing the channel handler if found
122+
* @since 1.15.2
102123
*/
103124
public static @NotNull Optional<PlayerChannelHandler> player(@NotNull UUID uuid) {
104125
return Optional.ofNullable(plugin().playerManager().player(uuid));
105126
}
106127

107128
/**
108-
* Gets entity registry by entity's uuid.
109-
* @param uuid uuid
110-
* @return optional registry
129+
* Retrieves an entity tracker registry by the entity's UUID.
130+
*
131+
* @param uuid the entity's UUID
132+
* @return an optional containing the registry if found
133+
* @since 1.15.2
111134
*/
112135
public static @NotNull Optional<EntityTrackerRegistry> registry(@NotNull UUID uuid) {
113136
return Optional.ofNullable(registryOrNull(uuid));
114137
}
115138

116139
/**
117-
* Gets entity registry by entity.
118-
* @param entity entity
119-
* @return optional registry
140+
* Retrieves an entity tracker registry for a Bukkit entity.
141+
*
142+
* @param entity the Bukkit entity
143+
* @return an optional containing the registry if found
144+
* @since 1.15.2
120145
*/
121146
public static @NotNull Optional<EntityTrackerRegistry> registry(@NotNull Entity entity) {
122147
return Optional.ofNullable(registryOrNull(entity));
123148
}
124149

125150
/**
126-
* Gets entity registry by entity.
127-
* @param entity entity
128-
* @return optional registry
151+
* Retrieves an entity tracker registry for a base entity.
152+
*
153+
* @param entity the base entity
154+
* @return an optional containing the registry if found
155+
* @since 1.15.2
129156
*/
130157
public static @NotNull Optional<EntityTrackerRegistry> registry(@NotNull BaseEntity entity) {
131158
return Optional.ofNullable(registryOrNull(entity));
132159
}
133160

134161
/**
135-
* Gets entity registry by entity's uuid.
136-
* @param uuid uuid
137-
* @return registry or null
162+
* Retrieves an entity tracker registry by the entity's UUID, or null if not found.
163+
*
164+
* @param uuid the entity's UUID
165+
* @return the registry, or null
166+
* @since 1.15.2
138167
*/
139168
public static @Nullable EntityTrackerRegistry registryOrNull(@NotNull UUID uuid) {
140169
return EntityTrackerRegistry.registry(uuid);
141170
}
142171

143172
/**
144-
* Gets entity registry by entity.
145-
* @param entity entity
146-
* @return registry or null
173+
* Retrieves an entity tracker registry for a Bukkit entity, or null if not found.
174+
*
175+
* @param entity the Bukkit entity
176+
* @return the registry, or null
177+
* @since 1.15.2
147178
*/
148179
public static @Nullable EntityTrackerRegistry registryOrNull(@NotNull Entity entity) {
149180
return registryOrNull(nms().adapt(entity));
150181
}
151182

152183
/**
153-
* Gets entity registry by entity.
154-
* @param entity entity
155-
* @return registry or null
184+
* Retrieves an entity tracker registry for a base entity, or null if not found.
185+
*
186+
* @param entity the base entity
187+
* @return the registry, or null
188+
* @since 1.15.2
156189
*/
157190
public static @Nullable EntityTrackerRegistry registryOrNull(@NotNull BaseEntity entity) {
158191
return EntityTrackerRegistry.registry(entity);
159192
}
160193

161194
/**
162-
* Gets all models
163-
* @return all models
195+
* Returns a collection of all loaded model renderers.
196+
*
197+
* @return an unmodifiable collection of models
198+
* @since 1.15.2
164199
*/
165200
public static @NotNull @Unmodifiable Collection<ModelRenderer> models() {
166201
return plugin().modelManager().models();
167202
}
168203

169204
/**
170-
* Gets all limbs
171-
* @return all limbs
205+
* Returns a collection of all loaded player limb renderers.
206+
*
207+
* @return an unmodifiable collection of limb models
208+
* @since 1.15.2
172209
*/
173210
public static @NotNull @Unmodifiable Collection<ModelRenderer> limbs() {
174211
return plugin().modelManager().limbs();
175212
}
176213

177214
/**
178-
* Gets all keys of model
179-
* @return all model keys
215+
* Returns a set of all loaded model names.
216+
*
217+
* @return an unmodifiable set of model keys
218+
* @since 1.15.2
180219
*/
181220
public static @NotNull @Unmodifiable Set<String> modelKeys() {
182221
return plugin().modelManager().modelKeys();
183222
}
184223

185224
/**
186-
* Gets all keys of limb
187-
* @return all limb keys
225+
* Returns a set of all loaded player limb model names.
226+
*
227+
* @return an unmodifiable set of limb keys
228+
* @since 1.15.2
188229
*/
189230
public static @NotNull @Unmodifiable Set<String> limbKeys() {
190231
return plugin().modelManager().limbKeys();
191232
}
192233

193234
/**
194-
* Gets plugin instance of BetterModel.
235+
* Returns the singleton instance of the BetterModel plugin.
236+
*
237+
* @return the plugin instance
238+
* @throws NullPointerException if the plugin has not been initialized
195239
* @see org.bukkit.plugin.java.JavaPlugin
196-
* @return instance
240+
* @since 1.15.2
197241
*/
198242
public static @NotNull BetterModelPlugin plugin() {
199243
return Objects.requireNonNull(instance, "BetterModel hasn't been initialized yet!");
200244
}
201245

202246
/**
203-
* Gets nms
204-
* @return nms
247+
* Returns the NMS handler instance.
248+
*
249+
* @return the NMS handler
250+
* @since 1.15.2
205251
*/
206252
public static @NotNull NMS nms() {
207253
return plugin().nms();
208254
}
209255

210256
/**
211-
* Sets plugin instance of BetterModel.
212-
* @param instance instance
257+
* Registers the plugin instance.
258+
* <p>
259+
* This method is intended for internal use only during plugin initialization.
260+
* </p>
261+
*
262+
* @param instance the plugin instance
263+
* @throws RuntimeException if an instance is already registered
264+
* @since 1.15.2
213265
*/
214266
@ApiStatus.Internal
215267
public static void register(@NotNull BetterModelPlugin instance) {

0 commit comments

Comments
 (0)