Skip to content

Commit

Permalink
Update to 1.21.4-pre1
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Nov 21, 2024
1 parent 786bf19 commit e7a02b4
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 26 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.jvmargs=-Xmx4G
# Fabric Properties
# check these on https://fabricmc.net/use

minecraft_version=24w44a
yarn_mappings=24w44a+build.1
minecraft_version=1.21.4-pre1
yarn_mappings=1.21.4-pre1+build.1
loader_version=0.16.9

# Fabric API
fabric_version=0.107.0+1.21.4
fabric_version=0.109.1+1.21.4

maven_group = eu.pb4

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void registerEmpty(BlockModelType type) {

Registry.register(Registries.ITEM, id, new PolymerBlockItem(block, new Item.Settings()
.registryKey(RegistryKey.of(RegistryKeys.ITEM, id))
.modelId(block.getPolymerBlockState(block.getDefaultState(), PacketContext.create()).getBlock().getRegistryEntry().registryKey().getValue())
//.modelId(block.getPolymerBlockState(block.getDefaultState(), PacketContext.create()).getBlock().getRegistryEntry().registryKey().getValue())
.component(DataComponentTypes.ENCHANTMENT_GLINT_OVERRIDE, true),
block.getPolymerBlockState(block.getDefaultState(), PacketContext.create()).getBlock().asItem()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,11 @@ public Entity getEntityById(int id) {
}

@Override
public Collection<EnderDragonPart> method_65097() {
public Collection<EnderDragonPart> getEnderDragonParts() {
return List.of();
}


@Override
public TickManager getTickManager() {
return this.tickManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public PolymerSpawnEggItem(EntityType<? extends MobEntity> type, Item polymerIte
this(type, polymerItem, false, settings);
}
public PolymerSpawnEggItem(EntityType<? extends MobEntity> type, Item polymerItem, boolean useModel, Settings settings) {
super(type, 0, 0, settings);
super(type, settings);
this.polymerItem = polymerItem;
this.polymerUseModel = useModel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void register() {
var renderer = new FluidRenderHandler() {
@Override
public Sprite[] getFluidSprites(@Nullable BlockRenderView view, @Nullable BlockPos pos, FluidState state) {
return new Sprite[] { MinecraftClient.getInstance().getBakedModelManager().getMissingModel().getParticleSprite() };
return new Sprite[] { MinecraftClient.getInstance().getBakedModelManager().getMissingBlockModel().getParticleSprite() };
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public IElement getIcon(BlockAccessor accessor, snownee.jade.api.config.IPluginC

var itemStack = block.block().displayStack();
if (itemStack.isEmpty()) {
itemStack = state.method_65171(accessor.getLevel(), accessor.getPosition());
itemStack = state.getPickStack(accessor.getLevel(), accessor.getPosition(), false);
if (!itemStack.isEmpty() && state.hasBlockEntity()) {
var blockEntity = accessor.getLevel().getBlockEntity(accessor.getPosition());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static class BlockOverride implements IBlockComponentProvider {

var itemStack = block.block().displayStack();
if (itemStack.isEmpty()) {
itemStack = state.method_65171(accessor.getWorld(), accessor.getPosition());
itemStack = state.getPickStack(accessor.getWorld(), accessor.getPosition(), false);
if (!itemStack.isEmpty() && state.hasBlockEntity()) {
var blockEntity = accessor.getWorld().getBlockEntity(accessor.getPosition());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void updateRotation(BlockState state) {
pitch = dir == Direction.DOWN ? 180 : 0;
} else {
pitch = 90;
yaw = dir.asRotation();
yaw = dir.getPositiveHorizontalDegrees();
}

this.planetElement.setRotation(pitch, yaw);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import eu.pb4.polymer.common.impl.CommonImpl;
import eu.pb4.polymer.networking.impl.EarlyPlayConnectionMagic;
import eu.pb4.polymer.networking.impl.TempPlayerLoginAttachments;
import net.minecraft.class_10370;
import net.minecraft.class_10371;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.network.RegistryByteBuf;
Expand Down Expand Up @@ -367,6 +365,11 @@ public void onTeleportConfirm(TeleportConfirmC2SPacket packet) {

}

@Override
public void onPlayerLoaded(PlayerLoadedC2SPacket packet) {

}

@Override
public void onRecipeBookData(RecipeBookDataC2SPacket packet) {

Expand Down Expand Up @@ -403,12 +406,12 @@ public void onUpdateCommandBlockMinecart(UpdateCommandBlockMinecartC2SPacket pac
}

@Override
public void method_65085(class_10370 arg) {
public void onPickItemFromBlock(PickItemFromBlockC2SPacket packet) {

}

@Override
public void onPickFromInventory(class_10371 packet) {
public void onPickItemFromEntity(PickItemFromEntityC2SPacket packet) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@

import java.util.function.BiFunction;

@FunctionalInterface
public interface ServerDynamicPacket extends Packet<ClientCommonPacketListener> {
static Packet<ClientCommonPacketListener> of(BiFunction<ServerCommonNetworkHandler, @Nullable ServerPlayerEntity, Packet<ClientCommonPacketListener>> builder) {
return (ServerDynamicPacket) builder::apply;
}

Packet<ClientCommonPacketListener> createPacket(ServerCommonNetworkHandler handler, @Nullable ServerPlayerEntity player);


@Override
default PacketType<? extends Packet<ClientCommonPacketListener>> method_65080() {
throw new UnsupportedOperationException();
};
default void apply(ClientCommonPacketListener listener) {
throw new UnsupportedOperationException("This is not real packet!");
}

@Override
default void method_65081(ClientCommonPacketListener listener) {
throw new UnsupportedOperationException();
default PacketType<ServerDynamicPacket> getPacketType() {
throw new UnsupportedOperationException("This is not real packet!");
}


@Override
default boolean isWritingErrorSkippable() {
return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package eu.pb4.polymer.networking.impl;

import net.minecraft.class_10370;
import net.minecraft.class_10371;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.network.NetworkPhase;
import net.minecraft.network.listener.ServerConfigurationPacketListener;
Expand Down Expand Up @@ -199,6 +197,11 @@ public void onTeleportConfirm(TeleportConfirmC2SPacket packet) {

}

@Override
public void onPlayerLoaded(PlayerLoadedC2SPacket packet) {

}

@Override
public void onRecipeBookData(RecipeBookDataC2SPacket packet) {

Expand Down Expand Up @@ -235,12 +238,12 @@ public void onUpdateCommandBlockMinecart(UpdateCommandBlockMinecartC2SPacket pac
}

@Override
public void method_65085(class_10370 arg) {
public void onPickItemFromBlock(PickItemFromBlockC2SPacket packet) {

}

@Override
public void onPickFromInventory(class_10371 packet) {
public void onPickItemFromEntity(PickItemFromEntityC2SPacket packet) {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public ServerConfigurationNetworkHandlerMixin(MinecraftServer server, ClientConn
for (var packetx : context.storedPackets()) {
try {
//noinspection unchecked
((Packet<ServerPlayPacketListener>) packetx).method_65081(listener);
((Packet<ServerPlayPacketListener>) packetx).apply(listener);
} catch (Throwable e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void dontDuplicateCalls2(ClientConnection instance, NetworkState<PacketL
for (var packetx : context.storedPackets()) {
try {
//noinspection unchecked
((Packet<ServerConfigurationPacketListener>) packetx).method_65081(listener);
((Packet<ServerConfigurationPacketListener>) packetx).apply(listener);
} catch (Throwable e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public record LanguageResourceMetadata(Map<String, LanguageDefinition> definitio
public static final Codec<String> LANGUAGE_CODE_CODEC = Codec.string(1, 16);
public static final Codec<LanguageResourceMetadata> CODEC = Codec.unboundedMap(LANGUAGE_CODE_CODEC, LanguageDefinition.CODEC)
.xmap(LanguageResourceMetadata::new, LanguageResourceMetadata::definitions);
public static final ResourceMetadataSerializer<LanguageResourceMetadata> SERIALIZER = ResourceMetadataSerializer.fromCodec("language", CODEC);
public static final ResourceMetadataSerializer<LanguageResourceMetadata> SERIALIZER = new ResourceMetadataSerializer<>("language", CODEC);
}

0 comments on commit e7a02b4

Please sign in to comment.