File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
parallelworlds/src/main/java/parallelmc/parallelworlds/events Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 99import com .github .retrooper .packetevents .protocol .world .chunk .palette .DataPalette ;
1010import com .github .retrooper .packetevents .protocol .world .chunk .palette .ListPalette ;
1111import com .github .retrooper .packetevents .protocol .world .states .WrappedBlockState ;
12+ import com .github .retrooper .packetevents .wrapper .play .server .WrapperPlayServerBlockAction ;
1213import com .github .retrooper .packetevents .wrapper .play .server .WrapperPlayServerBlockChange ;
1314import com .github .retrooper .packetevents .wrapper .play .server .WrapperPlayServerChunkData ;
1415import net .minecraft .world .level .block .Block ;
@@ -76,7 +77,19 @@ public void onPacketSend(PacketSendEvent event) {
7677 } else if (event .getPacketType () == PacketType .Play .Server .BLOCK_CHANGE ) {
7778 WrapperPlayServerBlockChange packet = new WrapperPlayServerBlockChange (event );
7879
79- Logger .getGlobal ().log (Level .WARNING , String .valueOf (packet .getBlockId ()));
80+ if (packet .getBlockId () >= firstCustomId ) {
81+ packet .setBlockID (replace_state );
82+ event .markForReEncode (true );
83+ }
84+
85+ //Logger.getGlobal().log(Level.WARNING, String.valueOf(packet.getBlockId()));
86+ } else if (event .getPacketType () == PacketType .Play .Server .BLOCK_ACTION ) {
87+ WrapperPlayServerBlockAction packet = new WrapperPlayServerBlockAction (event );
88+
89+ if (packet .getBlockTypeId () >= firstCustomId ) {
90+ packet .setBlockTypeId (replace_state );
91+ event .markForReEncode (true );
92+ }
8093 }
8194 }
8295
You can’t perform that action at this time.
0 commit comments