Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Merge pull request #1515 from ForceUpdate1/dev_particle_type
Fix area effect cloud
Dieser Commit ist enthalten in:
Commit
ed5702188c
@ -4,7 +4,7 @@ import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.MetaType;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
|
||||
import us.myles.ViaVersion.api.type.types.version.Types1_13;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
@ -24,7 +24,7 @@ public enum MetaType1_13 implements MetaType {
|
||||
OptUUID(12, Type.OPTIONAL_UUID),
|
||||
BlockID(13, Type.VAR_INT),
|
||||
NBTTag(14, Type.NBT),
|
||||
PARTICLE(15, Protocol1_13To1_12_2.PARTICLE_TYPE),
|
||||
PARTICLE(15, Types1_13.PARTICLE),
|
||||
Discontinued(99, null);
|
||||
|
||||
private final int typeID;
|
||||
|
@ -4,7 +4,7 @@ import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.MetaType;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.Protocol1_13_2To1_13_1;
|
||||
import us.myles.ViaVersion.api.type.types.version.Types1_13_2;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
@ -24,7 +24,7 @@ public enum MetaType1_13_2 implements MetaType {
|
||||
OptUUID(12, Type.OPTIONAL_UUID),
|
||||
BlockID(13, Type.VAR_INT),
|
||||
NBTTag(14, Type.NBT),
|
||||
PARTICLE(15, Protocol1_13_2To1_13_1.PARTICLE_TYPE),
|
||||
PARTICLE(15, Types1_13_2.PARTICLE),
|
||||
Discontinued(99, null);
|
||||
|
||||
private final int typeID;
|
||||
|
@ -4,7 +4,7 @@ import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.MetaType;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.Protocol1_13_2To1_13_1;
|
||||
import us.myles.ViaVersion.api.type.types.version.Types1_14;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
@ -24,7 +24,7 @@ public enum MetaType1_14 implements MetaType {
|
||||
OptUUID(12, Type.OPTIONAL_UUID),
|
||||
BlockID(13, Type.VAR_INT),
|
||||
NBTTag(14, Type.NBT),
|
||||
PARTICLE(15, Protocol1_13_2To1_13_1.PARTICLE_TYPE),
|
||||
PARTICLE(15, Types1_14.PARTICLE),
|
||||
VillagerData(16, Type.VILLAGER_DATA),
|
||||
OptVarInt(17, Type.OPTIONAL_VAR_INT),
|
||||
Pose(18, Type.VAR_INT),
|
||||
|
@ -1,4 +1,4 @@
|
||||
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data;
|
||||
package us.myles.ViaVersion.api.type.types;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
@ -0,0 +1,46 @@
|
||||
package us.myles.ViaVersion.api.type.types.minecraft;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
|
||||
public class Particle1_14Type extends Type<Particle> {
|
||||
|
||||
public Particle1_14Type() {
|
||||
super("Particle", Particle.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ByteBuf buffer, Particle object) throws Exception {
|
||||
Type.VAR_INT.write(buffer, object.getId());
|
||||
for (Particle.ParticleData data : object.getArguments())
|
||||
data.getType().write(buffer, data.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle read(ByteBuf buffer) throws Exception {
|
||||
int type = Type.VAR_INT.read(buffer);
|
||||
Particle particle = new Particle(type);
|
||||
|
||||
switch (type) {
|
||||
// Block / Falling Dust /
|
||||
case 3:
|
||||
case 23:
|
||||
particle.getArguments().add(new Particle.ParticleData(Type.VAR_INT, Type.VAR_INT.read(buffer))); // Flat Block
|
||||
break;
|
||||
// Dust
|
||||
case 14:
|
||||
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.read(buffer))); // Red 0 - 1
|
||||
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.read(buffer))); // Green 0 - 1
|
||||
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.read(buffer))); // Blue 0 - 1
|
||||
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, Type.FLOAT.read(buffer)));// Scale 0.01 - 4
|
||||
break;
|
||||
// Item
|
||||
case 32:
|
||||
particle.getArguments().add(new Particle.ParticleData(Type.FLAT_VAR_INT_ITEM, Type.FLAT_VAR_INT_ITEM.read(buffer))); // Flat item
|
||||
break;
|
||||
}
|
||||
return particle;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package us.myles.ViaVersion.api.type.types.version;
|
||||
import us.myles.ViaVersion.api.minecraft.chunks.ChunkSection;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Particle1_13Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -18,4 +20,9 @@ public class Types1_13 {
|
||||
public static final Type<Metadata> METADATA = new Metadata1_13Type();
|
||||
|
||||
public static final Type<ChunkSection> CHUNK_SECTION = new ChunkSectionType1_13();
|
||||
|
||||
/**
|
||||
* Particle type for 1.13
|
||||
*/
|
||||
public static Type<Particle> PARTICLE = new Particle1_13Type();
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package us.myles.ViaVersion.api.type.types.version;
|
||||
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.types.Particle1_13_2Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -15,4 +17,9 @@ public class Types1_13_2 {
|
||||
* Metadata type for 1.13
|
||||
*/
|
||||
public static final Type<Metadata> METADATA = new Metadata1_13_2Type();
|
||||
|
||||
/**
|
||||
* Particle type for 1.13.2
|
||||
*/
|
||||
public static Type<Particle> PARTICLE = new Particle1_13_2Type();
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package us.myles.ViaVersion.api.type.types.version;
|
||||
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
import us.myles.ViaVersion.api.type.types.minecraft.Particle1_14Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -15,4 +17,9 @@ public class Types1_14 {
|
||||
* Metadata type for 1.14
|
||||
*/
|
||||
public static final Type<Metadata> METADATA = new Metadata1_14Type();
|
||||
|
||||
/**
|
||||
* Particle type for 1.14
|
||||
*/
|
||||
public static final Type<Particle> PARTICLE = new Particle1_14Type();
|
||||
}
|
||||
|
@ -11,10 +11,8 @@ import us.myles.ViaVersion.packets.State;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.packets.EntityPackets;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.packets.InventoryPackets;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.packets.WorldPackets;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.types.Particle1_13_2Type;
|
||||
|
||||
public class Protocol1_13_2To1_13_1 extends Protocol {
|
||||
public static final Particle1_13_2Type PARTICLE_TYPE = new Particle1_13_2Type();
|
||||
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
|
@ -2,7 +2,7 @@ package us.myles.ViaVersion.protocols.protocol1_13_2to1_13_1.types;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
|
||||
public class Particle1_13_2Type extends Type<Particle> {
|
||||
public Particle1_13_2Type() {
|
||||
|
@ -6,7 +6,7 @@ import us.myles.ViaVersion.api.entities.Entity1_13Types;
|
||||
import us.myles.ViaVersion.api.minecraft.item.Item;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_13;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.ParticleRewriter;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.WorldPackets;
|
||||
|
@ -32,7 +32,6 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockConnectio
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.BlockStorage;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.EntityTracker;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.TabCompleteTracker;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types.Particle1_13Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2.storage.ClientWorld;
|
||||
import us.myles.ViaVersion.util.GsonUtil;
|
||||
|
||||
@ -41,7 +40,6 @@ import java.util.Map;
|
||||
|
||||
// Development of 1.13 support!
|
||||
public class Protocol1_13To1_12_2 extends Protocol {
|
||||
public static final Particle1_13Type PARTICLE_TYPE = new Particle1_13Type();
|
||||
|
||||
public static final PacketHandler POS_TO_3_INT = new PacketHandler() {
|
||||
@Override
|
||||
|
@ -5,6 +5,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import us.myles.ViaVersion.api.Via;
|
||||
import us.myles.ViaVersion.api.minecraft.item.Item;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.WorldPackets;
|
||||
|
||||
|
@ -19,7 +19,7 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections.Conne
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections.ConnectionHandler;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.NamedSoundRewriter;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.ParticleRewriter;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.BlockEntityProvider;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.providers.PaintingProvider;
|
||||
|
@ -2,7 +2,7 @@ package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.types;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
|
||||
// TODO make future proof
|
||||
public class Particle1_13Type extends Type<Particle> {
|
||||
|
@ -9,7 +9,7 @@ import us.myles.ViaVersion.api.minecraft.item.Item;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.Metadata;
|
||||
import us.myles.ViaVersion.api.minecraft.metadata.types.MetaType1_14;
|
||||
import us.myles.ViaVersion.api.type.Type;
|
||||
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.Particle;
|
||||
import us.myles.ViaVersion.api.type.types.Particle;
|
||||
import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.packets.InventoryPackets;
|
||||
import us.myles.ViaVersion.protocols.protocol1_14to1_13_2.storage.EntityTracker;
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren