Skip to content

Commit fb387bf

Browse files
committed
Add missing particle readers
1 parent a3ff540 commit fb387bf

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

api/src/main/java/com/viaversion/viaversion/api/minecraft/entitydata/types/AbstractEntityDataTypes.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public EntityDataType[] values() {
4444
}
4545

4646
protected EntityDataType add(final int typeId, final Type<?> type) {
47+
if (values[typeId] != null) {
48+
throw new IllegalArgumentException("Entity data type ID " + typeId + " is already registered as " + values[typeId]);
49+
}
50+
4751
final EntityDataType dataType = EntityDataType.create(typeId, type);
4852
values[typeId] = dataType;
4953
return dataType;

common/src/main/java/com/viaversion/viaversion/protocols/template/Protocol1_98To1_99.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected void onMappingDataLoaded() {
125125

126126
// Uncomment if a new particle was added = ids shifted; requires a new Types_ class copied from the last
127127
/*mappedTypes().particle.filler(this)
128-
.reader("block", ParticleType.Readers.BLOCK)
128+
.reader("block", ParticleType.Readers.BLOCK)
129129
.reader("block_marker", ParticleType.Readers.BLOCK)
130130
.reader("dust_pillar", ParticleType.Readers.BLOCK)
131131
.reader("falling_dust", ParticleType.Readers.BLOCK)
@@ -138,6 +138,10 @@ protected void onMappingDataLoaded() {
138138
.reader("entity_effect", ParticleType.Readers.COLOR)
139139
.reader("tinted_leaves", ParticleType.Readers.COLOR)
140140
.reader("trail", ParticleType.Readers.TRAIL1_21_4)
141+
.reader("dragon_breath", ParticleType.Readers.POWER)
142+
.reader("effect", ParticleType.Readers.SPELL)
143+
.reader("instant_effect", ParticleType.Readers.SPELL)
144+
.reader("flash", ParticleType.Readers.COLOR)
141145
.reader("item", ParticleType.Readers.item(itemRewriter.mappedItemType()));*/
142146

143147
super.onMappingDataLoaded(); // Calls load methods on rewriters. Last in case the rewriters access the above filled data

common/src/main/java/com/viaversion/viaversion/protocols/v1_21_9to1_21_11/Protocol1_21_9To1_21_11.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ protected void onMappingDataLoaded() {
208208
.reader("entity_effect", ParticleType.Readers.COLOR)
209209
.reader("tinted_leaves", ParticleType.Readers.COLOR)
210210
.reader("trail", ParticleType.Readers.TRAIL1_21_4)
211+
.reader("dragon_breath", ParticleType.Readers.POWER)
212+
.reader("effect", ParticleType.Readers.SPELL)
213+
.reader("instant_effect", ParticleType.Readers.SPELL)
214+
.reader("flash", ParticleType.Readers.COLOR)
211215
.reader("item", ParticleType.Readers.item(itemRewriter.mappedItemType()));
212216
mappedTypes().structuredData.filler(this).add(StructuredDataKey.CUSTOM_DATA, StructuredDataKey.MAX_STACK_SIZE, StructuredDataKey.MAX_DAMAGE,
213217
StructuredDataKey.UNBREAKABLE1_21_5, StructuredDataKey.RARITY, StructuredDataKey.TOOLTIP_DISPLAY, StructuredDataKey.DAMAGE_RESISTANT,

0 commit comments

Comments
 (0)