Skip to content

Commit

Permalink
Update mod to Minecraft 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
haykam821 authored and Patbox committed Dec 3, 2024
1 parent 9ce20b6 commit 37d5a3f
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation 'xyz.nucleoid:plasmid:0.6.0-SNAPSHOT+1.21.3'
modImplementation 'xyz.nucleoid:plasmid:0.6.2+1.21.4'

//modCompileOnly "com.viaversion:viaversion-api:4.7.0-SNAPSHOT"
modCompileOnly "dev.gegy:player-roles-api:1.6.13"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.1
loader_version=0.16.9

# Dependencies
fabric_version=0.107.3+1.21.3
fabric_version=0.110.5+1.21.4

# Mod Properties
mod_version=1.3.2
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/xyz/nucleoid/extras/lobby/NEItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.resource.featuretoggle.FeatureFlags;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayNetworkHandler;
import net.minecraft.server.network.ServerPlayerEntity;
Expand Down Expand Up @@ -151,7 +150,7 @@ public class NEItems {
public static final Item TRANSIENT_CHERRY_DOOR = register("transient_cherry_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_CHERRY_DOOR, settings, Items.CHERRY_DOOR));
public static final Item TRANSIENT_DARK_OAK_DOOR = register("transient_dark_oak_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_DARK_OAK_DOOR, settings, Items.DARK_OAK_DOOR));
public static final Item TRANSIENT_MANGROVE_DOOR = register("transient_mangrove_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_MANGROVE_DOOR, settings, Items.MANGROVE_DOOR));
public static final Item TRANSIENT_PALE_OAK_DOOR = register("transient_pale_oak_door", new Item.Settings().useBlockPrefixedTranslationKey().requires(FeatureFlags.WINTER_DROP), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_PALE_OAK_DOOR, settings, Items.PALE_OAK_DOOR));
public static final Item TRANSIENT_PALE_OAK_DOOR = register("transient_pale_oak_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_PALE_OAK_DOOR, settings, Items.PALE_OAK_DOOR));
public static final Item TRANSIENT_BAMBOO_DOOR = register("transient_bamboo_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_BAMBOO_DOOR, settings, Items.BAMBOO_DOOR));
public static final Item TRANSIENT_CRIMSON_DOOR = register("transient_crimson_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_CRIMSON_DOOR, settings, Items.CRIMSON_DOOR));
public static final Item TRANSIENT_WARPED_DOOR = register("transient_warped_door", new Item.Settings().useBlockPrefixedTranslationKey(), settings -> new LobbyTallBlockItem(NEBlocks.TRANSIENT_WARPED_DOOR, settings, Items.WARPED_DOOR));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void update(String contributorId, ServerWorld world, BlockState state) {
var entity = this.entityElement.entity();
contributor.fillEntity(world.getServer(), entity);

entity.setYaw(entity.getYaw() + state.get(ContributorStatueBlock.FACING).asRotation());
entity.setYaw(entity.getYaw() + state.get(ContributorStatueBlock.FACING).getPositiveHorizontalDegrees());
entity.setHeadYaw(entity.getYaw());
entity.setBodyYaw(entity.getYaw());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public boolean ring(@Nullable Entity entity, World world, BlockPos pos, @Nullabl
if (!world.isClient && blockEntity instanceof BellTaterBlockEntity bellTaterBlockEntity) {
if (direction == null) {
int rotation = world.getBlockState(pos).get(Properties.ROTATION);
direction = Direction.fromRotation(rotation * 22.5);
direction = Direction.fromHorizontalDegrees(rotation * 22.5);
}
bellTaterBlockEntity.activate(direction);
world.playSound(null, pos, SoundEvents.BLOCK_BELL_USE, SoundCategory.BLOCKS, 2.0f, 1.0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private LuckyTaterDropPos getDropPos(ServerWorld world, BlockState state, BlockP
dropPos.move(Direction.DOWN);

int rotation = state.get(Properties.ROTATION);
dropPos.move(Direction.fromRotation(rotation * 22.5).getOpposite());
dropPos.move(Direction.fromHorizontalDegrees(rotation * 22.5).getOpposite());

for (int i = 0; i < 3; i++) {
BlockState dropState = world.getBlockState(dropPos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@ private static PublicPlayerSession.Serialized getSession(ServerPlayerEntity play
return Nullables.map(player.getSession(), PublicPlayerSession::toSerialized);
}

public static GameMode getGameMode(ServerPlayerEntity player, boolean gray) {
return gray ? GameMode.SPECTATOR : player.interactionManager.getGameMode();
public static GameMode getGameMode(PlayerListS2CPacket.Entry examplar, boolean gray) {
return gray ? GameMode.SPECTATOR : examplar.gameMode();
}

public static PlayerListS2CPacket.Entry createEntry(ServerPlayerEntity player, boolean gray) {
var examplar = new PlayerListS2CPacket.Entry(player);

return new PlayerListS2CPacket.Entry(
player.getUuid(),
player.getGameProfile(),
true,
player.networkHandler.getLatency(),
getGameMode(player, gray),
examplar.profileId(),
examplar.profile(),
examplar.listed(),
examplar.latency(),
getGameMode(examplar, gray),
getDisplayName(player, gray),
player.getPlayerListOrder(),
getSession(player)
examplar.showHat(),
examplar.listOrder(),
examplar.chatSession()
);
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/extras.accesswidener
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
accessWidener v2 named

accessible method net/minecraft/network/packet/s2c/play/PlayerListS2CPacket$Entry <init> (Lnet/minecraft/server/network/ServerPlayerEntity;)V

accessible class net/minecraft/block/entity/BellBlockEntity$Effect
accessible method net/minecraft/block/entity/BellBlockEntity raidersHearBell (Lnet/minecraft/util/math/BlockPos;Ljava/util/List;)Z
accessible method net/minecraft/block/entity/BellBlockEntity applyGlowToRaiders (Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Ljava/util/List;)V
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"depends": {
"fabricloader": ">=0.9.1",
"fabric": "*",
"minecraft": ">=1.21.2-",
"minecraft": ">=1.21.4-",
"plasmid": "0.6.x",
"java": ">=17"
}
Expand Down

0 comments on commit 37d5a3f

Please sign in to comment.