File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed
java/com/viaversion/viabackwards
protocol/v1_19_4to1_19_3/rewriter
resources/assets/viabackwards Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
39
39
private boolean scaffoldingToWater ;
40
40
private boolean mapDarknessEffect ;
41
41
private boolean mapCustomModelData ;
42
+ private boolean mapDisplayEntities ;
42
43
private boolean suppressEmulationWarnings ;
43
44
44
45
public ViaBackwardsConfig (File configFile , Logger logger ) {
@@ -63,6 +64,7 @@ private void loadFields() {
63
64
scaffoldingToWater = getBoolean ("scaffolding-to-water" , false );
64
65
mapDarknessEffect = getBoolean ("map-darkness-effect" , true );
65
66
mapCustomModelData = getBoolean ("map-custom-model-data" , true );
67
+ mapDisplayEntities = getBoolean ("map-display-entities" , true );
66
68
suppressEmulationWarnings = getBoolean ("suppress-emulation-warnings" , false );
67
69
}
68
70
@@ -121,6 +123,11 @@ public boolean mapCustomModelData() {
121
123
return mapCustomModelData ;
122
124
}
123
125
126
+ @ Override
127
+ public boolean mapDisplayEntities () {
128
+ return mapDisplayEntities ;
129
+ }
130
+
124
131
@ Override
125
132
public boolean suppressEmulationWarnings () {
126
133
return suppressEmulationWarnings ;
Original file line number Diff line number Diff line change @@ -99,6 +99,13 @@ public interface ViaBackwardsConfig extends Config {
99
99
*/
100
100
boolean mapCustomModelData ();
101
101
102
+ /**
103
+ * If enabled, 1.19.3 clients will receive display entities as armor stands with custom entity data on 1.19.4+ servers.
104
+ *
105
+ * @return true if enabled
106
+ */
107
+ boolean mapDisplayEntities ();
108
+
102
109
/**
103
110
* Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
104
111
*
Original file line number Diff line number Diff line change 20
20
import com .viaversion .nbt .tag .CompoundTag ;
21
21
import com .viaversion .nbt .tag .ListTag ;
22
22
import com .viaversion .nbt .tag .NumberTag ;
23
+ import com .viaversion .viabackwards .ViaBackwards ;
23
24
import com .viaversion .viabackwards .api .entities .storage .EntityPositionHandler ;
24
25
import com .viaversion .viabackwards .api .entities .storage .EntityReplacement ;
25
26
import com .viaversion .viabackwards .api .rewriters .EntityRewriter ;
@@ -70,6 +71,13 @@ public void register() {
70
71
final int entityId = wrapper .get (Types .VAR_INT , 0 );
71
72
final int entityType = wrapper .get (Types .VAR_INT , 1 );
72
73
74
+ if (!ViaBackwards .getConfig ().mapDisplayEntities ()) {
75
+ if (entityType == EntityTypes1_19_4 .BLOCK_DISPLAY .getId () || entityType == EntityTypes1_19_4 .ITEM_DISPLAY .getId () || entityType == EntityTypes1_19_4 .TEXT_DISPLAY .getId ()) {
76
+ wrapper .cancel ();
77
+ return ;
78
+ }
79
+ }
80
+
73
81
// First track (and remap) entity, then put storage for block display entity
74
82
getSpawnTrackerWithDataHandler1_19 (EntityTypes1_19_4 .FALLING_BLOCK ).handle (wrapper );
75
83
if (entityType != EntityTypes1_19_4 .BLOCK_DISPLAY .getId ()) {
Original file line number Diff line number Diff line change @@ -38,5 +38,9 @@ map-darkness-effect: true
38
38
# If enabled, 1.21.3 clients will receive the first float of 1.21.4+ custom model data as int. Disable if you handle this change yourself.
39
39
map-custom-model-data : true
40
40
#
41
+ # If enabled, 1.19.3 clients will receive display entities as armor stands with custom entity data on 1.19.4+ servers. Note that
42
+ # this does not support all features display entities offer.
43
+ map-display-entities : true
44
+ #
41
45
# Suppresses warnings of missing emulations for certain features that are not supported (e.g. world height in 1.17+).
42
46
suppress-emulation-warnings : false
You can’t perform that action at this time.
0 commit comments