3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-26 16:12:43 +01:00

Add alternative sculk shrieker mapping in 1.19->1.18.2 (#820)

Dieser Commit ist enthalten in:
EnZaXD 2024-07-17 19:06:44 +02:00 committet von GitHub
Ursprung bb2f26a5eb
Commit b6caa30c16
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
4 geänderte Dateien mit 36 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -35,6 +35,7 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
private boolean fix1_13FormattedInventoryTitles;
private boolean handlePingsAsInvAcknowledgements;
private boolean bedrockAtY0;
private boolean sculkShriekersToCryingObsidian;
private boolean suppressEmulationWarnings;
public ViaBackwardsConfig(File configFile, Logger logger) {
@ -55,6 +56,7 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
alwaysShowOriginalMobName = getBoolean("always-show-original-mob-name", true);
handlePingsAsInvAcknowledgements = getBoolean("handle-pings-as-inv-acknowledgements", false);
bedrockAtY0 = getBoolean("bedrock-at-y-0", false);
sculkShriekersToCryingObsidian = getBoolean("sculk-shriekers-to-crying-obsidian", false);
suppressEmulationWarnings = getBoolean("suppress-emulation-warnings", false);
}
@ -93,6 +95,11 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
return bedrockAtY0;
}
@Override
public boolean sculkShriekerToCryingObsidian() {
return sculkShriekersToCryingObsidian;
}
@Override
public boolean suppressEmulationWarnings() {
return suppressEmulationWarnings;

Datei anzeigen

@ -71,6 +71,13 @@ public interface ViaBackwardsConfig extends Config {
*/
boolean bedrockAtY0();
/**
* Shows sculk shriekers as crying obsidian for 1.18.2 clients on 1.19+ servers. This fixes collision and block breaking issues.
*
* @return true if enabled
*/
boolean sculkShriekerToCryingObsidian();
/**
* Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
*

Datei anzeigen

@ -17,6 +17,7 @@
*/
package com.viaversion.viabackwards.protocol.v1_19to1_18_2.data;
import com.viaversion.viabackwards.ViaBackwards;
import com.viaversion.viabackwards.api.data.BackwardsMappingData;
import com.viaversion.viabackwards.api.data.BackwardsMappingDataLoader;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
@ -29,6 +30,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public final class BackwardsMappingData1_19 extends BackwardsMappingData {
private final boolean sculkShriekerToCryingObsidian = ViaBackwards.getConfig().sculkShriekerToCryingObsidian();
private final Int2ObjectMap<CompoundTag> defaultChatTypes = new Int2ObjectOpenHashMap<>();
public BackwardsMappingData1_19() {
@ -39,6 +42,13 @@ public final class BackwardsMappingData1_19 extends BackwardsMappingData {
protected void loadExtras(final CompoundTag data) {
super.loadExtras(data);
if (sculkShriekerToCryingObsidian) {
blockMappings.setNewId(850, 750);
for (int i = 18900; i <= 18907; i++) {
blockStateMappings.setNewId(i, 16082);
}
}
final ListTag<CompoundTag> chatTypes = BackwardsMappingDataLoader.INSTANCE.loadNBT("chat-types-1.19.1.nbt").getListTag("values", CompoundTag.class);
for (final CompoundTag chatType : chatTypes) {
final NumberTag idTag = chatType.getNumberTag("id");
@ -46,6 +56,14 @@ public final class BackwardsMappingData1_19 extends BackwardsMappingData {
}
}
@Override
public int getNewItemId(final int id) {
if (sculkShriekerToCryingObsidian && id == 329) {
return 1065;
}
return super.getNewItemId(id);
}
public @Nullable CompoundTag chatType(final int id) {
return defaultChatTypes.get(id);
}

Datei anzeigen

@ -24,5 +24,9 @@ handle-pings-as-inv-acknowledgements: false
# Adds bedrock blocks at y=0 for sub 1.17 clients. This may allow for weird interactions due to sending fake blocks.
bedrock-at-y-0: false
#
# Shows sculk shriekers as crying obsidian for 1.18.2 clients on 1.19+ servers. This fixes collision and block breaking issues.
# If disabled, the client will see them as end portal frames.
sculk-shriekers-to-crying-obsidian: true
#
# Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
suppress-emulation-warnings: false