mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Port to 22w14a
This commit is contained in:
@@ -19,14 +19,13 @@
|
||||
|
||||
package dev.architectury.registry.level.entity.trade;
|
||||
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.npc.VillagerTrades;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.trading.MerchantOffer;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* This class is the easiest implementation of a trade object.
|
||||
* All trades added by vanilla do have custom classes like {@link VillagerTrades.EmeraldForItems}, but they aren't accessible.
|
||||
@@ -56,7 +55,7 @@ public record SimpleTrade(ItemStack primaryPrice, ItemStack secondaryPrice,
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public MerchantOffer getOffer(Entity entity, Random random) {
|
||||
public MerchantOffer getOffer(Entity entity, RandomSource random) {
|
||||
return new MerchantOffer(this.primaryPrice, this.secondaryPrice, this.sale, this.maxTrades, this.experiencePoints, this.priceMultiplier);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package dev.architectury.mixin.fabric;
|
||||
import dev.architectury.event.events.common.EntityEvent;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.entity.MobSpawnType;
|
||||
import net.minecraft.world.entity.monster.PatrollingMonster;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
@@ -49,7 +50,7 @@ public abstract class MixinPatrolSpawner {
|
||||
cancellable = true,
|
||||
locals = LocalCapture.CAPTURE_FAILHARD
|
||||
)
|
||||
private void checkPatrolSpawn(ServerLevel level, BlockPos pos, Random r, boolean b, CallbackInfoReturnable<Boolean> cir, BlockState blockState, PatrollingMonster entity) {
|
||||
private void checkPatrolSpawn(ServerLevel level, BlockPos pos, RandomSource r, boolean b, CallbackInfoReturnable<Boolean> cir, BlockState blockState, PatrollingMonster entity) {
|
||||
var result = EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(entity, level, pos.getX(), pos.getY(), pos.getZ(), MobSpawnType.PATROL, null);
|
||||
if (result.value() != null) {
|
||||
cir.setReturnValue(result.value());
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.stats.ServerStatsCounter;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.DifficultyInstance;
|
||||
import net.minecraft.world.entity.MobSpawnType;
|
||||
import net.minecraft.world.entity.SpawnGroupData;
|
||||
@@ -39,7 +40,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
|
||||
@Mixin(PhantomSpawner.class)
|
||||
public abstract class MixinPhantomSpawner {
|
||||
@@ -56,7 +56,7 @@ public abstract class MixinPhantomSpawner {
|
||||
locals = LocalCapture.CAPTURE_FAILSOFT // SOFT, because this will break in 2 seconds
|
||||
)
|
||||
private void checkPhantomSpawn(ServerLevel level, boolean bl, boolean bl2, CallbackInfoReturnable<Integer> cir,
|
||||
Random random, int i, Iterator<ServerPlayer> it, Player player, BlockPos pos, DifficultyInstance diff,
|
||||
RandomSource random, int i, Iterator<ServerPlayer> it, Player player, BlockPos pos, DifficultyInstance diff,
|
||||
ServerStatsCounter serverStatsCounter, int j, int k, BlockPos pos2,
|
||||
BlockState blockState, FluidState fluidState, SpawnGroupData sgd, int l, int m, Phantom entity) {
|
||||
if (EntityEvent.LIVING_CHECK_SPAWN.invoker().canSpawn(entity, level, pos.getX(), pos.getY(), pos.getZ(), MobSpawnType.NATURAL, null).value() == Boolean.FALSE) {
|
||||
|
||||
@@ -27,9 +27,9 @@ import net.minecraft.client.renderer.texture.TextureAtlas;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.core.particles.ParticleOptions;
|
||||
import net.minecraft.core.particles.ParticleType;
|
||||
import net.minecraft.util.RandomSource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class ParticleProviderRegistryImpl {
|
||||
public record ExtendedSpriteSetImpl(
|
||||
@@ -51,7 +51,7 @@ public class ParticleProviderRegistryImpl {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite get(Random random) {
|
||||
public TextureAtlasSprite get(RandomSource random) {
|
||||
return delegate.get(random);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ org.gradle.daemon=false
|
||||
|
||||
forgeEnabled=false
|
||||
|
||||
minecraft_version=22w13a
|
||||
supported_version=22w13a
|
||||
minecraft_version=22w14a
|
||||
supported_version=22w14a
|
||||
|
||||
cf_type=beta
|
||||
|
||||
@@ -14,7 +14,7 @@ base_version=5.1
|
||||
maven_group=dev.architectury
|
||||
|
||||
fabric_loader_version=0.13.3
|
||||
fabric_api_version=0.49.5+1.19
|
||||
fabric_api_version=0.49.6+1.19
|
||||
mod_menu_version=3.1.0
|
||||
|
||||
forge_version=40.0.1
|
||||
|
||||
Reference in New Issue
Block a user