Reformatted Code
This commit is contained in:
parent
0de74f96ea
commit
9646b4d0a8
24 changed files with 22 additions and 28 deletions
|
@ -158,11 +158,10 @@ public class DataFixerAPI {
|
||||||
|
|
||||||
private static void makeBackupAndShowToast(LevelStorageSource storageSource, String levelID) {
|
private static void makeBackupAndShowToast(LevelStorageSource storageSource, String levelID) {
|
||||||
boolean didOpen = false;
|
boolean didOpen = false;
|
||||||
try (LevelStorageSource.LevelStorageAccess access = storageSource.createAccess(levelID);){
|
try (LevelStorageSource.LevelStorageAccess access = storageSource.createAccess(levelID);) {
|
||||||
didOpen = true;
|
didOpen = true;
|
||||||
EditWorldScreen.makeBackupAndShowToast(access);
|
EditWorldScreen.makeBackupAndShowToast(access);
|
||||||
}
|
} catch (IOException ex) {
|
||||||
catch (IOException ex) {
|
|
||||||
if (!didOpen) {
|
if (!didOpen) {
|
||||||
SystemToast.onWorldAccessFailure(Minecraft.getInstance(), levelID);
|
SystemToast.onWorldAccessFailure(Minecraft.getInstance(), levelID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource implements BiomeSourc
|
||||||
public static void register() {
|
public static void register() {
|
||||||
Registry.register(BuiltInRegistries.BIOME_SOURCE, BCLib.makeID("nether_biome_source"), CODEC);
|
Registry.register(BuiltInRegistries.BIOME_SOURCE, BCLib.makeID("nether_biome_source"), CODEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Holder<Biome> getNoiseBiome(int biomeX, int biomeY, int biomeZ, Climate.Sampler var4) {
|
public Holder<Biome> getNoiseBiome(int biomeX, int biomeY, int biomeZ, Climate.Sampler var4) {
|
||||||
if (!wasBound()) reloadBiomes(false);
|
if (!wasBound()) reloadBiomes(false);
|
||||||
|
|
|
@ -13,7 +13,6 @@ import net.minecraft.resources.ResourceKey;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.util.KeyDispatchDataCodec;
|
import net.minecraft.util.KeyDispatchDataCodec;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import net.minecraft.world.level.biome.Biomes;
|
|
||||||
import net.minecraft.world.level.biome.Climate;
|
import net.minecraft.world.level.biome.Climate;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
|
@ -97,7 +97,7 @@ public abstract class TemplateStructure extends Structure {
|
||||||
public Optional<GenerationStub> findGenerationPoint(GenerationContext ctx) {
|
public Optional<GenerationStub> findGenerationPoint(GenerationContext ctx) {
|
||||||
final Config config = randomConfig(ctx.random());
|
final Config config = randomConfig(ctx.random());
|
||||||
if (config == null) return Optional.empty();
|
if (config == null) return Optional.empty();
|
||||||
|
|
||||||
ChunkPos chunkPos = ctx.chunkPos();
|
ChunkPos chunkPos = ctx.chunkPos();
|
||||||
final int x = chunkPos.getMinBlockX();
|
final int x = chunkPos.getMinBlockX();
|
||||||
final int z = chunkPos.getMinBlockZ();
|
final int z = chunkPos.getMinBlockZ();
|
||||||
|
|
|
@ -2,7 +2,6 @@ package org.betterx.bclib.api.v3.datagen;
|
||||||
|
|
||||||
import org.betterx.bclib.api.v2.advancement.AdvancementManager;
|
import org.betterx.bclib.api.v2.advancement.AdvancementManager;
|
||||||
|
|
||||||
import net.minecraft.advancements.Advancement;
|
|
||||||
import net.minecraft.advancements.AdvancementHolder;
|
import net.minecraft.advancements.AdvancementHolder;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||||
|
|
|
@ -3,8 +3,6 @@ package org.betterx.bclib.api.v3.datagen;
|
||||||
import net.minecraft.data.recipes.RecipeOutput;
|
import net.minecraft.data.recipes.RecipeOutput;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
public interface DatapackRecipeBuilder {
|
public interface DatapackRecipeBuilder {
|
||||||
ResourceLocation getId();
|
ResourceLocation getId();
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface DropSelfLootProvider<B extends ItemLike> extends LootDropProvid
|
||||||
if (this instanceof BehaviourExplosionResistant) {
|
if (this instanceof BehaviourExplosionResistant) {
|
||||||
pool = pool.when(ExplosionCondition.survivesExplosion());
|
pool = pool.when(ExplosionCondition.survivesExplosion());
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.withPool(pool);
|
builder.withPool(pool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
|
||||||
import org.jetbrains.annotations.ApiStatus;
|
import org.jetbrains.annotations.ApiStatus;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class TagDataProvider<T> extends FabricTagProvider<T> {
|
||||||
if (isOptional(pair.second)) builder.addOptional(pair.first);
|
if (isOptional(pair.second)) builder.addOptional(pair.first);
|
||||||
else builder.add(pair.first);
|
else builder.add(pair.first);
|
||||||
});
|
});
|
||||||
|
|
||||||
tags.forEach(pair -> {
|
tags.forEach(pair -> {
|
||||||
if (isOptional(pair.second)) builder.addOptionalTag(pair.first);
|
if (isOptional(pair.second)) builder.addOptionalTag(pair.first);
|
||||||
else builder.forceAddTag(pair.first);
|
else builder.forceAddTag(pair.first);
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class BehaviourBuilders {
|
||||||
.strength(0.2f)
|
.strength(0.2f)
|
||||||
.sound(SoundType.VINE);
|
.sound(SoundType.VINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BlockBehaviour.Properties createVine(MapColor color) {
|
public static BlockBehaviour.Properties createVine(MapColor color) {
|
||||||
return createStaticVine(color)
|
return createStaticVine(color)
|
||||||
.randomTicks();
|
.randomTicks();
|
||||||
|
@ -100,6 +101,7 @@ public class BehaviourBuilders {
|
||||||
public static BlockBehaviour.Properties createLeaves() {
|
public static BlockBehaviour.Properties createLeaves() {
|
||||||
return createLeaves(MapColor.PLANT, true);
|
return createLeaves(MapColor.PLANT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BlockBehaviour.Properties createStaticLeaves() {
|
public static BlockBehaviour.Properties createStaticLeaves() {
|
||||||
return createStaticLeaves(MapColor.PLANT, true);
|
return createStaticLeaves(MapColor.PLANT, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,5 @@ package org.betterx.bclib.behaviours.interfaces;
|
||||||
* {@link org.betterx.bclib.api.v2.PostInitAPI} will add the {@link net.minecraft.tags.BlockTags#CLIMBABLE} tag to all blocks that
|
* {@link org.betterx.bclib.api.v2.PostInitAPI} will add the {@link net.minecraft.tags.BlockTags#CLIMBABLE} tag to all blocks that
|
||||||
* implement this interface.
|
* implement this interface.
|
||||||
*/
|
*/
|
||||||
public interface BehaviourClimable extends BlockBehaviour{
|
public interface BehaviourClimable extends BlockBehaviour {
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ package org.betterx.bclib.behaviours.interfaces;
|
||||||
* {@link org.betterx.worlds.together.tag.v3.CommonItemTags#COMPOSTABLE} tag to the items of all blocks that
|
* {@link org.betterx.worlds.together.tag.v3.CommonItemTags#COMPOSTABLE} tag to the items of all blocks that
|
||||||
* implement this interface. It will also register the Block with the {@link org.betterx.bclib.api.v2.ComposterAPI}
|
* implement this interface. It will also register the Block with the {@link org.betterx.bclib.api.v2.ComposterAPI}
|
||||||
*/
|
*/
|
||||||
public interface BehaviourCompostable extends BlockBehaviour{
|
public interface BehaviourCompostable extends BlockBehaviour {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The chance that this block will be composted.
|
* The chance that this block will be composted.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.betterx.bclib.behaviours.interfaces;
|
package org.betterx.bclib.behaviours.interfaces;
|
||||||
|
|
||||||
public interface BehaviourExplosionResistant extends BlockBehaviour{
|
public interface BehaviourExplosionResistant extends BlockBehaviour {
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,9 @@ public abstract class BaseStripableLogBlock extends BaseRotatedPillarBlock {
|
||||||
public Wood(MapColor color, Block striped, boolean flammable) {
|
public Wood(MapColor color, Block striped, boolean flammable) {
|
||||||
super(
|
super(
|
||||||
striped,
|
striped,
|
||||||
(flammable ? Properties.ofFullCopy(striped).ignitedByLava() : Properties.ofFullCopy(striped)).mapColor(color)
|
(flammable
|
||||||
|
? Properties.ofFullCopy(striped).ignitedByLava()
|
||||||
|
: Properties.ofFullCopy(striped)).mapColor(color)
|
||||||
);
|
);
|
||||||
this.flammable = flammable;
|
this.flammable = flammable;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ public abstract class UnderwaterPlantBlock extends BaseBlockNotFull implements R
|
||||||
BlockPos pos,
|
BlockPos pos,
|
||||||
BlockState state,
|
BlockState state,
|
||||||
Fluid fluid
|
Fluid fluid
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -303,7 +303,7 @@ public class WorldSetupScreen extends LayoutScreen {
|
||||||
if (configuredPreset != null && configuredPreset.value() instanceof TogetherWorldPreset worldPreset) {
|
if (configuredPreset != null && configuredPreset.value() instanceof TogetherWorldPreset worldPreset) {
|
||||||
ResourceKey<WorldPreset> key = configuredPreset.unwrapKey().orElse(null);
|
ResourceKey<WorldPreset> key = configuredPreset.unwrapKey().orElse(null);
|
||||||
if (key == null) key = worldPreset.parentKey;
|
if (key == null) key = worldPreset.parentKey;
|
||||||
|
|
||||||
acc.setWorldType(new WorldCreationUiState.WorldTypeEntry(Holder.direct(
|
acc.setWorldType(new WorldCreationUiState.WorldTypeEntry(Holder.direct(
|
||||||
worldPreset.withDimensions(
|
worldPreset.withDimensions(
|
||||||
createWorldScreen
|
createWorldScreen
|
||||||
|
|
|
@ -101,7 +101,7 @@ public final class BCLWoodTypeWrapper {
|
||||||
public BCLWoodTypeWrapper build() {
|
public BCLWoodTypeWrapper build() {
|
||||||
if (setType == null) setType = new BlockSetTypeBuilder().register(id);
|
if (setType == null) setType = new BlockSetTypeBuilder().register(id);
|
||||||
|
|
||||||
final WoodType type = new WoodTypeBuilder().register(id,setType);
|
final WoodType type = new WoodTypeBuilder().register(id, setType);
|
||||||
return new BCLWoodTypeWrapper(id, type, color, flammable);
|
return new BCLWoodTypeWrapper(id, type, color, flammable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ public abstract class AnvilMenuMixin extends ItemCombinerMenu implements AnvilSc
|
||||||
if (!bcl_recipes.isEmpty()) {
|
if (!bcl_recipes.isEmpty()) {
|
||||||
int anvilLevel = this.bcl_anvilLevel.get();
|
int anvilLevel = this.bcl_anvilLevel.get();
|
||||||
bcl_recipes = bcl_recipes.stream()
|
bcl_recipes = bcl_recipes.stream()
|
||||||
.filter(recipe -> anvilLevel >= recipe.value().getAnvilLevel())
|
.filter(recipe -> anvilLevel >= recipe.value().getAnvilLevel())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (!bcl_recipes.isEmpty()) {
|
if (!bcl_recipes.isEmpty()) {
|
||||||
if (bcl_currentRecipe == null || !bcl_recipes.contains(bcl_currentRecipe)) {
|
if (bcl_currentRecipe == null || !bcl_recipes.contains(bcl_currentRecipe)) {
|
||||||
|
|
|
@ -9,8 +9,6 @@ import net.minecraft.tags.TagKey;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.level.ItemLike;
|
import net.minecraft.world.level.ItemLike;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
public class CookingRecipeBuilder extends AbstractUnlockableRecipeBuilder<CookingRecipeBuilder> {
|
public class CookingRecipeBuilder extends AbstractUnlockableRecipeBuilder<CookingRecipeBuilder> {
|
||||||
|
|
||||||
protected float xp;
|
protected float xp;
|
||||||
|
|
|
@ -10,8 +10,6 @@ import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.crafting.Ingredient;
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
import net.minecraft.world.level.ItemLike;
|
import net.minecraft.world.level.ItemLike;
|
||||||
|
|
||||||
import java.util.function.Consumer;
|
|
||||||
|
|
||||||
public class SmithingRecipeBuilder extends AbstractUnlockableRecipeBuilder<SmithingRecipeBuilder> {
|
public class SmithingRecipeBuilder extends AbstractUnlockableRecipeBuilder<SmithingRecipeBuilder> {
|
||||||
protected Ingredient addon;
|
protected Ingredient addon;
|
||||||
protected Item template;
|
protected Item template;
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class BlockRegistry extends BaseRegistry<Block> {
|
||||||
.getBurnChance() == 0) {
|
.getBurnChance() == 0) {
|
||||||
FlammableBlockRegistry.getDefaultInstance().add(block, 5, 5);
|
FlammableBlockRegistry.getDefaultInstance().add(block, 5, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
getModBlocks(id.getNamespace()).add(block);
|
getModBlocks(id.getNamespace()).add(block);
|
||||||
|
|
||||||
return block;
|
return block;
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class RomanNumeral {
|
||||||
private static String _toRoman(int number) {
|
private static String _toRoman(int number) {
|
||||||
//there is no 0 in roman, but we need it anyway ;)
|
//there is no 0 in roman, but we need it anyway ;)
|
||||||
if (number == 0) return "0";
|
if (number == 0) return "0";
|
||||||
|
|
||||||
int l = LITERALS.floorKey(number);
|
int l = LITERALS.floorKey(number);
|
||||||
if (number == l) {
|
if (number == l) {
|
||||||
return LITERALS.get(number);
|
return LITERALS.get(number);
|
||||||
|
|
|
@ -23,6 +23,6 @@ public class BiomeDatagenProvider extends TagDataProvider<Biome> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void bootstrap(BootstapContext<Biome> bootstrapContext) {
|
public static void bootstrap(BootstapContext<Biome> bootstrapContext) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||||
public class WorldEventsImpl {
|
public class WorldEventsImpl {
|
||||||
public static final EventImpl<OnWorldRegistryReady> WORLD_REGISTRY_READY = new EventImpl<>();
|
public static final EventImpl<OnWorldRegistryReady> WORLD_REGISTRY_READY = new EventImpl<>();
|
||||||
public static final EventImpl<BeforeWorldLoad> BEFORE_WORLD_LOAD = new EventImpl<>();
|
public static final EventImpl<BeforeWorldLoad> BEFORE_WORLD_LOAD = new EventImpl<>();
|
||||||
|
|
||||||
public static final EventImpl<OnWorldLoad> ON_WORLD_LOAD = new EventImpl<>();
|
public static final EventImpl<OnWorldLoad> ON_WORLD_LOAD = new EventImpl<>();
|
||||||
public static final EventImpl<OnFinalizeLevelStem> ON_FINALIZE_LEVEL_STEM = new EventImpl<>();
|
public static final EventImpl<OnFinalizeLevelStem> ON_FINALIZE_LEVEL_STEM = new EventImpl<>();
|
||||||
public static final EventImpl<OnFinalizeWorldLoad> ON_FINALIZED_WORLD_LOAD = new EventImpl<>();
|
public static final EventImpl<OnFinalizeWorldLoad> ON_FINALIZED_WORLD_LOAD = new EventImpl<>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue