Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 00:50:13 +01:00
Add block marker id to ParticleMappings
Dieser Commit ist enthalten in:
Ursprung
02bf9501a9
Commit
2f28b25af3
@ -29,6 +29,7 @@ public class ParticleMappings {
|
|||||||
private final Mappings mappings;
|
private final Mappings mappings;
|
||||||
private final int blockId;
|
private final int blockId;
|
||||||
private final int fallingDustId;
|
private final int fallingDustId;
|
||||||
|
private final int blockMarkerId;
|
||||||
private final int itemId;
|
private final int itemId;
|
||||||
|
|
||||||
public ParticleMappings(JsonArray oldMappings, Mappings mappings) {
|
public ParticleMappings(JsonArray oldMappings, Mappings mappings) {
|
||||||
@ -37,6 +38,7 @@ public class ParticleMappings {
|
|||||||
Object2IntMap<String> map = MappingDataLoader.arrayToMap(oldMappings);
|
Object2IntMap<String> map = MappingDataLoader.arrayToMap(oldMappings);
|
||||||
blockId = map.getInt("block");
|
blockId = map.getInt("block");
|
||||||
fallingDustId = map.getInt("falling_dust");
|
fallingDustId = map.getInt("falling_dust");
|
||||||
|
blockMarkerId = map.getInt("block_marker");
|
||||||
itemId = map.getInt("item");
|
itemId = map.getInt("item");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +54,10 @@ public class ParticleMappings {
|
|||||||
return fallingDustId;
|
return fallingDustId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getBlockmarkerid() {
|
||||||
|
return blockMarkerId;
|
||||||
|
}
|
||||||
|
|
||||||
public int getItemId() {
|
public int getItemId() {
|
||||||
return itemId;
|
return itemId;
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,8 @@ public abstract class EntityRewriter<T extends Protocol> extends RewriterBase<T>
|
|||||||
protected void rewriteParticle(Particle particle) {
|
protected void rewriteParticle(Particle particle) {
|
||||||
ParticleMappings mappings = protocol.getMappingData().getParticleMappings();
|
ParticleMappings mappings = protocol.getMappingData().getParticleMappings();
|
||||||
int id = particle.getId();
|
int id = particle.getId();
|
||||||
if (id == mappings.getBlockId() || id == mappings.getFallingDustId()) {
|
if (id == mappings.getBlockId() || id == mappings.getFallingDustId()
|
||||||
|
|| (mappings.getBlockmarkerid() != -1 && id == mappings.getBlockmarkerid())) {
|
||||||
Particle.ParticleData data = particle.getArguments().get(0);
|
Particle.ParticleData data = particle.getArguments().get(0);
|
||||||
data.setValue(protocol.getMappingData().getNewBlockStateId(data.get()));
|
data.setValue(protocol.getMappingData().getNewBlockStateId(data.get()));
|
||||||
} else if (id == mappings.getItemId()) {
|
} else if (id == mappings.getItemId()) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren