Recipe fixes, replaced spaces with tabs
This commit is contained in:
parent
5ca6a92dd0
commit
d8de624fd1
60 changed files with 1816 additions and 1851 deletions
|
@ -31,35 +31,35 @@ import java.util.concurrent.CompletableFuture;
|
|||
|
||||
@Mixin(MinecraftServer.class)
|
||||
public class MinecraftServerMixin {
|
||||
@Shadow
|
||||
private ServerResources resources;
|
||||
@Shadow
|
||||
private ServerResources resources;
|
||||
|
||||
@Final
|
||||
@Shadow
|
||||
private Map<ResourceKey<Level>, ServerLevel> levels;
|
||||
@Final
|
||||
@Shadow
|
||||
private Map<ResourceKey<Level>, ServerLevel> levels;
|
||||
|
||||
@Final
|
||||
@Shadow
|
||||
protected WorldData worldData;
|
||||
@Final
|
||||
@Shadow
|
||||
protected WorldData worldData;
|
||||
|
||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||
private void bclib_onServerInit(Thread thread, RegistryHolder registryHolder, LevelStorageAccess levelStorageAccess, WorldData worldData, PackRepository packRepository, Proxy proxy, DataFixer dataFixer, ServerResources serverResources, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, GameProfileCache gameProfileCache, ChunkProgressListenerFactory chunkProgressListenerFactory, CallbackInfo ci) {
|
||||
DataExchangeAPI.prepareServerside();
|
||||
}
|
||||
@Inject(method = "<init>*", at = @At("TAIL"))
|
||||
private void bclib_onServerInit(Thread thread, RegistryHolder registryHolder, LevelStorageAccess levelStorageAccess, WorldData worldData, PackRepository packRepository, Proxy proxy, DataFixer dataFixer, ServerResources serverResources, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, GameProfileCache gameProfileCache, ChunkProgressListenerFactory chunkProgressListenerFactory, CallbackInfo ci) {
|
||||
DataExchangeAPI.prepareServerside();
|
||||
}
|
||||
|
||||
@Inject(method = "reloadResources", at = @At(value = "RETURN"), cancellable = true)
|
||||
private void bclib_reloadResources(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> info) {
|
||||
bclib_injectRecipes();
|
||||
}
|
||||
@Inject(method = "reloadResources", at = @At(value = "RETURN"), cancellable = true)
|
||||
private void bclib_reloadResources(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> info) {
|
||||
bclib_injectRecipes();
|
||||
}
|
||||
|
||||
@Inject(method = "loadLevel", at = @At(value = "RETURN"), cancellable = true)
|
||||
private void bclib_loadLevel(CallbackInfo info) {
|
||||
bclib_injectRecipes();
|
||||
//BiomeAPI.initRegistry(MinecraftServer.class.cast(this));
|
||||
}
|
||||
@Inject(method = "loadLevel", at = @At(value = "RETURN"), cancellable = true)
|
||||
private void bclib_loadLevel(CallbackInfo info) {
|
||||
bclib_injectRecipes();
|
||||
//BiomeAPI.initRegistry(MinecraftServer.class.cast(this));
|
||||
}
|
||||
|
||||
private void bclib_injectRecipes() {
|
||||
RecipeManagerAccessor accessor = (RecipeManagerAccessor) resources.getRecipeManager();
|
||||
accessor.bclib_setRecipes(BCLRecipeManager.getMap(accessor.bclib_getRecipes()));
|
||||
}
|
||||
private void bclib_injectRecipes() {
|
||||
RecipeManagerAccessor accessor = (RecipeManagerAccessor) resources.getRecipeManager();
|
||||
accessor.bclib_setRecipes(BCLRecipeManager.getMap(accessor.bclib_getRecipes()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ import ru.bclib.world.biomes.FabricBiomesData;
|
|||
|
||||
@Mixin(value = NetherBiomeData.class, remap = false)
|
||||
public class NetherBiomeDataMixin {
|
||||
@Inject(method = "addNetherBiome", at = @At(value = "HEAD"))
|
||||
private static void bclib_addNetherBiome(ResourceKey<Biome> biome, Climate.ParameterPoint spawnNoisePoint, CallbackInfo info) {
|
||||
FabricBiomesData.NETHER_BIOMES.add(biome);
|
||||
}
|
||||
@Inject(method = "addNetherBiome", at = @At(value = "HEAD"))
|
||||
private static void bclib_addNetherBiome(ResourceKey<Biome> biome, Climate.ParameterPoint spawnNoisePoint, CallbackInfo info) {
|
||||
FabricBiomesData.NETHER_BIOMES.add(biome);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package ru.bclib.mixin.common;
|
|||
import net.minecraft.world.level.levelgen.NoiseGeneratorSettings;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules;
|
||||
import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource;
|
||||
import org.apache.commons.codec.language.bm.Rule;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
|
|
|
@ -12,39 +12,39 @@ import java.util.function.Supplier;
|
|||
|
||||
@Mixin(SurfaceRules.Context.class)
|
||||
public interface SurfaceRulesContextAccessor {
|
||||
@Accessor("blockX")
|
||||
int getBlockX();
|
||||
@Accessor("blockX")
|
||||
int getBlockX();
|
||||
|
||||
@Accessor("blockY")
|
||||
int getBlockY();
|
||||
@Accessor("blockY")
|
||||
int getBlockY();
|
||||
|
||||
@Accessor("blockZ")
|
||||
int getBlockZ();
|
||||
@Accessor("blockZ")
|
||||
int getBlockZ();
|
||||
|
||||
@Accessor("surfaceDepth")
|
||||
int getSurfaceDepth();
|
||||
@Accessor("surfaceDepth")
|
||||
int getSurfaceDepth();
|
||||
|
||||
@Accessor("biome")
|
||||
Supplier<Biome> getBiome();
|
||||
@Accessor("biome")
|
||||
Supplier<Biome> getBiome();
|
||||
|
||||
@Accessor("biomeKey")
|
||||
Supplier<ResourceKey<Biome>> getBiomeKey();
|
||||
@Accessor("biomeKey")
|
||||
Supplier<ResourceKey<Biome>> getBiomeKey();
|
||||
|
||||
@Accessor("chunk")
|
||||
ChunkAccess getChunk();
|
||||
@Accessor("chunk")
|
||||
ChunkAccess getChunk();
|
||||
|
||||
@Accessor("noiseChunk")
|
||||
NoiseChunk getNoiseChunk();
|
||||
|
||||
@Accessor("stoneDepthAbove")
|
||||
int getStoneDepthAbove();
|
||||
|
||||
@Accessor("stoneDepthBelow")
|
||||
int getStoneDepthBelow();
|
||||
|
||||
@Accessor("lastUpdateY")
|
||||
long getLastUpdateY();
|
||||
|
||||
@Accessor("lastUpdateXZ")
|
||||
long getLastUpdateXZ();
|
||||
@Accessor("noiseChunk")
|
||||
NoiseChunk getNoiseChunk();
|
||||
|
||||
@Accessor("stoneDepthAbove")
|
||||
int getStoneDepthAbove();
|
||||
|
||||
@Accessor("stoneDepthBelow")
|
||||
int getStoneDepthBelow();
|
||||
|
||||
@Accessor("lastUpdateY")
|
||||
long getLastUpdateY();
|
||||
|
||||
@Accessor("lastUpdateXZ")
|
||||
long getLastUpdateXZ();
|
||||
}
|
||||
|
|
|
@ -12,24 +12,24 @@ import ru.bclib.world.biomes.FabricBiomesData;
|
|||
|
||||
@Mixin(value = TheEndBiomeData.class, remap = false)
|
||||
public class TheEndBiomeDataMixin {
|
||||
@Inject(method = "addEndBiomeReplacement", at = @At(value = "HEAD"))
|
||||
private static void bclib_addEndBiomeReplacement(ResourceKey<Biome> replaced, ResourceKey<Biome> variant, double weight, CallbackInfo info) {
|
||||
if (replaced == Biomes.END_BARRENS || replaced == Biomes.SMALL_END_ISLANDS) {
|
||||
FabricBiomesData.END_VOID_BIOMES.put(variant, (float) weight);
|
||||
}
|
||||
else {
|
||||
FabricBiomesData.END_LAND_BIOMES.put(variant, (float) weight);
|
||||
}
|
||||
}
|
||||
@Inject(method = "addEndBiomeReplacement", at = @At(value = "HEAD"))
|
||||
private static void bclib_addEndBiomeReplacement(ResourceKey<Biome> replaced, ResourceKey<Biome> variant, double weight, CallbackInfo info) {
|
||||
if (replaced == Biomes.END_BARRENS || replaced == Biomes.SMALL_END_ISLANDS) {
|
||||
FabricBiomesData.END_VOID_BIOMES.put(variant, (float) weight);
|
||||
}
|
||||
else {
|
||||
FabricBiomesData.END_LAND_BIOMES.put(variant, (float) weight);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "addEndMidlandsReplacement", at = @At(value = "HEAD"))
|
||||
private static void bclib_addEndMidlandsReplacement(ResourceKey<Biome> highlands, ResourceKey<Biome> midlands, double weight, CallbackInfo info) {
|
||||
FabricBiomesData.END_LAND_BIOMES.put(midlands, (float) weight);
|
||||
}
|
||||
@Inject(method = "addEndMidlandsReplacement", at = @At(value = "HEAD"))
|
||||
private static void bclib_addEndMidlandsReplacement(ResourceKey<Biome> highlands, ResourceKey<Biome> midlands, double weight, CallbackInfo info) {
|
||||
FabricBiomesData.END_LAND_BIOMES.put(midlands, (float) weight);
|
||||
}
|
||||
|
||||
@Inject(method = "addEndBarrensReplacement", at = @At(value = "HEAD"))
|
||||
private static void bclib_addEndBarrensReplacement(ResourceKey<Biome> highlands, ResourceKey<Biome> barrens, double weight, CallbackInfo info) {
|
||||
FabricBiomesData.END_LAND_BIOMES.put(barrens, (float) weight);
|
||||
FabricBiomesData.END_VOID_BIOMES.put(barrens, (float) weight);
|
||||
}
|
||||
@Inject(method = "addEndBarrensReplacement", at = @At(value = "HEAD"))
|
||||
private static void bclib_addEndBarrensReplacement(ResourceKey<Biome> highlands, ResourceKey<Biome> barrens, double weight, CallbackInfo info) {
|
||||
FabricBiomesData.END_LAND_BIOMES.put(barrens, (float) weight);
|
||||
FabricBiomesData.END_VOID_BIOMES.put(barrens, (float) weight);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue