Update deps and mappings.
This commit is contained in:
parent
b0ddb4cc95
commit
0ba85b37cc
22 changed files with 108 additions and 110 deletions
|
@ -15,12 +15,12 @@ import net.minecraft.client.util.math.MatrixStack;
|
|||
import net.minecraft.fluid.FluidState;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.random.AbstractRandom;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.world.BlockRenderView;
|
||||
import net.minecraft.world.BlockView;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import java.util.function.BiPredicate;
|
||||
|
||||
/**
|
||||
|
@ -47,7 +47,7 @@ record HologramRenderer(BlockRenderView view, MatrixStack matrix, VertexConsumer
|
|||
} else {
|
||||
matrix.translate(-0.5, -0.5, -0.5);
|
||||
VertexConsumer consumer = vertexConsumerProvider.getBuffer(RenderLayers.getBlockLayer(state));
|
||||
blockRenderManager.renderBlock(state, OUT_OF_WORLD_POS, view, matrix, consumer, false, AbstractRandom.create());
|
||||
blockRenderManager.renderBlock(state, OUT_OF_WORLD_POS, view, matrix, consumer, false, Random.create());
|
||||
}
|
||||
|
||||
matrix.pop();
|
||||
|
|
|
@ -29,10 +29,10 @@ import com.mojang.brigadier.Command;
|
|||
import com.mojang.brigadier.CommandDispatcher;
|
||||
import com.mojang.brigadier.arguments.StringArgumentType;
|
||||
import com.mojang.brigadier.context.CommandContext;
|
||||
import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
import com.mojang.brigadier.suggestion.SuggestionProvider;
|
||||
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.command.CommandRegistryAccess;
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.command.argument.EntityArgumentType;
|
||||
import net.minecraft.command.argument.ItemStackArgumentType;
|
||||
|
@ -72,10 +72,10 @@ public class RebornCoreCommands {
|
|||
CommandSource.suggestMatching(FabricLoader.getInstance().getAllMods().stream().map(modContainer -> modContainer.getMetadata().getId()), builder);
|
||||
|
||||
public static void setup() {
|
||||
CommandRegistrationCallback.EVENT.register(((dispatcher, isDedicated) -> RebornCoreCommands.addCommands(dispatcher)));
|
||||
CommandRegistrationCallback.EVENT.register((RebornCoreCommands::addCommands));
|
||||
}
|
||||
|
||||
private static void addCommands(CommandDispatcher<ServerCommandSource> dispatcher) {
|
||||
private static void addCommands(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess registryAccess, CommandManager.RegistrationEnvironment environment) {
|
||||
dispatcher.register(
|
||||
literal("reborncore")
|
||||
|
||||
|
@ -108,14 +108,13 @@ public class RebornCoreCommands {
|
|||
.executes(RebornCoreCommands::renderMod)
|
||||
)
|
||||
)
|
||||
// TODO 1.19: Waiting on https://github.com/FabricMC/fabric/pull/2227
|
||||
// .then(
|
||||
// literal("item")
|
||||
// .then(
|
||||
// argument("item", ItemStackArgumentType.itemStack())
|
||||
// .executes(RebornCoreCommands::itemRenderer)
|
||||
// )
|
||||
// )
|
||||
.then(
|
||||
literal("item")
|
||||
.then(
|
||||
argument("item", ItemStackArgumentType.itemStack(registryAccess))
|
||||
.executes(RebornCoreCommands::itemRenderer)
|
||||
)
|
||||
)
|
||||
.then(
|
||||
literal("hand")
|
||||
.executes(RebornCoreCommands::handRenderer)
|
||||
|
|
|
@ -3,11 +3,10 @@ package reborncore.common.util;
|
|||
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.random.AbstractRandom;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.village.TradeOffer;
|
||||
import net.minecraft.village.TradeOffers;
|
||||
import net.minecraft.village.VillagerProfession;
|
||||
|
@ -15,7 +14,6 @@ import org.jetbrains.annotations.Contract;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class TradeUtils {
|
||||
|
@ -57,7 +55,7 @@ public final class TradeUtils {
|
|||
|
||||
@Nullable
|
||||
@Override
|
||||
public TradeOffer create(Entity entity, AbstractRandom random) {
|
||||
public TradeOffer create(Entity entity, Random random) {
|
||||
return copy(offer);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.util.math.Vec3d;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
|
||||
/**
|
||||
* Created by Mark on 13/03/2016.
|
||||
|
@ -59,7 +59,7 @@ public class WorldUtils {
|
|||
|
||||
|
||||
public static void dropItem(ItemStack itemStack, World world, BlockPos pos) {
|
||||
Random rand = new Random();
|
||||
Random rand = Random.create();
|
||||
|
||||
float dX = rand.nextFloat() * 0.8F + 0.1F;
|
||||
float dY = rand.nextFloat() * 0.8F + 0.1F;
|
||||
|
|
|
@ -1,49 +1,52 @@
|
|||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "reborncore",
|
||||
"version": "${version}",
|
||||
"name": "Reborn Core",
|
||||
"icon": "assets/reborncore/icon.png",
|
||||
"description": "Reborn Core is a library used for many of the Tech Reborn team's mods, including Tech Reborn, Quantum Storage, Fluxed Redstone, Hardcore Map Reset, and many more.",
|
||||
"license": "MIT",
|
||||
"contact": {
|
||||
"homepage": "https://www.curseforge.com/minecraft/mc-mods/reborncore",
|
||||
"sources": "https://github.com/TechReborn/RebornCore",
|
||||
"issues": "https://github.com/TechReborn/RebornCore/issues"
|
||||
},
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"reborncore.RebornCore"
|
||||
],
|
||||
"client": [
|
||||
"reborncore.RebornCoreClient"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"reborncore.client.mixins.json",
|
||||
"reborncore.common.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.6",
|
||||
"fabric": ">=0.52.4",
|
||||
"team_reborn_energy": ">=2.2.0",
|
||||
"fabric-biome-api-v1": ">=3.0.0",
|
||||
"minecraft": "~1.19-beta.1"
|
||||
},
|
||||
"authors": [
|
||||
"Team Reborn",
|
||||
"modmuss50",
|
||||
"drcrazy"
|
||||
],
|
||||
"contributors": [
|
||||
"Gigabit101",
|
||||
"Prospector",
|
||||
"Rushmead",
|
||||
"Dragon2488",
|
||||
"Ourten",
|
||||
"coderbot",
|
||||
"estebes"
|
||||
],
|
||||
"accessWidener": "reborncore.accesswidener"
|
||||
"schemaVersion": 1,
|
||||
"id": "reborncore",
|
||||
"version": "${version}",
|
||||
"name": "Reborn Core",
|
||||
"icon": "assets/reborncore/icon.png",
|
||||
"description": "Reborn Core is a library used for many of the Tech Reborn team's mods, including Tech Reborn, Quantum Storage, Fluxed Redstone, Hardcore Map Reset, and many more.",
|
||||
"license": "MIT",
|
||||
"contact": {
|
||||
"homepage": "https://www.curseforge.com/minecraft/mc-mods/reborncore",
|
||||
"sources": "https://github.com/TechReborn/RebornCore",
|
||||
"issues": "https://github.com/TechReborn/RebornCore/issues"
|
||||
},
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"reborncore.RebornCore"
|
||||
],
|
||||
"client": [
|
||||
"reborncore.RebornCoreClient"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"reborncore.common.mixins.json",
|
||||
{
|
||||
"config": "reborncore.client.mixins.json",
|
||||
"environment": "client"
|
||||
}
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.6",
|
||||
"fabric": ">=0.52.4",
|
||||
"team_reborn_energy": ">=2.2.0",
|
||||
"fabric-biome-api-v1": ">=3.0.0",
|
||||
"minecraft": "~1.19-beta.1"
|
||||
},
|
||||
"authors": [
|
||||
"Team Reborn",
|
||||
"modmuss50",
|
||||
"drcrazy"
|
||||
],
|
||||
"contributors": [
|
||||
"Gigabit101",
|
||||
"Prospector",
|
||||
"Rushmead",
|
||||
"Dragon2488",
|
||||
"Ourten",
|
||||
"coderbot",
|
||||
"estebes"
|
||||
],
|
||||
"accessWidener": "reborncore.accesswidener"
|
||||
}
|
|
@ -208,11 +208,13 @@ dependencies {
|
|||
|
||||
include project(":RebornCore")
|
||||
|
||||
// Blocked on https://github.com/shedaniel/RoughlyEnoughItems/issues/856
|
||||
disabledOptionalDependency "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
|
||||
optionalDependency "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"
|
||||
disabledOptionalDependency "com.github.emilyploszaj:trinkets:${project.trinkets_version}"
|
||||
disabledOptionalDependency "net.oskarstrom:DashLoader:${project.dashloader_version}"
|
||||
|
||||
// REI's deps depend on the deprecated command module.
|
||||
modRuntimeOnly "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fapi_version}"
|
||||
|
||||
// Use groovy for datagen/gametest, if you are copying this you prob dont want it.
|
||||
gametestImplementation 'org.apache.groovy:groovy:4.0.1'
|
||||
datagenImplementation 'org.apache.groovy:groovy:4.0.1'
|
||||
|
|
|
@ -7,12 +7,12 @@ org.gradle.jvmargs=-Xmx2G
|
|||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.19-pre1
|
||||
yarn_version=1.19-pre1+build.1
|
||||
yarn_version=1.19-pre1+build.7
|
||||
loader_version=0.14.6
|
||||
fapi_version=0.52.4+1.19
|
||||
fapi_version=0.53.1+1.19
|
||||
|
||||
# Dependencies
|
||||
energy_version=2.2.0
|
||||
rei_version=9.0.458
|
||||
rei_version=9.0.462
|
||||
trinkets_version=3.0.2
|
||||
dashloader_version=2.0
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"client": [
|
||||
"techreborn.TechRebornClient"
|
||||
],
|
||||
"rei": [
|
||||
"rei_client": [
|
||||
"techreborn.client.compat.rei.ReiPlugin"
|
||||
]
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue