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:
Ursprung
bb2f26a5eb
Commit
b6caa30c16
@ -35,6 +35,7 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
|
|||||||
private boolean fix1_13FormattedInventoryTitles;
|
private boolean fix1_13FormattedInventoryTitles;
|
||||||
private boolean handlePingsAsInvAcknowledgements;
|
private boolean handlePingsAsInvAcknowledgements;
|
||||||
private boolean bedrockAtY0;
|
private boolean bedrockAtY0;
|
||||||
|
private boolean sculkShriekersToCryingObsidian;
|
||||||
private boolean suppressEmulationWarnings;
|
private boolean suppressEmulationWarnings;
|
||||||
|
|
||||||
public ViaBackwardsConfig(File configFile, Logger logger) {
|
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);
|
alwaysShowOriginalMobName = getBoolean("always-show-original-mob-name", true);
|
||||||
handlePingsAsInvAcknowledgements = getBoolean("handle-pings-as-inv-acknowledgements", false);
|
handlePingsAsInvAcknowledgements = getBoolean("handle-pings-as-inv-acknowledgements", false);
|
||||||
bedrockAtY0 = getBoolean("bedrock-at-y-0", false);
|
bedrockAtY0 = getBoolean("bedrock-at-y-0", false);
|
||||||
|
sculkShriekersToCryingObsidian = getBoolean("sculk-shriekers-to-crying-obsidian", false);
|
||||||
suppressEmulationWarnings = getBoolean("suppress-emulation-warnings", false);
|
suppressEmulationWarnings = getBoolean("suppress-emulation-warnings", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,6 +95,11 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
|
|||||||
return bedrockAtY0;
|
return bedrockAtY0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean sculkShriekerToCryingObsidian() {
|
||||||
|
return sculkShriekersToCryingObsidian;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean suppressEmulationWarnings() {
|
public boolean suppressEmulationWarnings() {
|
||||||
return suppressEmulationWarnings;
|
return suppressEmulationWarnings;
|
||||||
|
@ -71,6 +71,13 @@ public interface ViaBackwardsConfig extends Config {
|
|||||||
*/
|
*/
|
||||||
boolean bedrockAtY0();
|
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+).
|
* Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
|
||||||
*
|
*
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.viaversion.viabackwards.protocol.v1_19to1_18_2.data;
|
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.BackwardsMappingData;
|
||||||
import com.viaversion.viabackwards.api.data.BackwardsMappingDataLoader;
|
import com.viaversion.viabackwards.api.data.BackwardsMappingDataLoader;
|
||||||
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
|
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 {
|
public final class BackwardsMappingData1_19 extends BackwardsMappingData {
|
||||||
|
|
||||||
|
private final boolean sculkShriekerToCryingObsidian = ViaBackwards.getConfig().sculkShriekerToCryingObsidian();
|
||||||
|
|
||||||
private final Int2ObjectMap<CompoundTag> defaultChatTypes = new Int2ObjectOpenHashMap<>();
|
private final Int2ObjectMap<CompoundTag> defaultChatTypes = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
public BackwardsMappingData1_19() {
|
public BackwardsMappingData1_19() {
|
||||||
@ -39,6 +42,13 @@ public final class BackwardsMappingData1_19 extends BackwardsMappingData {
|
|||||||
protected void loadExtras(final CompoundTag data) {
|
protected void loadExtras(final CompoundTag data) {
|
||||||
super.loadExtras(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);
|
final ListTag<CompoundTag> chatTypes = BackwardsMappingDataLoader.INSTANCE.loadNBT("chat-types-1.19.1.nbt").getListTag("values", CompoundTag.class);
|
||||||
for (final CompoundTag chatType : chatTypes) {
|
for (final CompoundTag chatType : chatTypes) {
|
||||||
final NumberTag idTag = chatType.getNumberTag("id");
|
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) {
|
public @Nullable CompoundTag chatType(final int id) {
|
||||||
return defaultChatTypes.get(id);
|
return defaultChatTypes.get(id);
|
||||||
}
|
}
|
||||||
|
@ -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.
|
# 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
|
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+).
|
# Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
|
||||||
suppress-emulation-warnings: false
|
suppress-emulation-warnings: false
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren