Reformatted Code

This commit is contained in:
Frank 2023-12-19 21:04:06 +01:00
parent 0de74f96ea
commit 9646b4d0a8
24 changed files with 22 additions and 28 deletions

View file

@ -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);
} }

View file

@ -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;

View file

@ -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;

View file

@ -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();

View file

@ -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;

View file

@ -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);
} }

View file

@ -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 {
} }

View file

@ -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.

View file

@ -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 {
} }

View file

@ -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;
} }

View file

@ -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;
} }

View file

@ -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);
} }
} }

View file

@ -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)) {

View file

@ -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;

View file

@ -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;