Update deps and mappings.

This commit is contained in:
modmuss50 2022-05-21 19:00:33 +01:00
parent b0ddb4cc95
commit 0ba85b37cc
22 changed files with 108 additions and 110 deletions

View file

@ -46,7 +46,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.AbstractRandom;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockRenderView;
import org.jetbrains.annotations.Nullable;
import reborncore.client.RenderUtil;
@ -66,7 +66,7 @@ public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBa
public abstract ModelIdentifier getFluidModel();
@Override
public void emitItemQuads(ItemStack stack, Supplier<AbstractRandom> randomSupplier, RenderContext context) {
public void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context) {
Fluid fluid = Fluids.EMPTY;
if (stack.getItem() instanceof ItemFluidInfo fluidInfo) {
fluid = fluidInfo.getFluid(stack);
@ -106,12 +106,12 @@ public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBa
}
@Override
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<AbstractRandom> randomSupplier, RenderContext context) {
public void emitBlockQuads(BlockRenderView blockView, BlockState state, BlockPos pos, Supplier<Random> randomSupplier, RenderContext context) {
}
@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction face, AbstractRandom random) {
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction face, Random random) {
return Collections.emptyList();
}

View file

@ -32,7 +32,7 @@ import net.minecraft.client.texture.SpriteAtlasTexture;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.random.AbstractRandom;
import net.minecraft.util.math.random.Random;
import techreborn.TechReborn;
import java.util.function.Supplier;
@ -45,7 +45,7 @@ public class DynamicCellBakedModel extends BaseDynamicFluidBakedModel {
private static final ModelIdentifier CELL_GLASS = new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_glass"), "inventory");
@Override
public void emitItemQuads(ItemStack stack, Supplier<AbstractRandom> randomSupplier, RenderContext context) {
public void emitItemQuads(ItemStack stack, Supplier<Random> randomSupplier, RenderContext context) {
super.emitItemQuads(stack, randomSupplier, context);
BakedModelManager bakedModelManager = MinecraftClient.getInstance().getBakedModelManager();

View file

@ -34,11 +34,11 @@ import net.minecraft.client.render.block.BlockRenderManager;
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactory;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.random.AbstractRandom;
import net.minecraft.util.math.random.Random;
import techreborn.blockentity.cable.CableBlockEntity;
import techreborn.blocks.cable.CableBlock;
import java.util.Random;
import net.minecraft.util.math.random.Random;
public class CableCoverRenderer implements BlockEntityRenderer<CableBlockEntity> {
@ -57,7 +57,7 @@ public class CableCoverRenderer implements BlockEntityRenderer<CableBlockEntity>
final BlockRenderManager blockRenderManager = MinecraftClient.getInstance().getBlockRenderManager();
BlockState coverState = blockEntity.getCover() != null ? blockEntity.getCover() : Blocks.OAK_PLANKS.getDefaultState();
VertexConsumer consumer = vertexConsumers.getBuffer(RenderLayers.getBlockLayer(coverState));
blockRenderManager.renderBlock(coverState, blockEntity.getPos(), blockEntity.getWorld(), matrices, consumer, true, AbstractRandom.create());
blockRenderManager.renderBlock(coverState, blockEntity.getPos(), blockEntity.getWorld(), matrices, consumer, true, Random.create());
}
}

View file

@ -30,13 +30,12 @@ import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;
import techreborn.blockentity.GuiType;
import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
import techreborn.blocks.GenericMachineBlock;
import java.util.Random;
public class IronAlloyFurnaceBlock extends GenericMachineBlock {
public IronAlloyFurnaceBlock() {
@ -44,6 +43,7 @@ public class IronAlloyFurnaceBlock extends GenericMachineBlock {
}
// Block
@Override
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
if (!isActive(stateIn)) {
return;

View file

@ -30,13 +30,12 @@ import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;
import techreborn.blockentity.GuiType;
import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity;
import techreborn.blocks.GenericMachineBlock;
import java.util.Random;
public class IronFurnaceBlock extends GenericMachineBlock {
public IronFurnaceBlock() {
@ -44,6 +43,7 @@ public class IronFurnaceBlock extends GenericMachineBlock {
}
// Block
@Override
public void randomDisplayTick(BlockState stateIn, World worldIn, BlockPos pos, Random rand) {
if (!isActive(stateIn)) {
return;

View file

@ -43,7 +43,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.AbstractRandom;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
import reborncore.common.util.WorldUtils;
@ -54,7 +54,7 @@ import techreborn.init.TRContent;
import techreborn.items.tool.TreeTapItem;
import techreborn.items.tool.basic.ElectricTreetapItem;
import java.util.Random;
import net.minecraft.util.math.random.Random;
/**
* Created by modmuss50 on 19/02/2016.
@ -112,7 +112,7 @@ public class BlockRubberLog extends PillarBlock {
@SuppressWarnings("deprecation")
@Override
public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, AbstractRandom random) {
public void randomTick(BlockState state, ServerWorld worldIn, BlockPos pos, Random random) {
super.randomTick(state, worldIn, pos, random);
if (state.get(AXIS) != Direction.Axis.Y) return;
if (!state.get(SHOULD_SAP)) return;

View file

@ -46,7 +46,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.items.DynamicCellItem;
import java.util.List;
import java.util.Random;
import net.minecraft.util.math.random.Random;
/**
* Created by drcrazy on 10-Jan-20 for TechReborn-1.15.
@ -58,7 +58,7 @@ public class TRDispenserBehavior {
DispenserBlock.registerBehavior(TRContent.SCRAP_BOX, new ItemDispenserBehavior() {
public ItemStack dispenseSilently(BlockPointer pointer, ItemStack stack) {
List<RebornRecipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(pointer.getWorld());
int random = new Random().nextInt(scrapboxRecipeList.size());
int random = Random.create().nextInt(scrapboxRecipeList.size());
ItemStack out = scrapboxRecipeList.get(random).getOutputs().get(0).copy();
stack.split(1);

View file

@ -27,7 +27,7 @@ package techreborn.init.template;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.command.v1.CommandRegistrationCallback;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.text.Text;
@ -46,7 +46,7 @@ import static net.minecraft.server.command.CommandManager.literal;
public class TechRebornTemplates {
public static void init() {
CommandRegistrationCallback.EVENT.register((dispatcher, b) -> dispatcher.register(
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> dispatcher.register(
literal("techreborn")
.then(literal("template")
.requires(source -> source.hasPermissionLevel(3))

View file

@ -38,7 +38,7 @@ import reborncore.common.util.ItemUtils;
import techreborn.TechReborn;
import techreborn.utils.InitUtils;
import java.util.Random;
import net.minecraft.util.math.random.Random;
public class ChainsawItem extends AxeItem implements RcEnergyItem {
@ -72,8 +72,7 @@ public class ChainsawItem extends AxeItem implements RcEnergyItem {
// MiningToolItem
@Override
public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) {
Random rand = new Random();
if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
if (worldIn.getRandom().nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
tryUseEnergy(stack, cost);
}
return true;

View file

@ -40,7 +40,7 @@ import techreborn.TechReborn;
import techreborn.utils.InitUtils;
import techreborn.utils.ToolsUtil;
import java.util.Random;
import net.minecraft.util.math.random.Random;
public class JackhammerItem extends PickaxeItem implements RcEnergyItem {
public final int maxCharge;
@ -85,8 +85,7 @@ public class JackhammerItem extends PickaxeItem implements RcEnergyItem {
// MiningToolItem
@Override
public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) {
Random rand = new Random();
if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
if (worldIn.getRandom().nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
tryUseEnergy(stack, cost);
}
return true;

View file

@ -41,7 +41,7 @@ import techreborn.config.TechRebornConfig;
import techreborn.init.TRContent;
import techreborn.init.TRToolMaterials;
import java.util.Random;
import net.minecraft.util.math.random.Random;
public class RockCutterItem extends PickaxeItem implements RcEnergyItem {
@ -72,8 +72,7 @@ public class RockCutterItem extends PickaxeItem implements RcEnergyItem {
// MiningToolItem
@Override
public boolean postMine(ItemStack stack, World worldIn, BlockState blockIn, BlockPos pos, LivingEntity entityLiving) {
Random rand = new Random();
if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
if (worldIn.getRandom().nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, stack) + 1) == 0) {
tryUseEnergy(stack, cost);
}
return true;

View file

@ -41,7 +41,7 @@ import reborncore.common.powerSystem.RcEnergyItem;
import java.util.Collections;
import java.util.HashSet;
import java.util.Random;
import net.minecraft.util.math.random.Random;
import java.util.Set;
/**
@ -56,8 +56,7 @@ public class ToolsUtil {
if (blockState.getHardness(world, pos) == -1.0F) {
return;
}
Random rand = new Random();
if (rand.nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, tool) + 1) == 0) {
if (world.getRandom().nextInt(EnchantmentHelper.getLevel(Enchantments.UNBREAKING, tool) + 1) == 0) {
if (!((RcEnergyItem) tool.getItem()).tryUseEnergy(tool, cost)) {
return;
}

View file

@ -25,18 +25,18 @@
package techreborn.world;
import net.minecraft.block.sapling.SaplingGenerator;
import net.minecraft.util.math.random.AbstractRandom;
import net.minecraft.util.math.random.Random;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import org.jetbrains.annotations.Nullable;
import java.util.Random;
import net.minecraft.util.math.random.Random;
public class RubberSaplingGenerator extends SaplingGenerator {
@Nullable
@Override
protected RegistryEntry<? extends ConfiguredFeature<?, ?>> getTreeFeature(AbstractRandom random, boolean bees) {
protected RegistryEntry<? extends ConfiguredFeature<?, ?>> getTreeFeature(Random random, boolean bees) {
return WorldGenerator.getEntry(BuiltinRegistries.CONFIGURED_FEATURE, WorldGenerator.RUBBER_TREE_FEATURE);
}
}

View file

@ -37,7 +37,7 @@ import net.minecraft.world.gen.treedecorator.TreeDecoratorType;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import net.minecraft.util.math.random.Random;
import java.util.function.BiConsumer;
public class RubberTreeSpikeDecorator extends TreeDecorator {

View file

@ -19,7 +19,7 @@
"client": [
"techreborn.TechRebornClient"
],
"rei": [
"rei_client": [
"techreborn.client.compat.rei.ReiPlugin"
]
},