-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix campfires not showing polymer items, make resource pack merge lan…
…guage files and mcmeta together
- Loading branch information
Showing
31 changed files
with
501 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 20 additions & 9 deletions
29
polymer-core/src/main/java/eu/pb4/polymer/core/mixin/block/ChunkDataSenderMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...src/main/java/eu/pb4/polymer/core/mixin/block/packet/BlockEntityUpdateS2CPacketMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package eu.pb4.polymer.core.mixin.block.packet; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import eu.pb4.polymer.core.api.block.PolymerBlockUtils; | ||
import eu.pb4.polymer.core.impl.networking.TransformingPacketCodec; | ||
import eu.pb4.polymer.core.mixin.block.BlockEntityUpdateS2CPacketAccessor; | ||
import net.minecraft.network.RegistryByteBuf; | ||
import net.minecraft.network.codec.PacketCodec; | ||
import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import xyz.nucleoid.packettweaker.PacketContext; | ||
|
||
@Mixin(BlockEntityUpdateS2CPacket.class) | ||
public class BlockEntityUpdateS2CPacketMixin { | ||
@ModifyExpressionValue(method = "<clinit>", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/codec/PacketCodec;tuple(Lnet/minecraft/network/codec/PacketCodec;Ljava/util/function/Function;Lnet/minecraft/network/codec/PacketCodec;Ljava/util/function/Function;Lnet/minecraft/network/codec/PacketCodec;Ljava/util/function/Function;Lcom/mojang/datafixers/util/Function3;)Lnet/minecraft/network/codec/PacketCodec;")) | ||
private static PacketCodec<RegistryByteBuf, BlockEntityUpdateS2CPacket> changeNbt(PacketCodec<RegistryByteBuf, BlockEntityUpdateS2CPacket> original) { | ||
return TransformingPacketCodec.encodeOnly(original, (buf, packet) -> { | ||
if (packet.getNbt() == null) { | ||
return packet; | ||
} | ||
var nbt = PolymerBlockUtils.transformBlockEntityNbt(PacketContext.get(), packet.getBlockEntityType(), packet.getNbt()); | ||
if (packet.getNbt() == nbt) { | ||
return packet; | ||
} | ||
return BlockEntityUpdateS2CPacketAccessor.createBlockEntityUpdateS2CPacket(packet.getPos(), packet.getBlockEntityType(), nbt); | ||
}); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...e/src/main/java/eu/pb4/polymer/core/mixin/block/packet/ChunkDataBlockEntityDataMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package eu.pb4.polymer.core.mixin.block.packet; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import eu.pb4.polymer.core.api.block.PolymerBlockUtils; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.nbt.NbtCompound; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import xyz.nucleoid.packettweaker.PacketContext; | ||
|
||
@Mixin(targets = "net/minecraft/network/packet/s2c/play/ChunkData$BlockEntityData") | ||
public class ChunkDataBlockEntityDataMixin { | ||
@ModifyExpressionValue(method = "of", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/entity/BlockEntity;toInitialChunkDataNbt(Lnet/minecraft/registry/RegistryWrapper$WrapperLookup;)Lnet/minecraft/nbt/NbtCompound;")) | ||
private static NbtCompound changeNbt(NbtCompound original, @Local(argsOnly = true) BlockEntity blockEntity) { | ||
return PolymerBlockUtils.transformBlockEntityNbt(PacketContext.get(), blockEntity.getType(), original); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
polymer-core/src/main/java/eu/pb4/polymer/core/mixin/block/packet/ChunkDataMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
polymer-core/src/testmod/resources/assets/polymertest/lang/en_us.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"item.test.shulker_helmet": "Shulker Helmet" | ||
} |
Oops, something went wrong.