Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 15:50:10 +01:00
Readd flare
Issues were addressed in 2.0.0
Dieser Commit ist enthalten in:
Ursprung
7e3a157fcf
Commit
dbe8b6551a
@ -13,6 +13,8 @@ dependencies {
|
||||
targetConfiguration = "shadow"
|
||||
}
|
||||
api(libs.fastutil)
|
||||
api(libs.flare)
|
||||
api(libs.flareFastutil)
|
||||
api(libs.openNBT)
|
||||
api(libs.gson)
|
||||
|
||||
|
@ -28,6 +28,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import java.util.BitSet;
|
||||
import java.util.List;
|
||||
|
||||
// TODO specialized sub interfaces
|
||||
public interface Chunk {
|
||||
|
||||
/**
|
||||
|
@ -474,7 +474,7 @@ public abstract class AbstractProtocol<C1 extends ClientboundPacketType, C2 exte
|
||||
|
||||
/**
|
||||
* Returns the unmapped packet type, or null if mapped over ids.
|
||||
* This is NOT the same as calling {@link #getOldId()} (think of unmapped vs. old in 1.17->1.16).
|
||||
* This is NOT the same as calling {@link #getOldId()} (think of unmapped vs. old in 1.17→1.16).
|
||||
*
|
||||
* @return unmapped packet type, or null if mapped over ids
|
||||
*/
|
||||
@ -485,7 +485,7 @@ public abstract class AbstractProtocol<C1 extends ClientboundPacketType, C2 exte
|
||||
|
||||
/**
|
||||
* Returns the mapped packet type, or null if mapped over ids or mapped to no packet type.
|
||||
* This is NOT the same as calling {@link #getNewId()} (think of mapped vs. new in 1.17->1.16).
|
||||
* This is NOT the same as calling {@link #getNewId()} (think of mapped vs. new in 1.17→1.16).
|
||||
*
|
||||
* @return new packet type, or null if mapped over ids or mapped to no packet type
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ fun ShadowJar.configureRelocations() {
|
||||
relocate("com.google.gson", "com.viaversion.viaversion.libs.gson")
|
||||
relocate("com.github.steveice10.opennbt", "com.viaversion.viaversion.libs.opennbt")
|
||||
relocate("it.unimi.dsi.fastutil", "com.viaversion.viaversion.libs.fastutil")
|
||||
relocate("space.vectrix.flare", "com.viaversion.viaversion.libs.flare")
|
||||
}
|
||||
|
||||
fun ShadowJar.configureExcludes() {
|
||||
@ -52,4 +53,9 @@ fun ShadowJar.configureExcludes() {
|
||||
exclude("it/unimi/dsi/fastutil/*/*Synchronized*")
|
||||
exclude("it/unimi/dsi/fastutil/*/*Unmodifiable*")
|
||||
exclude("it/unimi/dsi/fastutil/io/*")
|
||||
// Flare - only need int maps
|
||||
exclude("space/vectrix/flare/fastutil/*Double*")
|
||||
exclude("space/vectrix/flare/fastutil/*Float*")
|
||||
exclude("space/vectrix/flare/fastutil/*Long*")
|
||||
exclude("space/vectrix/flare/fastutil/*Short*")
|
||||
}
|
||||
|
@ -24,14 +24,13 @@ import com.viaversion.viaversion.api.data.entity.ClientEntityIdChangeListener;
|
||||
import com.viaversion.viaversion.api.data.entity.EntityTracker;
|
||||
import com.viaversion.viaversion.api.data.entity.StoredEntityData;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import space.vectrix.flare.fastutil.Int2ObjectSyncMap;
|
||||
|
||||
public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeListener {
|
||||
private final Map<Integer, EntityType> entityTypes = new ConcurrentHashMap<>();
|
||||
private final Map<Integer, StoredEntityData> entityData;
|
||||
private final Int2ObjectMap<EntityType> entityTypes = Int2ObjectSyncMap.hashmap();
|
||||
private final Int2ObjectMap<StoredEntityData> entityData;
|
||||
private final UserConnection connection;
|
||||
private final EntityType playerType;
|
||||
private int clientEntityId = -1;
|
||||
@ -46,7 +45,7 @@ public class EntityTrackerBase implements EntityTracker, ClientEntityIdChangeLis
|
||||
public EntityTrackerBase(UserConnection connection, @Nullable EntityType playerType, boolean storesEntityData) {
|
||||
this.connection = connection;
|
||||
this.playerType = playerType;
|
||||
this.entityData = storesEntityData ? new ConcurrentHashMap<>() : null;
|
||||
this.entityData = storesEntityData ? Int2ObjectSyncMap.hashmap() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,15 +17,14 @@
|
||||
*/
|
||||
package com.viaversion.viaversion.protocols.protocol1_11to1_10.storage;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_11Types.EntityType;
|
||||
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
|
||||
|
||||
import java.util.Set;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import space.vectrix.flare.fastutil.Int2ObjectSyncMap;
|
||||
|
||||
public class EntityTracker1_11 extends EntityTrackerBase {
|
||||
private final Set<Integer> holograms = Sets.newConcurrentHashSet();
|
||||
private final IntSet holograms = Int2ObjectSyncMap.hashset();
|
||||
|
||||
public EntityTracker1_11(UserConnection user) {
|
||||
super(user, EntityType.PLAYER);
|
||||
|
@ -21,6 +21,7 @@ import com.viaversion.viaversion.api.connection.StorableObject;
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import space.vectrix.flare.SyncMap;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -28,7 +29,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
// TODO Fix memory leak lolz (only a smol one tho)
|
||||
public class BlockStorage implements StorableObject {
|
||||
private static final IntSet WHITELIST = new IntOpenHashSet(46, .99F);
|
||||
private final Map<Position, ReplacementData> blocks = new ConcurrentHashMap<>();
|
||||
private final Map<Position, ReplacementData> blocks = SyncMap.hashmap();
|
||||
|
||||
static {
|
||||
// Flower pots
|
||||
|
@ -20,15 +20,14 @@ package com.viaversion.viaversion.protocols.protocol1_14to1_13_2.storage;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_14Types;
|
||||
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import space.vectrix.flare.fastutil.Int2ObjectSyncMap;
|
||||
|
||||
public class EntityTracker1_14 extends EntityTrackerBase {
|
||||
private final Map<Integer, Byte> insentientData = new ConcurrentHashMap<>();
|
||||
private final Int2ObjectMap<Byte> insentientData = Int2ObjectSyncMap.hashmap();
|
||||
// 0x1 = sleeping, 0x2 = riptide
|
||||
private final Map<Integer, Byte> sleepingAndRiptideData = new ConcurrentHashMap<>();
|
||||
private final Map<Integer, Byte> playerEntityFlags = new ConcurrentHashMap<>();
|
||||
private final Int2ObjectMap<Byte> sleepingAndRiptideData = Int2ObjectSyncMap.hashmap();
|
||||
private final Int2ObjectMap<Byte> playerEntityFlags = Int2ObjectSyncMap.hashmap();
|
||||
private int latestTradeWindowId;
|
||||
private boolean forceSendCenterChunk = true;
|
||||
private int chunkCenterX, chunkCenterZ;
|
||||
|
@ -18,7 +18,6 @@
|
||||
package com.viaversion.viaversion.protocols.protocol1_9to1_8.storage;
|
||||
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.legacy.bossbar.BossBar;
|
||||
@ -40,25 +39,22 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.chat.GameMode;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.metadata.MetadataRewriter1_9To1_8;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.BossBarProvider;
|
||||
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.EntityIdProvider;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
import space.vectrix.flare.fastutil.Int2ObjectSyncMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class EntityTracker1_9 extends EntityTrackerBase {
|
||||
public static final String WITHER_TRANSLATABLE = "{\"translate\":\"entity.WitherBoss.name\"}";
|
||||
public static final String DRAGON_TRANSLATABLE = "{\"translate\":\"entity.EnderDragon.name\"}";
|
||||
private final Map<Integer, UUID> uuidMap = new ConcurrentHashMap<>();
|
||||
private final Map<Integer, List<Metadata>> metadataBuffer = new ConcurrentHashMap<>();
|
||||
private final Map<Integer, Integer> vehicleMap = new ConcurrentHashMap<>();
|
||||
private final Map<Integer, BossBar> bossBarMap = new ConcurrentHashMap<>();
|
||||
private final Set<Integer> validBlocking = Sets.newConcurrentHashSet();
|
||||
private final Set<Integer> knownHolograms = Sets.newConcurrentHashSet();
|
||||
private final Int2ObjectMap<UUID> uuidMap = Int2ObjectSyncMap.hashmap();
|
||||
private final Int2ObjectMap<List<Metadata>> metadataBuffer = Int2ObjectSyncMap.hashmap();
|
||||
private final Int2ObjectMap<Integer> vehicleMap = Int2ObjectSyncMap.hashmap();
|
||||
private final Int2ObjectMap<BossBar> bossBarMap = Int2ObjectSyncMap.hashmap();
|
||||
private final IntSet validBlocking = Int2ObjectSyncMap.hashset();
|
||||
private final Set<Integer> knownHolograms = Int2ObjectSyncMap.hashset();
|
||||
private final Set<Position> blockInteractions = Collections.newSetFromMap(CacheBuilder.newBuilder()
|
||||
.maximumSize(1000)
|
||||
.expireAfterAccess(250, TimeUnit.MILLISECONDS)
|
||||
|
@ -5,6 +5,7 @@ metadata.format.version = "1.1"
|
||||
adventure = "4.9.1"
|
||||
gson = "2.8.8"
|
||||
fastutil = "8.5.6"
|
||||
flare = "2.0.0"
|
||||
openNBT = "2.0-SNAPSHOT"
|
||||
javassist = "3.28.0-GA"
|
||||
|
||||
@ -34,6 +35,8 @@ adventureTextSerializerLegacy = { group = "net.kyori", name = "adventure-text-se
|
||||
|
||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
|
||||
flare = { group = "space.vectrix.flare", name = "flare", version.ref = "flare" }
|
||||
flareFastutil = { group = "space.vectrix.flare", name = "flare-fastutil", version.ref = "flare" }
|
||||
openNBT = { group = "com.viaversion", name = "opennbt", version.ref = "openNBT" }
|
||||
javassist = { group = "org.javassist", name = "javassist", version.ref = "javassist" }
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren