Fixes for 1.19-pre1
This commit is contained in:
parent
d533f93113
commit
c6742982df
13 changed files with 165 additions and 174 deletions
|
@ -55,7 +55,7 @@ tasks.withType(JavaCompile) {
|
|||
}
|
||||
|
||||
javadoc {
|
||||
options.tags = [ "reason" ]
|
||||
options.tags = ["reason"]
|
||||
options.stylesheetFile = new File(projectDir, "javadoc.css");
|
||||
}
|
||||
|
||||
|
@ -93,11 +93,11 @@ task release(dependsOn: [remapJar, sourcesJar, javadocJar]) {
|
|||
|
||||
doLast {
|
||||
def github = GitHub.connectUsingOAuth(env.GITHUB_TOKEN as String)
|
||||
def repository = github.getRepository("paulevsGitch/BCLib")
|
||||
def repository = github.getRepository("quiqueck/BCLib")
|
||||
|
||||
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
|
||||
releaseBuilder.name("${archivesBaseName}-${version}")
|
||||
releaseBuilder.body("A changelog can be found at https://github.com/paulevsGitch/BCLib/commits")
|
||||
releaseBuilder.body("A changelog can be found at https://github.com/quiqueck/BCLib/commits")
|
||||
releaseBuilder.commitish("main")
|
||||
|
||||
def ghRelease = releaseBuilder.create()
|
||||
|
@ -125,7 +125,7 @@ publishing {
|
|||
repositories {
|
||||
maven {
|
||||
name = "GitHubPackages"
|
||||
url = uri("https://maven.pkg.github.com/paulevsgitch/bclib")
|
||||
url = uri("https://maven.pkg.github.com/quiqueck/bclib")
|
||||
credentials {
|
||||
username = env.GITHUB_USER
|
||||
password = env.GITHUB_TOKEN
|
||||
|
|
|
@ -6,9 +6,9 @@ loom_version=0.11-SNAPSHOT
|
|||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/versions.html
|
||||
minecraft_version= 22w18a
|
||||
loader_version= 0.14.3
|
||||
fabric_version = 0.52.1+1.19
|
||||
minecraft_version= 1.19-pre1
|
||||
loader_version= 0.14.5
|
||||
fabric_version = 0.52.4+1.19
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 2.0.0
|
||||
|
|
|
@ -22,18 +22,14 @@ import net.minecraft.world.level.biome.BiomeGenerationSettings;
|
|||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraft.world.level.biome.Biomes;
|
||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkAccess;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.PalettedContainer;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Carving;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource;
|
||||
import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
|
@ -53,8 +49,10 @@ import org.apache.commons.lang3.mutable.MutableInt;
|
|||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.tag.CommonBiomeTags;
|
||||
import org.betterx.bclib.api.tag.TagAPI;
|
||||
import org.betterx.bclib.entity.BCLEntityWrapper;
|
||||
import org.betterx.bclib.interfaces.*;
|
||||
import org.betterx.bclib.interfaces.BiomeSourceAccessor;
|
||||
import org.betterx.bclib.interfaces.NoiseGeneratorSettingsProvider;
|
||||
import org.betterx.bclib.interfaces.SurfaceMaterialProvider;
|
||||
import org.betterx.bclib.interfaces.SurfaceRuleProvider;
|
||||
import org.betterx.bclib.mixin.client.MinecraftMixin;
|
||||
import org.betterx.bclib.mixin.common.BiomeGenerationSettingsAccessor;
|
||||
import org.betterx.bclib.mixin.common.MobSpawnSettingsAccessor;
|
||||
|
@ -483,7 +481,7 @@ public class BiomeAPI {
|
|||
|
||||
FabricBiomesData.END_VOID_BIOMES.forEach((key, weight) -> {
|
||||
if (!hasBiome(key.location())) {
|
||||
registerEndVoidBiome(BuiltinRegistries.BIOME.getOrCreateHolder(key), weight);
|
||||
registerEndVoidBiome(BuiltinRegistries.BIOME.getOrCreateHolderOrThrow(key), weight);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -495,7 +493,7 @@ public class BiomeAPI {
|
|||
|
||||
@Nullable
|
||||
public static Holder<Biome> getFromRegistry(ResourceKey<Biome> key) {
|
||||
return BuiltinRegistries.BIOME.getOrCreateHolder(key);
|
||||
return BuiltinRegistries.BIOME.getOrCreateHolderOrThrow(key);
|
||||
}
|
||||
|
||||
public static boolean isDatapackBiome(ResourceLocation biomeID) {
|
||||
|
@ -858,6 +856,7 @@ public class BiomeAPI {
|
|||
public static Optional<BlockState> findUnderMaterial(Holder<Biome> biome) {
|
||||
return findUnderMaterial(getBiome(biome.value()));
|
||||
}
|
||||
|
||||
public static Optional<BlockState> findUnderMaterial(BCLBiome biome) {
|
||||
if (biome instanceof SurfaceMaterialProvider smp) {
|
||||
return Optional.of(smp.getUnderMaterial());
|
||||
|
|
|
@ -5,8 +5,9 @@ import net.minecraft.core.Registry;
|
|||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.server.packs.resources.ResourceManager;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tags.TagEntry;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.tags.TagLoader;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
@ -16,9 +17,11 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.biomes.BiomeAPI;
|
||||
import org.betterx.bclib.mixin.common.DiggerItemAccessor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
@ -229,8 +232,8 @@ public class TagAPI {
|
|||
* @param tagsMap The map that will hold the registered Tags
|
||||
* @return The {@code tagsMap} Parameter.
|
||||
*/
|
||||
public static <T> Map<ResourceLocation, Tag.Builder> apply(String directory,
|
||||
Map<ResourceLocation, Tag.Builder> tagsMap) {
|
||||
public static <T> Map<ResourceLocation, List<TagLoader.EntryWithSource>> apply(String directory,
|
||||
Map<ResourceLocation, List<TagLoader.EntryWithSource>> tagsMap) {
|
||||
|
||||
TagType<?> type = TYPES.get(directory);
|
||||
if (type != null) {
|
||||
|
@ -259,8 +262,9 @@ public class TagAPI {
|
|||
* @param ids
|
||||
* @return The Builder passed as {@code builder}.
|
||||
*/
|
||||
public static Tag.Builder apply(Tag.Builder builder, Set<ResourceLocation> ids) {
|
||||
ids.forEach(value -> builder.addElement(value, "BCLib Code"));
|
||||
public static List<TagLoader.EntryWithSource> apply(List<TagLoader.EntryWithSource> builder,
|
||||
Set<ResourceLocation> ids) {
|
||||
ids.forEach(value -> builder.add(new TagLoader.EntryWithSource(TagEntry.element(value), BCLib.MOD_ID)));
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,16 +4,18 @@ import net.minecraft.core.DefaultedRegistry;
|
|||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.tags.TagLoader;
|
||||
import net.minecraft.tags.TagManager;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.biomes.BiomeAPI;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiConsumer;
|
||||
|
@ -190,10 +192,10 @@ public class TagType<T> {
|
|||
tags.forEach(consumer);
|
||||
}
|
||||
|
||||
public void apply(Map<ResourceLocation, Tag.Builder> tagsMap) {
|
||||
public void apply(Map<ResourceLocation, List<TagLoader.EntryWithSource>> tagsMap) {
|
||||
if (Registry.BIOME_REGISTRY.equals(registryKey)) BiomeAPI._runTagAdders();
|
||||
|
||||
//this.isFrozen = true;
|
||||
this.forEach((id, ids) -> TagAPI.apply(tagsMap.computeIfAbsent(id, key -> Tag.Builder.tag()), ids));
|
||||
this.forEach((id, ids) -> TagAPI.apply(tagsMap.computeIfAbsent(id, key -> Lists.newArrayList()), ids));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,35 +2,23 @@ package org.betterx.bclib.mixin.common;
|
|||
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.BiomeSource;
|
||||
import net.minecraft.world.level.biome.BiomeSource.StepFeatureData;
|
||||
|
||||
import com.google.common.base.Suppliers;
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.interfaces.BiomeSourceAccessor;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@Mixin(BiomeSource.class)
|
||||
public abstract class BiomeSourceMixin implements BiomeSourceAccessor {
|
||||
@Shadow
|
||||
protected abstract List<StepFeatureData> buildFeaturesPerStep(List<Biome> list, boolean bl);
|
||||
|
||||
@Shadow
|
||||
public abstract Set<Biome> possibleBiomes();
|
||||
|
||||
@Mutable
|
||||
@Shadow
|
||||
@Final
|
||||
private Supplier<List<StepFeatureData>> featuresPerStep;
|
||||
|
||||
public void bclRebuildFeatures() {
|
||||
//Feature sorting is now a task in ChunkGenerator
|
||||
BCLib.LOGGER.info("Rebuilding features in BiomeSource " + this);
|
||||
featuresPerStep = Suppliers.memoize(() -> buildFeaturesPerStep(this.possibleBiomes().stream().toList(), true));
|
||||
//featuresPerStep = Suppliers.memoize(() -> FeatureSorter.buildFeaturesPerStep(this.possibleBiomes().stream().toList(), true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,16 @@ package org.betterx.bclib.mixin.common;
|
|||
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.Services;
|
||||
import net.minecraft.server.WorldStem;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.progress.ChunkProgressListener;
|
||||
import net.minecraft.server.level.progress.ChunkProgressListenerFactory;
|
||||
import net.minecraft.server.packs.repository.PackRepository;
|
||||
import net.minecraft.server.players.GameProfileCache;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess;
|
||||
import net.minecraft.world.level.storage.WorldData;
|
||||
|
||||
import com.mojang.authlib.GameProfileRepository;
|
||||
import com.mojang.authlib.minecraft.MinecraftSessionService;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import org.betterx.bclib.api.dataexchange.DataExchangeAPI;
|
||||
import org.betterx.bclib.recipes.BCLRecipeManager;
|
||||
|
@ -50,9 +48,7 @@ public class MinecraftServerMixin {
|
|||
WorldStem worldStem,
|
||||
Proxy proxy,
|
||||
DataFixer dataFixer,
|
||||
MinecraftSessionService minecraftSessionService,
|
||||
GameProfileRepository gameProfileRepository,
|
||||
GameProfileCache gameProfileCache,
|
||||
Services services,
|
||||
ChunkProgressListenerFactory chunkProgressListenerFactory,
|
||||
CallbackInfo ci) {
|
||||
DataExchangeAPI.prepareServerside();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.betterx.bclib.mixin.common;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.Tag;
|
||||
import net.minecraft.tags.TagLoader;
|
||||
|
||||
import org.betterx.bclib.api.tag.TagAPI;
|
||||
|
@ -11,6 +10,7 @@ import org.spongepowered.asm.mixin.Shadow;
|
|||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Mixin(TagLoader.class)
|
||||
|
@ -20,7 +20,7 @@ public class TagLoaderMixin {
|
|||
private String directory;
|
||||
|
||||
@ModifyArg(method = "loadAndBuild", at = @At(value = "INVOKE", target = "Lnet/minecraft/tags/TagLoader;build(Ljava/util/Map;)Ljava/util/Map;"))
|
||||
public Map<ResourceLocation, Tag.Builder> be_modifyTags(Map<ResourceLocation, Tag.Builder> tagsMap) {
|
||||
public Map<ResourceLocation, List<TagLoader.EntryWithSource>> be_modifyTags(Map<ResourceLocation, List<TagLoader.EntryWithSource>> tagsMap) {
|
||||
return TagAPI.apply(directory, tagsMap);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ public class BCLBiome extends BCLBiomeSettings {
|
|||
|
||||
|
||||
public Holder<Biome> getBiomeHolder() {
|
||||
return BuiltinRegistries.BIOME.getOrCreateHolder(BiomeAPI.getBiomeKey(biome));
|
||||
return BuiltinRegistries.BIOME.getOrCreateHolderOrThrow(BiomeAPI.getBiomeKey(biome));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -102,8 +102,8 @@ public class BCLibEndBiomeSource extends BCLBiomeSource {
|
|||
endVoidBiomePicker.rebuild();
|
||||
|
||||
|
||||
this.centerBiome = biomeRegistry.getOrCreateHolder(Biomes.THE_END);
|
||||
this.barrens = biomeRegistry.getOrCreateHolder(Biomes.END_BARRENS);
|
||||
this.centerBiome = biomeRegistry.getOrCreateHolderOrThrow(Biomes.THE_END);
|
||||
this.barrens = biomeRegistry.getOrCreateHolderOrThrow(Biomes.END_BARRENS);
|
||||
|
||||
this.endLandFunction = GeneratorOptions.getEndLandFunction();
|
||||
this.pos = new Point();
|
||||
|
@ -119,7 +119,8 @@ public class BCLibEndBiomeSource extends BCLBiomeSource {
|
|||
|
||||
return biomeRegistry.stream()
|
||||
.filter(biome -> biomeRegistry.getResourceKey(biome).isPresent())
|
||||
.map(biome -> biomeRegistry.getOrCreateHolder(biomeRegistry.getResourceKey(biome).get()))
|
||||
.map(biome -> biomeRegistry.getOrCreateHolderOrThrow(biomeRegistry.getResourceKey(biome)
|
||||
.get()))
|
||||
.filter(biome -> {
|
||||
ResourceLocation key = biome.unwrapKey().orElseThrow().location();
|
||||
|
||||
|
|
|
@ -105,7 +105,8 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource {
|
|||
|
||||
return biomeRegistry.stream()
|
||||
.filter(biome -> biomeRegistry.getResourceKey(biome).isPresent())
|
||||
.map(biome -> biomeRegistry.getOrCreateHolder(biomeRegistry.getResourceKey(biome).get()))
|
||||
.map(biome -> biomeRegistry.getOrCreateHolderOrThrow(biomeRegistry.getResourceKey(biome)
|
||||
.get()))
|
||||
.filter(biome -> {
|
||||
ResourceLocation location = biome.unwrapKey().orElseThrow().location();
|
||||
final String strLocation = location.toString();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class BiomePicker {
|
|||
this.bclBiome = bclBiome;
|
||||
|
||||
this.key = biomeRegistry.getResourceKey(biomeRegistry.get(bclBiome.getID())).orElseThrow();
|
||||
this.biome = biomeRegistry.getOrCreateHolder(key);
|
||||
this.biome = biomeRegistry.getOrCreateHolderOrThrow(key);
|
||||
|
||||
bclBiome.forEachSubBiome((b, w) -> {
|
||||
subbiomes.add(create(b), w);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "bclib",
|
||||
"version": "${version}",
|
||||
"version": "2.0.0",
|
||||
"name": "BCLib",
|
||||
"description": "A library for BetterX team mods",
|
||||
"authors": [
|
||||
|
@ -19,32 +19,32 @@
|
|||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"ru.bclib.BCLib"
|
||||
"org.betterx.bclib.BCLib"
|
||||
],
|
||||
"client": [
|
||||
"ru.bclib.client.BCLibClient"
|
||||
"org.betterx.bclib.client.BCLibClient"
|
||||
],
|
||||
"server": [
|
||||
"ru.bclib.server.BCLibServer"
|
||||
"org.betterx.bclib.server.BCLibServer"
|
||||
],
|
||||
"modmenu": [
|
||||
"ru.bclib.integration.modmenu.ModMenuEntryPoint"
|
||||
"org.betterx.bclib.integration.modmenu.ModMenuEntryPoint"
|
||||
]
|
||||
},
|
||||
"accessWidener" : "bclib.accesswidener",
|
||||
"accessWidener": "bclib.accesswidener",
|
||||
"mixins": [
|
||||
"bclib.mixins.common.json",
|
||||
"bclib.mixins.client.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.3",
|
||||
"fabric": ">=0.52.0",
|
||||
"minecraft": "1.19-alpha.22.18.a"
|
||||
"fabricloader": ">=0.14.5",
|
||||
"fabric": ">=0.52.4",
|
||||
"minecraft": "1.19-beta.1"
|
||||
},
|
||||
"custom":{
|
||||
"modmenu":{
|
||||
"links":{
|
||||
"title.link.bclib.discord":"https://discord.gg/kYuATbYbKW"
|
||||
"custom": {
|
||||
"modmenu": {
|
||||
"links": {
|
||||
"title.link.bclib.discord": "https://discord.gg/kYuATbYbKW"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue