Skip to content

Commit aefe593

Browse files
committed
Update to 1.21.11
1 parent f3dcd23 commit aefe593

8 files changed

Lines changed: 46 additions & 28 deletions

File tree

build.gradle

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
plugins {
2-
id "fabric-loom" version "1.10.+"
2+
id "fabric-loom" version "1.15.+"
33
id 'maven-publish'
44
}
55

6-
sourceCompatibility = JavaVersion.VERSION_17
7-
targetCompatibility = JavaVersion.VERSION_17
8-
9-
archivesBaseName = project.archives_base_name
106
version = project.mod_version
117
group = project.maven_group
128

9+
base {
10+
archivesName = project.archives_base_name
11+
}
12+
1313
repositories {
1414
maven { url = "https://maven.nucleoid.xyz/" }
1515
maven { url = "https://maven.gegy.dev/" }
@@ -44,10 +44,15 @@ tasks.withType(JavaCompile).configureEach {
4444

4545
java {
4646
withSourcesJar()
47+
48+
sourceCompatibility = JavaVersion.VERSION_21
49+
targetCompatibility = JavaVersion.VERSION_21
4750
}
4851

4952
jar {
5053
from("LICENSE") {
51-
rename { "${it}_${project.archivesBaseName}" }
54+
inputs.property "archivesName", project.base.archivesName
55+
56+
rename { "${it}_${inputs.properties.archivesName}" }
5257
}
5358
}

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ archives_base_name=build_rush
88

99
# Fabric Properties
1010
# check these on https://fabricmc.net/develop/
11-
minecraft_version=1.21.5
12-
yarn_mappings=1.21.5+build.1
13-
loader_version=0.16.13
14-
fabric_version=0.119.0+1.21.5
11+
minecraft_version=1.21.11
12+
yarn_mappings=1.21.11+build.4
13+
loader_version=0.18.4
14+
fabric_version=0.141.3+1.21.11
1515

1616
# check this on https://nucleoid.xyz/use/
17-
plasmid_version=0.6.4+1.21.5
17+
plasmid_version=0.6.7-SNAPSHOT+1.21.11
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/fr/hugman/build_rush/BuildRush.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import net.fabricmc.api.ModInitializer;
66
import net.fabricmc.loader.api.FabricLoader;
77
import net.minecraft.util.Identifier;
8-
import org.apache.logging.log4j.LogManager;
9-
import org.apache.logging.log4j.Logger;
8+
import org.slf4j.Logger;
9+
import org.slf4j.LoggerFactory;
1010
import xyz.nucleoid.plasmid.api.game.GameType;
1111

1212
public class BuildRush implements ModInitializer {
1313
public static final String ID = "build_rush";
14-
public static final Logger LOGGER = LogManager.getLogger(ID);
14+
public static final Logger LOGGER = LoggerFactory.getLogger(ID);
1515

1616
@Override
1717
public void onInitialize() {

src/main/java/fr/hugman/build_rush/build/BuildItemCollector.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
import net.minecraft.state.property.IntProperty;
2020
import net.minecraft.state.property.Properties;
2121
import net.minecraft.state.property.Property;
22+
import net.minecraft.storage.NbtReadView;
23+
import net.minecraft.storage.NbtWriteView;
24+
import net.minecraft.util.ErrorReporter;
2225
import net.minecraft.util.Unit;
2326
import net.minecraft.util.math.BlockPos;
2427
import org.jetbrains.annotations.Nullable;
@@ -231,7 +234,10 @@ private static void setUnbreakable(ItemStack stack) {
231234

232235
public static void addBlockEntityNbt(ServerWorld world, ItemStack stack, BlockEntity blockEntity) {
233236
NbtCompound nbt = blockEntity.createNbtWithIdentifyingData(world.getRegistryManager());
234-
BlockItem.setBlockEntityData(stack, blockEntity.getType(), nbt);
235-
stack.applyComponentsFrom(blockEntity.createComponentMap());
237+
try (ErrorReporter.Logging errorReporter = new ErrorReporter.Logging(blockEntity.getReporterContext(), BuildRush.LOGGER)) {
238+
var view = NbtWriteView.create(errorReporter, world.getRegistryManager());
239+
BlockItem.setBlockEntityData(stack, blockEntity.getType(), view);
240+
stack.applyComponentsFrom(blockEntity.createComponentMap());
241+
}
236242
}
237243
}

src/main/java/fr/hugman/build_rush/game/state/BRActive.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public void tick() {
271271
if (otherData != data && otherData.plot != null && otherData.plot.safeZone().contains(player.getBlockPos())) {
272272
resetPlayer(player, true);
273273
player.sendMessage(TextUtil.translatable(TextUtil.WARNING, TextUtil.DANGER, "text.build_rush.do_not_disturb"));
274-
player.playSoundToPlayer(SoundEvents.BLOCK_NOTE_BLOCK_DIDGERIDOO.value(), SoundCategory.PLAYERS, 1, 1);
274+
player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_DIDGERIDOO.value(), 1, 1);
275275
break;
276276
}
277277
}
@@ -303,18 +303,18 @@ public void tick() {
303303
}
304304
if (stateSeconds == 30 || stateSeconds == 15 || stateSeconds == 10) {
305305
TextUtil.sendSubtitle(player, Text.literal(String.valueOf(stateSeconds)).setStyle(Style.EMPTY.withColor(Formatting.YELLOW)), 0, 30, 10);
306-
player.playSoundToPlayer(SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), SoundCategory.PLAYERS, 1, 1.3f);
306+
player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), 1, 1.3f);
307307
}
308308
if (stateSeconds <= 5) {
309309
TextUtil.sendSubtitle(player, Text.literal(String.valueOf(stateSeconds)).setStyle(Style.EMPTY.withColor(Formatting.RED)), 0, 20, 0);
310-
player.playSoundToPlayer(SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), SoundCategory.PLAYERS, 1, 1.6f);
310+
player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), 1, 1.6f);
311311
}
312312
} else {
313313
data.bar.setColor(BossBar.Color.GREEN);
314314
}
315315
if (stateSeconds == 0 && (stateMinutes == 1 || stateMinutes == 2)) {
316316
TextUtil.sendSubtitle(player, Text.literal(String.valueOf(60)).setStyle(Style.EMPTY.withColor(Formatting.GREEN)), 0, 40, 20);
317-
player.playSoundToPlayer(SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), SoundCategory.PLAYERS, 1, 1);
317+
player.playSound(SoundEvents.BLOCK_NOTE_BLOCK_BELL.value(), 1, 1);
318318
}
319319
}
320320
data.bar.setPercent(statePercent);
@@ -394,7 +394,7 @@ public void eliminate(PlayerData data) {
394394
player.sendMessage(TextUtil.translatable(TextUtil.SKULL, TextUtil.DANGER, "text.build_rush.eliminated.self", player.getName().getString()));
395395
TextUtil.clearSubtitle(player);
396396
TextUtil.sendTitle(player, TextUtil.translatable(TextUtil.DANGER, "title.build_rush.eliminated"), 0, 5 * 20, 20);
397-
player.playSoundToPlayer(SoundEvents.ENTITY_BLAZE_DEATH, SoundCategory.PLAYERS, 1, 2f);
397+
player.playSound(SoundEvents.ENTITY_BLAZE_DEATH, 1, 2f);
398398
}
399399
this.refreshSidebar();
400400

@@ -691,7 +691,7 @@ public void onBlockPlaced(ServerPlayerEntity player) {
691691
data.score = this.maxScore;
692692
//TODO: store and send time
693693
player.sendMessage(TextUtil.translatable(TextUtil.CHECKMARK, TextUtil.SUCCESS, "text.build_rush.finished"), false);
694-
player.playSoundToPlayer(SoundEvents.ENTITY_PLAYER_LEVELUP, SoundCategory.PLAYERS, 1.0f, 1.0f);
694+
player.playSound(SoundEvents.ENTITY_PLAYER_LEVELUP, 1.0f, 1.0f);
695695
resetPlayer(player, false);
696696
TextUtil.clearTitle(player);
697697
}
@@ -926,7 +926,7 @@ public void startElimination() {
926926

927927
if (data.score == this.maxScore) {
928928
TextUtil.sendSubtitle(player, Text.translatable("title.build_rush.perfect").setStyle(Style.EMPTY.withColor(TextUtil.LEGENDARY).withBold(true)), 0, 3 * 20, 10);
929-
player.playSoundToPlayer(SoundEvents.ENTITY_PLAYER_LEVELUP, SoundCategory.PLAYERS, 1.0f, 1.0f);
929+
player.playSound(SoundEvents.ENTITY_PLAYER_LEVELUP, 1.0f, 1.0f);
930930
} else {
931931
float scorePercentage = data.score / (float) this.maxScore;
932932
String scoreAsPercent = String.format("%.2f", scorePercentage * 100).replaceAll("0*$", "").replaceAll("[,.]$", "");
@@ -935,7 +935,7 @@ public void startElimination() {
935935

936936
player.sendMessage(TextUtil.translatable(TextUtil.DASH, TextUtil.NEUTRAL, "text.build_rush.score", scoreText), false);
937937
TextUtil.sendSubtitle(player, scoreText, 0, 2 * 20, 5);
938-
player.playSoundToPlayer(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundCategory.PLAYERS, 1.0f, 1.0f);
938+
player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0f, 1.0f);
939939
}
940940
}
941941

src/main/java/fr/hugman/build_rush/map/BRMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import fr.hugman.build_rush.BRConfig;
44
import net.minecraft.server.world.ServerWorld;
55
import net.minecraft.text.Text;
6-
import net.minecraft.world.GameRules;
6+
import net.minecraft.world.rule.GameRules;
77
import xyz.nucleoid.fantasy.RuntimeWorldConfig;
88
import xyz.nucleoid.map_templates.BlockBounds;
99
import xyz.nucleoid.map_templates.MapTemplateSerializer;
@@ -24,7 +24,7 @@ public static BRMap from(GameOpenContext<BRConfig> context) throws IOException {
2424
var metadata = template.getMetadata();
2525

2626
var worldConfig = new RuntimeWorldConfig().setGenerator(new TemplateChunkGenerator(server, template))
27-
.setGameRule(GameRules.DO_FIRE_TICK, false)
27+
.setGameRule(GameRules.FIRE_SPREAD_RADIUS_AROUND_PLAYER, -1)
2828
.setGameRule(GameRules.FIRE_DAMAGE, false)
2929
.setGameRule(GameRules.FREEZE_DAMAGE, false)
3030
.setGameRule(GameRules.DO_MOB_GRIEFING, false)

src/main/java/fr/hugman/build_rush/misc/CachedBlocks.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
package fr.hugman.build_rush.misc;
22

3+
import fr.hugman.build_rush.BuildRush;
34
import net.minecraft.block.BlockState;
45
import net.minecraft.nbt.NbtCompound;
56
import net.minecraft.server.world.ServerWorld;
7+
import net.minecraft.storage.NbtReadView;
8+
import net.minecraft.storage.NbtWriteView;
9+
import net.minecraft.util.ErrorReporter;
610
import net.minecraft.util.math.BlockPos;
711
import net.minecraft.util.math.Vec3i;
812
import xyz.nucleoid.map_templates.BlockBounds;
@@ -55,7 +59,10 @@ public void place(ServerWorld world, BlockPos origin) {
5559
var nbt = entry.getValue();
5660
var entity = world.getBlockEntity(targetPos);
5761
if (entity != null) {
58-
entity.read(nbt, world.getRegistryManager());
62+
try (ErrorReporter.Logging errorReporter = new ErrorReporter.Logging(entity.getReporterContext(), BuildRush.LOGGER)) {
63+
var view = NbtReadView.create(errorReporter, world.getRegistryManager(), nbt);
64+
entity.read(view);
65+
}
5966
}
6067
}
6168
}

0 commit comments

Comments
 (0)