mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
TrialSpawner compile fixes
This commit is contained in:
@@ -36,3 +36,39 @@
|
||||
for (ItemStack itemStack : randomItems) {
|
||||
DefaultDispenseItemBehavior.spawnItem(level, itemStack, 2, Direction.UP, Vec3.atBottomCenterOf(pos).relative(Direction.UP, 1.2));
|
||||
}
|
||||
@@ -402,6 +_,35 @@
|
||||
this.requiredPlayerRange
|
||||
);
|
||||
}
|
||||
+
|
||||
+ // Paper start - trial spawner API - withers
|
||||
+ public TrialSpawner.FullConfig overrideTargetCooldownLength(final int targetCooldownLength) {
|
||||
+ return new TrialSpawner.FullConfig(
|
||||
+ this.normal,
|
||||
+ this.ominous,
|
||||
+ targetCooldownLength,
|
||||
+ this.requiredPlayerRange
|
||||
+ );
|
||||
+ }
|
||||
+
|
||||
+ public TrialSpawner.FullConfig overrideRequiredPlayerRange(final int requiredPlayerRange) {
|
||||
+ return new TrialSpawner.FullConfig(
|
||||
+ this.normal,
|
||||
+ this.ominous,
|
||||
+ this.targetCooldownLength,
|
||||
+ requiredPlayerRange
|
||||
+ );
|
||||
+ }
|
||||
+
|
||||
+ public TrialSpawner.FullConfig overrideConfigs(final Holder<TrialSpawnerConfig> normal, final Holder<TrialSpawnerConfig> ominous) {
|
||||
+ return new TrialSpawner.FullConfig(
|
||||
+ normal,
|
||||
+ ominous,
|
||||
+ this.targetCooldownLength,
|
||||
+ this.requiredPlayerRange
|
||||
+ );
|
||||
+ }
|
||||
+ // Paper end - trial spawner API - withers
|
||||
}
|
||||
|
||||
public interface StateAccessor {
|
||||
|
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/world/level/storage/TagValueInput.java
|
||||
+++ b/net/minecraft/world/level/storage/TagValueInput.java
|
||||
@@ -37,6 +_,16 @@
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
+ // Paper start - utility methods
|
||||
+ public static ValueInput createGlobalDiscarding(final CompoundTag compoundTag) {
|
||||
+ return create(ProblemReporter.DISCARDING, net.minecraft.server.MinecraftServer.getServer().registryAccess(), compoundTag);
|
||||
+ }
|
||||
+
|
||||
+ public static ValueInput createDiscarding(final HolderLookup.Provider provider, final CompoundTag compoundTag) {
|
||||
+ return create(ProblemReporter.DISCARDING, provider, compoundTag);
|
||||
+ }
|
||||
+ // Paper end - utility methods
|
||||
+
|
||||
public static ValueInput create(ProblemReporter problemReporter, HolderLookup.Provider lookup, CompoundTag input) {
|
||||
return new TagValueInput(problemReporter, new ValueInputContextHelper(lookup, NbtOps.INSTANCE), input);
|
||||
}
|
Reference in New Issue
Block a user