mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-20 16:37:48 +01:00
Update data class names to indicate target version (#749)
This commit is contained in:
parent
f949fd658a
commit
dd4ab8082e
@ -20,7 +20,7 @@ package com.viaversion.viabackwards.protocol.v1_11to1_10.data;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntMap;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntOpenHashMap;
|
||||
|
||||
public class SplashPotions1_10 {
|
||||
public class SplashPotionMappings1_10 {
|
||||
|
||||
private static final Int2IntMap DATA = new Int2IntOpenHashMap(14, 0.99F);
|
||||
|
@ -37,7 +37,7 @@ import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_9_3;
|
||||
import com.viaversion.nbt.tag.CompoundTag;
|
||||
import com.viaversion.nbt.tag.StringTag;
|
||||
import com.viaversion.viaversion.protocols.v1_10to1_11.data.EntityNames1_11;
|
||||
import com.viaversion.viaversion.protocols.v1_10to1_11.data.EntityMappings1_11;
|
||||
import com.viaversion.viaversion.protocols.v1_9_1to1_9_3.packet.ClientboundPackets1_9_3;
|
||||
import com.viaversion.viaversion.protocols.v1_9_1to1_9_3.packet.ServerboundPackets1_9_3;
|
||||
import com.viaversion.viaversion.util.IdAndData;
|
||||
@ -209,7 +209,7 @@ public class BlockItemPacketRewriter1_11 extends LegacyBlockItemRewriter<Clientb
|
||||
// Handler Spawners
|
||||
if (wrapper.get(Types.UNSIGNED_BYTE, 0) == 1) {
|
||||
CompoundTag tag = wrapper.get(Types.NAMED_COMPOUND_TAG, 0);
|
||||
EntityNames1_11.toClientSpawner(tag, true);
|
||||
EntityMappings1_11.toClientSpawner(tag, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -280,7 +280,7 @@ public class BlockItemPacketRewriter1_11 extends LegacyBlockItemRewriter<Clientb
|
||||
// Handle spawner block entity (map to itself with custom handler)
|
||||
MappedLegacyBlockItem data = itemReplacements.computeIfAbsent(IdAndData.toRawData(52), s -> new MappedLegacyBlockItem(52));
|
||||
data.setBlockEntityHandler((b, tag) -> {
|
||||
EntityNames1_11.toClientSpawner(tag, true);
|
||||
EntityMappings1_11.toClientSpawner(tag, true);
|
||||
return tag;
|
||||
});
|
||||
|
||||
@ -300,7 +300,7 @@ public class BlockItemPacketRewriter1_11 extends LegacyBlockItemRewriter<Clientb
|
||||
if (tag == null) return item;
|
||||
|
||||
// Rewrite spawn eggs (id checks are done in the method itself)
|
||||
EntityNames1_11.toClientItem(item, true);
|
||||
EntityMappings1_11.toClientItem(item, true);
|
||||
|
||||
enchantmentRewriter.handleToClient(item);
|
||||
return item;
|
||||
@ -315,7 +315,7 @@ public class BlockItemPacketRewriter1_11 extends LegacyBlockItemRewriter<Clientb
|
||||
if (tag == null) return item;
|
||||
|
||||
// Rewrite spawn eggs (id checks are done in the method itself)
|
||||
EntityNames1_11.toServerItem(item, true);
|
||||
EntityMappings1_11.toServerItem(item, true);
|
||||
|
||||
enchantmentRewriter.handleToServer(item);
|
||||
return item;
|
||||
|
@ -21,7 +21,7 @@ package com.viaversion.viabackwards.protocol.v1_11to1_10.rewriter;
|
||||
import com.viaversion.viabackwards.api.entities.storage.WrappedMetadata;
|
||||
import com.viaversion.viabackwards.api.rewriters.LegacyEntityRewriter;
|
||||
import com.viaversion.viabackwards.protocol.v1_11to1_10.Protocol1_11To1_10;
|
||||
import com.viaversion.viabackwards.protocol.v1_11to1_10.data.SplashPotions1_10;
|
||||
import com.viaversion.viabackwards.protocol.v1_11to1_10.data.SplashPotionMappings1_10;
|
||||
import com.viaversion.viabackwards.protocol.v1_11to1_10.storage.ChestedHorseStorage;
|
||||
import com.viaversion.viaversion.api.data.entity.StoredEntityData;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||
@ -56,7 +56,7 @@ public class EntityPacketRewriter1_11 extends LegacyEntityRewriter<ClientboundPa
|
||||
wrapper.set(Types.INT, 0, 2002);
|
||||
}
|
||||
|
||||
int mappedData = SplashPotions1_10.getOldData(wrapper.get(Types.INT, 1));
|
||||
int mappedData = SplashPotionMappings1_10.getOldData(wrapper.get(Types.INT, 1));
|
||||
if (mappedData != -1) {
|
||||
wrapper.set(Types.INT, 1, mappedData);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ package com.viaversion.viabackwards.protocol.v1_12to1_11_1.data;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntMap;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntOpenHashMap;
|
||||
|
||||
public class MapColors1_11_1 {
|
||||
public class MapColorMappings1_11_1 {
|
||||
private static final Int2IntMap MAPPING = new Int2IntOpenHashMap(64, 0.99F);
|
||||
|
||||
static {
|
@ -20,7 +20,7 @@ package com.viaversion.viabackwards.protocol.v1_12to1_11_1.rewriter;
|
||||
|
||||
import com.viaversion.viabackwards.api.rewriters.LegacyBlockItemRewriter;
|
||||
import com.viaversion.viabackwards.protocol.v1_12to1_11_1.Protocol1_12To1_11_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_12to1_11_1.data.MapColors1_11_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_12to1_11_1.data.MapColorMappings1_11_1;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.ClientWorld;
|
||||
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
|
||||
@ -74,7 +74,7 @@ public class BlockItemPacketRewriter1_12 extends LegacyBlockItemRewriter<Clientb
|
||||
for (int i = 0; i < data.length; i++) {
|
||||
short color = (short) (data[i] & 0xFF);
|
||||
if (color > 143) {
|
||||
color = (short) MapColors1_11_1.getNearestOldColor(color);
|
||||
color = (short) MapColorMappings1_11_1.getNearestOldColor(color);
|
||||
data[i] = (byte) color;
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import com.viaversion.viabackwards.ViaBackwards;
|
||||
import com.viaversion.viabackwards.api.BackwardsProtocol;
|
||||
import com.viaversion.viabackwards.api.data.BackwardsMappingData;
|
||||
import com.viaversion.viabackwards.api.rewriters.TranslatableRewriter;
|
||||
import com.viaversion.viabackwards.protocol.v1_13_1to1_13.data.CommandRewriter1_13_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_13_1to1_13.rewriter.CommandRewriter1_13_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_13_1to1_13.rewriter.EntityPacketRewriter1_13_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_13_1to1_13.rewriter.ItemPacketRewriter1_13_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_13_1to1_13.rewriter.WorldPacketRewriter1_13_1;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.v1_13_1to1_13.data;
|
||||
package com.viaversion.viabackwards.protocol.v1_13_1to1_13.rewriter;
|
||||
|
||||
import com.viaversion.viabackwards.protocol.v1_13_1to1_13.Protocol1_13_1To1_13;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
@ -22,7 +22,7 @@ import com.viaversion.viabackwards.ViaBackwards;
|
||||
import com.viaversion.viabackwards.api.BackwardsProtocol;
|
||||
import com.viaversion.viabackwards.api.rewriters.TranslatableRewriter;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.BackwardsMappingData1_13;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.PaintingMapping;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.PaintingNames1_13;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.provider.BackwardsBlockEntityProvider;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.rewriter.BlockItemPacketRewriter1_13;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.rewriter.EntityPacketRewriter1_13;
|
||||
@ -83,7 +83,7 @@ public class Protocol1_13To1_12_2 extends BackwardsProtocol<ClientboundPackets1_
|
||||
protected void registerPackets() {
|
||||
executeAsyncAfterLoaded(Protocol1_12_2To1_13.class, () -> {
|
||||
MAPPINGS.load();
|
||||
PaintingMapping.init();
|
||||
PaintingNames1_13.init();
|
||||
Via.getManager().getProviders().register(BackwardsBlockEntityProvider.class, new BackwardsBlockEntityProvider());
|
||||
});
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
package com.viaversion.viabackwards.protocol.v1_13to1_12_2.block_entity_handlers;
|
||||
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.EntityNames1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.EntityNameMappings1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.provider.BackwardsBlockEntityProvider;
|
||||
import com.viaversion.nbt.tag.CompoundTag;
|
||||
import com.viaversion.nbt.tag.StringTag;
|
||||
@ -31,7 +31,7 @@ public class SpawnerHandler implements BackwardsBlockEntityProvider.BackwardsBlo
|
||||
if (dataTag != null) {
|
||||
StringTag idTag = dataTag.getStringTag("id");
|
||||
if (idTag != null) {
|
||||
idTag.setValue(EntityNames1_12_2.rewrite(idTag.getValue()));
|
||||
idTag.setValue(EntityNameMappings1_12_2.rewrite(idTag.getValue()));
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
|
@ -23,7 +23,7 @@ import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import com.viaversion.nbt.tag.CompoundTag;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.Protocol1_12_2To1_13;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.StatisticMappings;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.StatisticMappings1_13;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -39,7 +39,7 @@ public class BackwardsMappingData1_13 extends BackwardsMappingData {
|
||||
public void loadExtras(final CompoundTag data) {
|
||||
super.loadExtras(data);
|
||||
|
||||
for (Map.Entry<String, Integer> entry : StatisticMappings.CUSTOM_STATS.entrySet()) {
|
||||
for (Map.Entry<String, Integer> entry : StatisticMappings1_13.CUSTOM_STATS.entrySet()) {
|
||||
statisticMappings.put(entry.getValue().intValue(), entry.getKey());
|
||||
}
|
||||
for (Map.Entry<String, String> entry : Protocol1_12_2To1_13.MAPPINGS.getTranslateMapping().entrySet()) {
|
||||
|
@ -19,15 +19,15 @@ package com.viaversion.viabackwards.protocol.v1_13to1_12_2.data;
|
||||
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntMap;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntOpenHashMap;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.EntityTypeRewriter;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.EntityIdMappings1_13;
|
||||
|
||||
public class EntityTypeMapping {
|
||||
public class EntityIdMappings1_12_2 {
|
||||
private static final Int2IntMap TYPES = new Int2IntOpenHashMap();
|
||||
|
||||
static {
|
||||
TYPES.defaultReturnValue(-1);
|
||||
for (Int2IntMap.Entry entry : EntityTypeRewriter.getEntityTypes().int2IntEntrySet()) {
|
||||
EntityTypeMapping.TYPES.put(entry.getIntValue(), entry.getIntKey());
|
||||
for (Int2IntMap.Entry entry : EntityIdMappings1_13.getEntityTypes().int2IntEntrySet()) {
|
||||
EntityIdMappings1_12_2.TYPES.put(entry.getIntValue(), entry.getIntKey());
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class EntityNames1_12_2 {
|
||||
public class EntityNameMappings1_12_2 {
|
||||
private static final Map<String, String> ENTITY_NAMES = new HashMap<>();
|
||||
|
||||
static {
|
@ -17,21 +17,21 @@
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.v1_13to1_12_2.data;
|
||||
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.NamedSoundRewriter;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.NamedSoundMappings1_13;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class NamedSoundMapping {
|
||||
public class NamedSoundMappings1_12_2 {
|
||||
private static final Map<String, String> SOUNDS = new HashMap<>();
|
||||
|
||||
static {
|
||||
try {
|
||||
Field field = NamedSoundRewriter.class.getDeclaredField("oldToNew");
|
||||
Field field = NamedSoundMappings1_13.class.getDeclaredField("oldToNew");
|
||||
field.setAccessible(true);
|
||||
Map<String, String> sounds = (Map<String, String>) field.get(null);
|
||||
sounds.forEach((sound1_12, sound1_13) -> NamedSoundMapping.SOUNDS.put(sound1_13, sound1_12));
|
||||
sounds.forEach((sound1_12, sound1_13) -> NamedSoundMappings1_12_2.SOUNDS.put(sound1_13, sound1_12));
|
||||
} catch (NoSuchFieldException | IllegalAccessException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
@ -20,7 +20,7 @@ package com.viaversion.viabackwards.protocol.v1_13to1_12_2.data;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
|
||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
public class PaintingMapping {
|
||||
public class PaintingNames1_13 {
|
||||
private static final Int2ObjectMap<String> PAINTINGS = new Int2ObjectOpenHashMap<>(26, 0.99F);
|
||||
|
||||
public static void init() {
|
@ -22,12 +22,11 @@ import com.viaversion.viabackwards.protocol.v1_13to1_12_2.Protocol1_13To1_12_2;
|
||||
import com.viaversion.viaversion.api.minecraft.Particle;
|
||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
import java.util.List;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public class ParticleMapping {
|
||||
public class ParticleIdMappings1_12_2 {
|
||||
private static final ParticleData[] particles;
|
||||
|
||||
static {
|
@ -49,12 +49,12 @@ import com.viaversion.nbt.tag.ListTag;
|
||||
import com.viaversion.nbt.tag.NumberTag;
|
||||
import com.viaversion.nbt.tag.StringTag;
|
||||
import com.viaversion.nbt.tag.Tag;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.SpawnEggMappings1_13;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.packet.ClientboundPackets1_13;
|
||||
import com.viaversion.viaversion.protocols.v1_12to1_12_1.packet.ClientboundPackets1_12_1;
|
||||
import com.viaversion.viaversion.protocols.v1_12to1_12_1.packet.ServerboundPackets1_12_1;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.Protocol1_12_2To1_13;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.BlockIdData;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.data.SpawnEggRewriter;
|
||||
import com.viaversion.viaversion.util.ComponentUtil;
|
||||
import com.viaversion.viaversion.util.IdAndData;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
@ -100,7 +100,7 @@ public class BlockItemPacketRewriter1_13 extends BackwardsItemRewriter<Clientbou
|
||||
return;
|
||||
}
|
||||
|
||||
if (SpawnEggRewriter.getEntityId(oldId).isPresent()) {
|
||||
if (SpawnEggMappings1_13.getEntityId(oldId).isPresent()) {
|
||||
wrapper.write(Types.VAR_INT, IdAndData.toRawData(383));
|
||||
return;
|
||||
}
|
||||
@ -571,7 +571,7 @@ public class BlockItemPacketRewriter1_13 extends BackwardsItemRewriter<Clientbou
|
||||
}
|
||||
|
||||
private int itemIdToRaw(int oldId, Item item, CompoundTag tag) {
|
||||
Optional<String> eggEntityId = SpawnEggRewriter.getEntityId(oldId);
|
||||
Optional<String> eggEntityId = SpawnEggMappings1_13.getEntityId(oldId);
|
||||
if (eggEntityId.isPresent()) {
|
||||
if (tag == null) {
|
||||
item.setTag(tag = new CompoundTag());
|
||||
@ -776,7 +776,7 @@ public class BlockItemPacketRewriter1_13 extends BackwardsItemRewriter<Clientbou
|
||||
CompoundTag entityTag = tag.getCompoundTag("EntityTag");
|
||||
StringTag identifier;
|
||||
if (entityTag != null && (identifier = entityTag.getStringTag("id")) != null) {
|
||||
rawId = SpawnEggRewriter.getSpawnEggId(identifier.getValue());
|
||||
rawId = SpawnEggMappings1_13.getSpawnEggId(identifier.getValue());
|
||||
if (rawId == -1) {
|
||||
rawId = 25100288; // Bat fallback
|
||||
} else {
|
||||
|
@ -21,9 +21,9 @@ import com.viaversion.viabackwards.ViaBackwards;
|
||||
import com.viaversion.viabackwards.api.entities.storage.EntityPositionHandler;
|
||||
import com.viaversion.viabackwards.api.rewriters.LegacyEntityRewriter;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.Protocol1_13To1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.EntityTypeMapping;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.PaintingMapping;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.ParticleMapping;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.EntityIdMappings1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.PaintingNames1_13;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.ParticleIdMappings1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.storage.BackwardsBlockStorage;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.storage.NoteBlockStorage;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.storage.PlayerPositionStorage1_13;
|
||||
@ -35,7 +35,6 @@ import com.viaversion.viaversion.api.minecraft.entitydata.EntityData;
|
||||
import com.viaversion.viaversion.api.minecraft.entitydata.types.EntityDataTypes1_12;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_12;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_13;
|
||||
@ -43,7 +42,6 @@ import com.viaversion.viaversion.libs.gson.JsonElement;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.packet.ClientboundPackets1_13;
|
||||
import com.viaversion.viaversion.protocols.v1_12to1_12_1.packet.ClientboundPackets1_12_1;
|
||||
import com.viaversion.viaversion.protocols.v1_12to1_12_1.packet.ServerboundPackets1_12_1;
|
||||
import java.util.Optional;
|
||||
|
||||
public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPackets1_13, Protocol1_13To1_12_2> {
|
||||
|
||||
@ -137,7 +135,7 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
|
||||
EntityType entityType = EntityTypes1_13.getTypeFromId(type, false);
|
||||
tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType);
|
||||
|
||||
int oldId = EntityTypeMapping.getOldId(type);
|
||||
int oldId = EntityIdMappings1_12_2.getOldId(type);
|
||||
if (oldId == -1) {
|
||||
if (!hasData(entityType)) {
|
||||
protocol.getLogger().warning("Could not find entity type mapping " + type + "/" + entityType);
|
||||
@ -177,7 +175,7 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
|
||||
handler(getTrackerHandler(EntityTypes1_13.EntityType.PAINTING, Types.VAR_INT));
|
||||
handler(wrapper -> {
|
||||
int motive = wrapper.read(Types.VAR_INT);
|
||||
String title = PaintingMapping.getStringId(motive);
|
||||
String title = PaintingNames1_13.getStringId(motive);
|
||||
wrapper.write(Types.STRING, title);
|
||||
});
|
||||
}
|
||||
@ -326,7 +324,7 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
|
||||
filter().type(EntityTypes1_13.EntityType.AREA_EFFECT_CLOUD).index(9).handler((event, meta) -> {
|
||||
Particle particle = (Particle) meta.getValue();
|
||||
|
||||
ParticleMapping.ParticleData data = ParticleMapping.getMapping(particle.id());
|
||||
ParticleIdMappings1_12_2.ParticleData data = ParticleIdMappings1_12_2.getMapping(particle.id());
|
||||
|
||||
int firstArg = 0;
|
||||
int secondArg = 0;
|
||||
@ -361,7 +359,7 @@ public class EntityPacketRewriter1_13 extends LegacyEntityRewriter<ClientboundPa
|
||||
|
||||
@Override
|
||||
public int newEntityId(final int newId) {
|
||||
return EntityTypeMapping.getOldId(newId);
|
||||
return EntityIdMappings1_12_2.getOldId(newId);
|
||||
}
|
||||
|
||||
private static double toSet(int field, int bitIndex, double origin, double packetValue) {
|
||||
|
@ -20,7 +20,7 @@ package com.viaversion.viabackwards.protocol.v1_13to1_12_2.rewriter;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.viaversion.viabackwards.ViaBackwards;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.Protocol1_13To1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.ParticleMapping;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.ParticleIdMappings1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.storage.TabCompleteStorage;
|
||||
import com.viaversion.viabackwards.utils.ChatUtil;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
@ -30,7 +30,6 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.packet.State;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.rewriter.RewriterBase;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.libs.gson.JsonElement;
|
||||
import com.viaversion.viaversion.protocols.base.ClientboundLoginPackets;
|
||||
@ -141,7 +140,7 @@ public class PlayerPacketRewriter1_13 extends RewriterBase<Protocol1_13To1_12_2>
|
||||
map(Types.FLOAT); // 8 - Particle Data
|
||||
map(Types.INT); // 9 - Particle Count
|
||||
handler(wrapper -> {
|
||||
ParticleMapping.ParticleData old = ParticleMapping.getMapping(wrapper.get(Types.INT, 0));
|
||||
ParticleIdMappings1_12_2.ParticleData old = ParticleIdMappings1_12_2.getMapping(wrapper.get(Types.INT, 0));
|
||||
wrapper.set(Types.INT, 0, old.getHistoryId());
|
||||
|
||||
int[] data = old.rewriteData(protocol, wrapper);
|
||||
|
@ -18,10 +18,9 @@
|
||||
package com.viaversion.viabackwards.protocol.v1_13to1_12_2.rewriter;
|
||||
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.Protocol1_13To1_12_2;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.NamedSoundMapping;
|
||||
import com.viaversion.viabackwards.protocol.v1_13to1_12_2.data.NamedSoundMappings1_12_2;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.rewriter.RewriterBase;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.protocols.v1_12_2to1_13.packet.ClientboundPackets1_13;
|
||||
import com.viaversion.viaversion.protocols.v1_12to1_12_1.packet.ClientboundPackets1_12_1;
|
||||
@ -37,7 +36,7 @@ public class SoundPacketRewriter1_13 extends RewriterBase<Protocol1_13To1_12_2>
|
||||
protected void registerPackets() {
|
||||
protocol.registerClientbound(ClientboundPackets1_13.CUSTOM_SOUND, wrapper -> {
|
||||
String sound = wrapper.read(Types.STRING);
|
||||
String mappedSound = NamedSoundMapping.getOldId(sound);
|
||||
String mappedSound = NamedSoundMappings1_12_2.getOldId(sound);
|
||||
if (mappedSound != null || (mappedSound = protocol.getMappingData().getMappedNamedSound(sound)) != null) {
|
||||
wrapper.write(Types.STRING, mappedSound);
|
||||
} else {
|
||||
|
@ -20,7 +20,7 @@ package com.viaversion.viabackwards.protocol.v1_14to1_13_2;
|
||||
import com.viaversion.viabackwards.api.BackwardsProtocol;
|
||||
import com.viaversion.viabackwards.api.data.BackwardsMappingData;
|
||||
import com.viaversion.viabackwards.api.rewriters.TranslatableRewriter;
|
||||
import com.viaversion.viabackwards.protocol.v1_14to1_13_2.data.CommandRewriter1_14;
|
||||
import com.viaversion.viabackwards.protocol.v1_14to1_13_2.rewriter.CommandRewriter1_14;
|
||||
import com.viaversion.viabackwards.protocol.v1_14to1_13_2.rewriter.BlockItemPacketRewriter1_14;
|
||||
import com.viaversion.viabackwards.protocol.v1_14to1_13_2.rewriter.EntityPacketRewriter1_14;
|
||||
import com.viaversion.viabackwards.protocol.v1_14to1_13_2.rewriter.PlayerPacketRewriter1_14;
|
||||
|
@ -15,7 +15,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.v1_14to1_13_2.data;
|
||||
package com.viaversion.viabackwards.protocol.v1_14to1_13_2.rewriter;
|
||||
|
||||
import com.viaversion.viabackwards.protocol.v1_14to1_13_2.Protocol1_14To1_13_2;
|
||||
import com.viaversion.viaversion.api.type.Types;
|
@ -20,7 +20,7 @@ package com.viaversion.viabackwards.protocol.v1_16to1_15_2.data;
|
||||
import com.viaversion.nbt.tag.CompoundTag;
|
||||
import com.viaversion.viabackwards.api.data.BackwardsMappingData;
|
||||
import com.viaversion.viaversion.protocols.v1_15_2to1_16.Protocol1_15_2To1_16;
|
||||
import com.viaversion.viaversion.protocols.v1_15_2to1_16.data.Attributes1_16;
|
||||
import com.viaversion.viaversion.protocols.v1_15_2to1_16.data.AttributeMappings1_16;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -34,7 +34,7 @@ public class BackwardsMappingData1_16 extends BackwardsMappingData {
|
||||
@Override
|
||||
protected void loadExtras(final CompoundTag data) {
|
||||
super.loadExtras(data);
|
||||
for (Map.Entry<String, String> entry : Attributes1_16.attributeIdentifierMappings().entrySet()) {
|
||||
for (Map.Entry<String, String> entry : AttributeMappings1_16.attributeIdentifierMappings().entrySet()) {
|
||||
attributeMappings.put(entry.getValue(), entry.getKey());
|
||||
}
|
||||
}
|
||||
|
@ -17,15 +17,15 @@
|
||||
*/
|
||||
package com.viaversion.viabackwards.protocol.v1_18to1_17_1.data;
|
||||
|
||||
import com.viaversion.viaversion.protocols.v1_17_1to1_18.data.BlockEntityIds1_18;
|
||||
import com.viaversion.viaversion.protocols.v1_17_1to1_18.data.BlockEntityMappings1_18;
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class BlockEntityIds1_17_1 {
|
||||
public final class BlockEntityMappings1_17_1 {
|
||||
|
||||
private static final int[] IDS;
|
||||
|
||||
static {
|
||||
final int[] ids = BlockEntityIds1_18.getIds();
|
||||
final int[] ids = BlockEntityMappings1_18.getIds();
|
||||
IDS = new int[Arrays.stream(ids).max().getAsInt() + 1];
|
||||
Arrays.fill(IDS, -1);
|
||||
for (int i = 0; i < ids.length; i++) {
|
@ -19,7 +19,7 @@ package com.viaversion.viabackwards.protocol.v1_18to1_17_1.rewriter;
|
||||
|
||||
import com.viaversion.viabackwards.api.rewriters.BackwardsItemRewriter;
|
||||
import com.viaversion.viabackwards.protocol.v1_18to1_17_1.Protocol1_18To1_17_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_18to1_17_1.data.BlockEntityIds1_17_1;
|
||||
import com.viaversion.viabackwards.protocol.v1_18to1_17_1.data.BlockEntityMappings1_17_1;
|
||||
import com.viaversion.viaversion.api.data.ParticleMappings;
|
||||
import com.viaversion.viaversion.api.data.entity.EntityTracker;
|
||||
import com.viaversion.viaversion.api.minecraft.Position;
|
||||
@ -131,7 +131,7 @@ public final class BlockItemPacketRewriter1_18 extends BackwardsItemRewriter<Cli
|
||||
final int id = wrapper.read(Types.VAR_INT);
|
||||
final CompoundTag tag = wrapper.read(Types.NAMED_COMPOUND_TAG);
|
||||
|
||||
final int mappedId = BlockEntityIds1_17_1.mappedId(id);
|
||||
final int mappedId = BlockEntityMappings1_17_1.mappedId(id);
|
||||
if (mappedId == -1) {
|
||||
wrapper.cancel();
|
||||
return;
|
||||
|
@ -41,10 +41,10 @@ import com.viaversion.viaversion.api.type.Types;
|
||||
import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_18;
|
||||
import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_20_2;
|
||||
import com.viaversion.viaversion.protocols.v1_19_3to1_19_4.packet.ServerboundPackets1_19_4;
|
||||
import com.viaversion.viaversion.protocols.v1_20to1_20_2.data.PotionEffects1_20_2;
|
||||
import com.viaversion.viaversion.protocols.v1_20to1_20_2.packet.ClientboundPackets1_20_2;
|
||||
import com.viaversion.viaversion.protocols.v1_20to1_20_2.packet.ServerboundPackets1_20_2;
|
||||
import com.viaversion.viaversion.protocols.v1_20to1_20_2.rewriter.RecipeRewriter1_20_2;
|
||||
import com.viaversion.viaversion.protocols.v1_20to1_20_2.util.PotionEffects1_20_2;
|
||||
import com.viaversion.viaversion.rewriter.BlockRewriter;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import com.viaversion.viaversion.util.MathUtil;
|
||||
|
Loading…
Reference in New Issue
Block a user