Continue migration
This commit is contained in:
parent
47ed597358
commit
33dbfbe633
263 changed files with 1450 additions and 1486 deletions
|
@ -5,7 +5,7 @@ import java.util.Map;
|
|||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.minecraft.world.item.ItemConvertible;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import ru.betterend.blocks.HydraluxPetalColoredBlock;
|
||||
import ru.betterend.blocks.complex.ColoredMaterial;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -27,7 +27,7 @@ public class FlamboyantRefabricatedIntegration extends ModIntegration {
|
|||
*/
|
||||
|
||||
Map<Integer, String> colors = Maps.newHashMap();
|
||||
Map<Integer, ItemConvertible> dyes = Maps.newHashMap();
|
||||
Map<Integer, ItemLike> dyes = Maps.newHashMap();
|
||||
/*
|
||||
* for (Object val: values) { Integer color = (Integer) getFieldValue(fDyeColor,
|
||||
* "signColor", val); String name = (String) getFieldValue(fDyeColor, "name",
|
||||
|
@ -56,7 +56,7 @@ public class FlamboyantRefabricatedIntegration extends ModIntegration {
|
|||
new ColoredMaterial(HydraluxPetalColoredBlock::new, EndBlocks.HYDRALUX_PETAL_BLOCK, colors, dyes, true);
|
||||
}
|
||||
|
||||
private void addColor(String hex, String name, Map<Integer, String> colors, Map<Integer, ItemConvertible> dyes) {
|
||||
private void addColor(String hex, String name, Map<Integer, String> colors, Map<Integer, ItemLike> dyes) {
|
||||
int color = MHelper.color(hex);
|
||||
colors.put(color, name);
|
||||
dyes.put(color, getItem(name + "_dye"));
|
||||
|
|
|
@ -13,15 +13,15 @@ import net.minecraft.world.item.Item;
|
|||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tags.Tag.Identified;
|
||||
import net.minecraft.tags.Tag.Named;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.world.features.EndFeature;
|
||||
|
||||
|
@ -54,8 +54,8 @@ public abstract class ModIntegration {
|
|||
return getBlock(name).defaultBlockState();
|
||||
}
|
||||
|
||||
public RegistryKey<Biome> getKey(String name) {
|
||||
return RegistryKey.of(Registry.BIOME_KEY, getID(name));
|
||||
public ResourceKey<Biome> getKey(String name) {
|
||||
return ResourceKey.of(Registry.BIOME_KEY, getID(name));
|
||||
}
|
||||
|
||||
public boolean modIsInstalled() {
|
||||
|
@ -196,13 +196,13 @@ public abstract class ModIntegration {
|
|||
return null;
|
||||
}
|
||||
|
||||
public Tag.Identified<Item> getItemTag(String name) {
|
||||
public Tag.Named<Item> getItemTag(String name) {
|
||||
ResourceLocation id = getID(name);
|
||||
Tag<Item> tag = ItemTags.getTagGroup().getTag(id);
|
||||
return tag == null ? (Identified<Item>) TagRegistry.item(id) : (Identified<Item>) tag;
|
||||
}
|
||||
|
||||
public Tag.Identified<Block> getBlockTag(String name) {
|
||||
public Tag.Named<Block> getBlockTag(String name) {
|
||||
ResourceLocation id = getID(name);
|
||||
Tag<Block> tag = BlockTags.getTagGroup().getTag(id);
|
||||
return tag == null ? (Identified<Block>) TagRegistry.block(id) : (Identified<Block>) tag;
|
||||
|
|
|
@ -12,10 +12,10 @@ public class NourishIntegration extends ModIntegration {
|
|||
|
||||
@Override
|
||||
public void register() {
|
||||
Tag.Identified<Item> fats = getItemTag("fats");
|
||||
Tag.Identified<Item> fruit = getItemTag("fruit");
|
||||
Tag.Identified<Item> protein = getItemTag("protein");
|
||||
Tag.Identified<Item> sweets = getItemTag("sweets");
|
||||
Tag.Named<Item> fats = getItemTag("fats");
|
||||
Tag.Named<Item> fruit = getItemTag("fruit");
|
||||
Tag.Named<Item> protein = getItemTag("protein");
|
||||
Tag.Named<Item> sweets = getItemTag("sweets");
|
||||
|
||||
TagHelper.addTag(fats, EndItems.END_FISH_RAW, EndItems.END_FISH_COOKED);
|
||||
TagHelper.addTag(fruit, EndItems.SHADOW_BERRY_RAW, EndItems.SHADOW_BERRY_COOKED, EndItems.BLOSSOM_BERRY,
|
||||
|
|
|
@ -5,8 +5,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.collection.WeightedList;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.ModIntegration;
|
||||
import ru.betterend.integration.byg.biomes.BYGBiomes;
|
||||
|
|
|
@ -3,8 +3,8 @@ package ru.betterend.integration.byg.biomes;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.world.entity.SpawnGroup;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||
import ru.betterend.BetterEnd;
|
||||
|
|
|
@ -4,8 +4,8 @@ import java.util.List;
|
|||
|
||||
import net.minecraft.world.entity.SpawnGroup;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||
import net.minecraft.world.gen.GenerationStep.Feature;
|
||||
|
|
|
@ -6,16 +6,16 @@ import java.util.function.Supplier;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.entity.SpawnGroup;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||
import net.minecraft.world.gen.GenerationStep.Feature;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeatures;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||
|
@ -33,7 +33,7 @@ public class OldBulbisGardens extends EndBiome {
|
|||
BiomeEffects effects = biome.getEffects();
|
||||
|
||||
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
||||
Block origin = biome.getGenerationSettings().getSurfaceConfig().getTopMaterial().getBlock();
|
||||
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
|
||||
BiomeDefinition def = new BiomeDefinition("old_bulbis_gardens").setFogColor(215, 132, 207).setFogDensity(1.8F)
|
||||
.setWaterAndFogColor(40, 0, 56).setFoliageColor(122, 17, 155)
|
||||
.setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(ivis, origin)
|
||||
|
|
|
@ -7,11 +7,11 @@ import com.google.common.base.Function;
|
|||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
@ -21,8 +21,8 @@ import ru.betterend.world.features.DefaultFeature;
|
|||
|
||||
public class BigEtherTreeFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
|||
return true;
|
||||
}
|
||||
|
||||
// private void makeLeavesSphere(StructureWorldAccess world, BlockPos pos,
|
||||
// private void makeLeavesSphere(WorldGenLevel world, BlockPos pos,
|
||||
// BlockState leaves, Function<BlockState, Boolean> ignore) {
|
||||
//
|
||||
// }
|
||||
|
|
|
@ -10,13 +10,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
@ -35,8 +35,8 @@ public class GreatNightshadeTreeFeature extends DefaultFeature {
|
|||
private static final List<Vector3f> BRANCH;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
@ -35,8 +35,8 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
|||
private static final List<Vector3f> BRANCH;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -9,13 +9,13 @@ import com.google.common.collect.Lists;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
@ -36,8 +36,8 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
private static final List<Vector3f> SIDE;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
if (!world.getBlockState(pos.down(4)).getBlock().isIn(EndTags.GEN_TERRAIN))
|
||||
|
@ -82,11 +82,9 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
|
||||
Vector3f vec = spline.get(spline.size() - 1);
|
||||
float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.35F;
|
||||
bigSphere(world, pos.offset(vec.getX(), vec.getY(), vec.getZ()), radius, cap, glow, wood, replacement,
|
||||
random);
|
||||
bigSphere(world, pos.offset(vec.x(), vec.y(), vec.z()), radius, cap, glow, wood, replacement, random);
|
||||
vec = SplineHelper.getPos(spline, 0.3F);
|
||||
makeRoots(world, pos.offset(vec.getX(), vec.getY(), vec.getZ()), size * 0.4F + 5, random, wood,
|
||||
replacement);
|
||||
makeRoots(world, pos.offset(vec.x(), vec.y(), vec.z()), size * 0.4F + 5, random, wood, replacement);
|
||||
|
||||
sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch);
|
||||
}
|
||||
|
@ -102,19 +100,19 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
return true;
|
||||
}
|
||||
|
||||
private void bigSphere(StructureWorldAccess world, BlockPos pos, float radius, BlockState cap, BlockState glow,
|
||||
private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow,
|
||||
BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
|
||||
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
|
||||
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
|
||||
|
||||
SDF sphereInner = new SDFSphere().setRadius(radius * 0.53F).setBlock(Blocks.AIR);
|
||||
sphereInner = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) noise.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1);
|
||||
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1);
|
||||
}).setSource(sphereInner);
|
||||
|
||||
SDF sphereGlow = new SDFSphere().setRadius(radius * 0.6F).setBlock(glow);
|
||||
sphereGlow = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) noise.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1) * 2F;
|
||||
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1) * 2F;
|
||||
}).setSource(sphereGlow);
|
||||
sphereGlow = new SDFSubtraction().setSourceA(sphereGlow).setSourceB(sphereInner);
|
||||
|
||||
|
@ -150,7 +148,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
sphere.fillArea(world, pos, new Box(pos.up((int) offsetY)).expand(radius * 1.3F));
|
||||
}
|
||||
|
||||
private void makeRoots(StructureWorldAccess world, BlockPos pos, float radius, Random random, BlockState wood,
|
||||
private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood,
|
||||
Function<BlockState, Boolean> replacement) {
|
||||
int count = (int) (radius * 1.5F);
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
|
|
@ -17,7 +17,7 @@ import me.shedaniel.rei.api.widgets.Tooltip;
|
|||
import me.shedaniel.rei.api.widgets.Widgets;
|
||||
import me.shedaniel.rei.gui.entries.RecipeEntry;
|
||||
import me.shedaniel.rei.gui.widget.Widget;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
@ -90,7 +90,7 @@ public class REIAlloyingFuelCategory implements RecipeCategory<REIAlloyingFuelDi
|
|||
slot.setZ(getZ() + 50);
|
||||
slot.getBounds().setLocation(bounds.x + 4, bounds.y + 2);
|
||||
slot.render(matrices, mouseX, mouseY, delta);
|
||||
MinecraftClient.getInstance().textRenderer.drawWithShadow(matrices, text.asOrderedText(), bounds.x + 25,
|
||||
Minecraft.getInstance().textRenderer.drawWithShadow(matrices, text.asOrderedText(), bounds.x + 25,
|
||||
bounds.y + 8, -1);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue