<|start_filename|>src/main/resources/data/squidcraft/advancements/root.json<|end_filename|>
{
  "display": {
    "icon": {
      "item": "squidcraft:shredded_squid"
    },
    "title": {
      "translate": "advancements.squidcraft.root.title"
    },
    "description": {
      "translate": "advancements.squidcraft.root.desc"
    },
    "frame": "task",
    "show_toast": true,
    "announce_to_chat": true,
    "hidden": false,
    "background": "squidcraft:textures/gui/advancements/backgrounds/squid_block.png"
  },
  "criteria": {
    "shredded_squid": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "squidcraft:shredded_squid"
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "shredded_squid"
    ]
  ],
  "rewards": {
    "recipes": [
      "squidcraft:cooked_shredded_squid",
      "squidcraft:cooked_shredded_squid_from_campfire",
      "squidcraft:cooked_shredded_squid_from_smoking"
    ],
    "loot": [
      "minecraft:entities/squid"
    ]
  }
}

<|start_filename|>backup/squid233/squidcraft/item/YourItem2.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import io.github.squid233.squidcraft.api.item.Item;
import io.github.squid233.squidcraft.config.Configs;
import io.github.squid233.squidcraft.config.CreateConfig;

public class YourItem2 extends Item {
    public YourItem2() {
        super(new Settings().group(ItemGroups.SQUID_CRAFT).maxCount(CreateConfig.getInt(Configs.YOUR_ITEM_2_MAX_VALUE)));
    }

    @Override
    public String getRegistryName() {
        return "your_item_2";
    }
}


<|start_filename|>backup/squid233/squidcraft/api/item/ItemFood.java<|end_filename|>
package io.github.squid233.squidcraft.api.item;

import net.minecraft.client.item.TooltipContext;
import net.minecraft.item.FoodComponent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.world.World;

import java.util.List;

/**
 * Extends this class to new your food.
 */
public class ItemFood extends Item {
    private final int hunger;
    private final float saturation;

    public ItemFood(Settings settings, int hunger, float saturation) {
        super(settings.food(new FoodComponent.Builder().hunger(hunger).saturationModifier(saturation).build()));
        this.hunger = hunger;
        this.saturation = saturation;
    }

    /*public ItemFood(Settings settings, int hunger) {
        this(settings, hunger, 0.8F);
    }*/

    public static void addFoodTip(List<Text> tooltip, int hunger, float saturation, boolean isWolfFood) {
        tooltip.add(new TranslatableText("item.food.hunger", hunger));
        tooltip.add(new TranslatableText("item.food.saturation", saturation));
        tooltip.add(new TranslatableText("item.food.isWolfFood", isWolfFood));
    }

    /**
     * In game, your item will be display like this below:<pre>
     * |------------------------|
     * | Item name              |
     * |                        |
     * | Hunger: 1              |
     * | Saturation: 0.8        |
     * | Can feed the wolf: true|
     * |------------------------|</pre>
     *
     * @param stack   Stack
     * @param world   World
     * @param tooltip Tooltip list
     * @param context Tooltip Context
     */
    @Override
    public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context) {
        addFoodTip(tooltip, hunger, saturation, false);
    }

    /**
     * This class is same as {@link ItemFood} but it can feed the wolves.
     */
    public static class Meat extends Item {
        private final int hunger;
        private final float saturation;

        public Meat(Settings settings, int hunger, float saturation) {
            super(settings.food(new FoodComponent.Builder().hunger(hunger).saturationModifier(saturation).meat().build()));
            this.hunger = hunger;
            this.saturation = saturation;
        }

        public Meat(ItemGroup itemGroup, int hunger, float saturation) {
            this(new Settings().group(itemGroup), hunger, saturation);
        }

        @Override
        public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context) {
            ItemFood.addFoodTip(tooltip, hunger, saturation, true);
        }

        public static class Big extends Item {
            private final int hunger;
            private final float saturation;

            public Big(Settings settings, int hunger, float saturation) {
                super(settings.food(new FoodComponent.Builder().hunger(hunger).saturationModifier(saturation).meat().alwaysEdible().build()));
                this.hunger = hunger;
                this.saturation = saturation;
            }

            public Big(ItemGroup itemGroup, int hunger, float saturation) {
                this(new Settings().group(itemGroup), hunger, saturation);
            }

            @Override
            public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context) {
                ItemFood.addFoodTip(tooltip, hunger, saturation, true);
                tooltip.add(new TranslatableText("item.food.alwaysEdible"));
            }
        }
    }
}


<|start_filename|>backup/squid233/squidcraft/mixin/PlayerEntityMixin.java<|end_filename|>
package io.github.squid233.squidcraft.mixin;

import io.github.squid233.squidcraft.util.register.ItemRegister;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(PlayerEntity.class)
public abstract class PlayerEntityMixin extends LivingEntity {
    @Shadow
    public abstract void addExperience(int experience);

    protected PlayerEntityMixin(EntityType<? extends LivingEntity> entityType, World world) {
        super(entityType, world);
    }

    @Inject(method = "tick", at = @At("HEAD"))
    private void tick(CallbackInfo c) {
        Item helmet = this.getEquippedStack(EquipmentSlot.HEAD).getItem();
        Item chestplate = this.getEquippedStack(EquipmentSlot.CHEST).getItem();
        Item leggings = this.getEquippedStack(EquipmentSlot.LEGS).getItem();
        Item boots = this.getEquippedStack(EquipmentSlot.FEET).getItem();

        if (helmet.equals(ItemRegister.SQUID_HELMET) && chestplate.equals(ItemRegister.SQUID_CHESTPLATE) && leggings.equals(ItemRegister.SQUID_LEGGINGS) && boots.equals(ItemRegister.SQUID_BOOTS)) {
            this.addStatusEffect(new StatusEffectInstance(StatusEffects.NIGHT_VISION, 20 * 3, 0));
        }
    }

}


<|start_filename|>src/main/resources/data/squidcraft/recipes/eight_squid_block.json<|end_filename|>
{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
    {
      "item": "squidcraft:four_squid_block"
    },
    {
      "item": "squidcraft:four_squid_block"
    }
  ],
  "result": {
    "item": "squidcraft:eight_squid_block"
  }
}

<|start_filename|>backup/squid233/squidcraft/armor/ArmorMaterials.java<|end_filename|>
package io.github.squid233.squidcraft.armor;

import io.github.squid233.squidcraft.util.register.ItemRegister;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy;

import java.util.function.Supplier;

public enum ArmorMaterials implements ArmorMaterial {
    SQUID("squid", 5, new int[]{5, 8, 7, 4}, 15, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0, 0.5f, () -> {
        return Ingredient.ofItems(ItemRegister.SQUID_COOKIE);
    });

    private static final int[] BASE_DURABILITY = {13, 15, 16, 11};
    private final String name;
    private final int durabilityMultiplier;
    private final int[] protectionAmounts;
    private final int enchantability;
    private final SoundEvent equipSound;
    private final float knockBackResistance;
    private final float toughness;
    private final Lazy<Ingredient> repairIngredient;

    ArmorMaterials(String name, int durabilityMultiplier, int[] armorValueArr, int enchantability, SoundEvent soundEvent, float knockBackResistance, float toughness, Supplier<Ingredient> repairIngredient) {
        this.name = name;
        this.durabilityMultiplier = durabilityMultiplier;
        this.protectionAmounts = armorValueArr;
        this.enchantability = enchantability;
        this.equipSound = soundEvent;
        this.knockBackResistance = knockBackResistance;
        this.toughness = toughness;
        this.repairIngredient = new Lazy<>(repairIngredient);
    }

    @Override
    public int getDurability(EquipmentSlot slot) {
        return BASE_DURABILITY[slot.getEntitySlotId()] * this.durabilityMultiplier;
    }

    @Override
    public int getProtectionAmount(EquipmentSlot slot) {
        return this.protectionAmounts[slot.getEntitySlotId()];
    }

    @Override
    public int getEnchantability() {
        return this.enchantability;
    }

    @Override
    public SoundEvent getEquipSound() {
        return this.equipSound;
    }

    @Override
    public Ingredient getRepairIngredient() {
        return this.repairIngredient.get();
    }

    @Environment(EnvType.CLIENT)
    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public float getToughness() {
        return this.toughness;
    }

    @Override
    public float getKnockbackResistance() {
        return this.knockBackResistance;
    }
}


<|start_filename|>backup/squid233/squidcraft/util/ModEntities.java<|end_filename|>
package io.github.squid233.squidcraft.util;

import io.github.squid233.squidcraft.entity.CookieCreeperEntity;
import io.github.squid233.squidcraft.entity.CubeEntity;
import io.github.squid233.squidcraft.entity.LavaSquidEntity;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.registry.Registry;

public class ModEntities {

    /*
     * Registers our Cube Entity under the ID "squidcraft:cube".
     *
     * The entity is registered under the SpawnGroup#CREATURE category, which is what most animals and passive/neutral mobs use.
     * It has a hitbox size of .75x.75, or 12 "pixels" wide (3/4ths of a block).
     */
    public static final EntityType<CubeEntity> CUBE = Registry.register(
            Registry.ENTITY_TYPE,
            new Identifier("cube"),
            FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, CubeEntity::new).dimensions(EntityDimensions.fixed(0.75f, 0.75f)).build()
    );

    public static final EntityType<CookieCreeperEntity> COOKIE_CREEPER = Registry.register(
            Registry.ENTITY_TYPE,
            new Identifier("cookie_creeper"),
            FabricEntityTypeBuilder.create(SpawnGroup.MONSTER, CookieCreeperEntity::new).dimensions(EntityDimensions.fixed(1, 2)).build()
    );

    public static final EntityType<LavaSquidEntity> LAVA_SQUID = Registry.register(
            Registry.ENTITY_TYPE,
            new Identifier("lava_squid"),
            FabricEntityTypeBuilder.create(SpawnGroup.CREATURE, LavaSquidEntity::new).dimensions(EntityDimensions.fixed(0.8F, 0.8F)).build()
    );

    public ModEntities() {
        add();
        /*if (LocalDate.now().getMonth().equals(Month.APRIL) && LocalDate.now().getDayOfMonth() == 1) {
            Biomes.PLAINS.getEntitySpawnList(SpawnGroup.MONSTER).add(new SpawnSettings.SpawnEntry(ModEntities.COOKIE_CREEPER, 30, 1, 2));
        }
        Biomes.PLAINS.getEntitySpawnList(SpawnGroup.CREATURE).add(new SpawnSettings.SpawnEntry(ModEntities.CUBE, 20, 1, 3));
        Biomes.NETHER_WASTES.getEntitySpawnList(SpawnGroup.CREATURE).add(new SpawnSettings.SpawnEntry(ModEntities.LAVA_SQUID, 15, 1, 2));*/
    }

    public void add() {
        /*
         * Register our Cube Entity's default attributes.
         * Attributes are properties or stats of the mobs, including things like attack damage and health.
         * The game will crash if the entity doesn't have the proper attributes registered in time.
         *
         * In 1.16, this was done by a method override inside the entity class.
         * Most vanilla entities have a static method (eg. ZombieEntity#createZombieAttributes) for initializing their attributes.
         */
        FabricDefaultAttributeRegistry.register(CUBE, CubeEntity.createMobAttributes());
        FabricDefaultAttributeRegistry.register(COOKIE_CREEPER, CookieCreeperEntity.createCreeperAttributes());
        FabricDefaultAttributeRegistry.register(LAVA_SQUID, LavaSquidEntity.createSquidAttributes());
    }
}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/util/Identifier.java<|end_filename|>
package io.github.squid233.squidcraft.util;

import io.github.squid233.squidcraft.SquidCraft;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class Identifier extends net.minecraft.util.Identifier {
    public Identifier(String path) {
        super(SquidCraft.MODID, path);
    }

    @Override
    public boolean equals(Object object) {
        return super.equals(object);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }
}


<|start_filename|>backup/squid233/squidcraft/modmenu/NormalTexts.java<|end_filename|>
package io.github.squid233.squidcraft.modmenu;

import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;

public class NormalTexts {
    public static final Text FALSE = new LiteralText("false");
    public static final Text TRUE = new LiteralText("true");
}


<|start_filename|>backup/squid233/squidcraft/util/Identifier.java<|end_filename|>
package io.github.squid233.squidcraft.util;

import io.github.squid233.squidcraft.SquidCraft;

/**
 * @author squid233
 */
public class Identifier extends net.minecraft.util.Identifier {
    public Identifier(String path) {
        super(SquidCraft.MODID, path);
    }
}


<|start_filename|>backup/squid233/squidcraft/util/register/FluidRegister.java<|end_filename|>
package io.github.squid233.squidcraft.util.register;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.api.FluidRegistries;
import io.github.squid233.squidcraft.fluid.MilkFluid;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.FluidBlock;
import net.minecraft.fluid.FlowableFluid;

public class FluidRegister {
    public static final FlowableFluid STILL_MILK = new MilkFluid.Still();
    public static final FlowableFluid FLOWING_MILK = new MilkFluid.Flowing();
    public static final Block MILK = new FluidBlock(STILL_MILK, FabricBlockSettings.copy(Blocks.WATER)){};

    public FluidRegister() {
        registerFluid("milk", STILL_MILK, FLOWING_MILK, MILK);
    }

    public void registerFluid(String fluidName, FlowableFluid stillFluid, FlowableFluid flowingFluid, Block fluidBlock) {
        FluidRegistries.registerFluid(SquidCraft.MODID, fluidName, stillFluid, flowingFluid, fluidBlock);
    }
}


<|start_filename|>backup/squid233/squidcraft/config/Configs.java<|end_filename|>
package io.github.squid233.squidcraft.config;

public class Configs {
    public static final String HIDE_MAIN_SCREEN_BUTTON = "hideMainScreenButton";
    public static final String SQUID_BLOCK_SPAWN_SIZE = "squidBlockSpawnSize";
    public static final String SQUID_BLOCK_PER_CHUNK_SPAWN_COUNT = "squidBlockPerChunkSpawnCount";
    public static final String SQUID_BLOCK_SPAWN_MIN_Y_LEVEL = "squidBlockSpawnMinYLevel";
    public static final String SQUID_BLOCK_SPAWN_MAX_Y_LEVEL = "squidBlockSpawnMaxYLevel";
    public static final String ELECTRIC_POWER_MAX_LEVEL = "electricPowerMaxLevel";
    public static final String YOUR_ITEM_MAX_COUNT = "yourItemMaxCount";
    public static final String YOUR_ITEM_2_MAX_VALUE = "yourItemTwoMaxCount";
    public static final String ENABLE_REGISTER_LOG = "enableRegisterLog";
}


<|start_filename|>backup/squid233/yummyfood/YummyFood.java<|end_filename|>
package io.github.squid233.yummyfood;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.api.RegistryAll;
import io.github.squid233.squidcraft.api.item.ItemFood;
import io.github.squid233.yummyfood.item.ItemGroup;
import net.fabricmc.api.ModInitializer;
import net.minecraft.item.Item;

public final class YummyFood implements ModInitializer {

    private static final String[] itemsName = {"pineapple", "tomato" , "sausage", "cooked_sausage", "hot_dog"};

    public static final Item PINEAPPLE = new ItemFood(new Item.Settings().group(ItemGroup.YUMMYFOOD), 4, 0.4f);
    public static final Item TOMATO = new ItemFood(new Item.Settings().group(ItemGroup.YUMMYFOOD), 2, 0.5f);
    public static final Item SAUSAGE = new ItemFood.Meat(new Item.Settings().group(ItemGroup.YUMMYFOOD), 9, 0.9f);
    public static final Item COOKED_SAUSAGE = new ItemFood.Meat(new Item.Settings().group(ItemGroup.YUMMYFOOD), 24, 2.4f);
    public static final Item HOT_DOG = new ItemFood(new Item.Settings().group(ItemGroup.YUMMYFOOD), 31, 3.5f);

    private static final Item[] items = {
            PINEAPPLE, TOMATO, SAUSAGE, COOKED_SAUSAGE, HOT_DOG
    };

    private static void register(Item... items) {
        RegistryAll.registerItems(SquidCraft.MODID, itemsName, items);
    }

    @Override
    public void onInitialize() {
        register(items);
    }

}


<|start_filename|>backup/squid233/squidcraft/api/ItemRegistries.java<|end_filename|>
package io.github.squid233.squidcraft.api;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.api.util.Loggers;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

/**
 * items register api → (item, tool and armor) register.
 */
public class ItemRegistries {

    /**
     * <h1>The register method</h1>
     * <p>You can use this method just like this below:</p>
     * <code>public static final {@link Item} EXAMPLE_ITEM = register("modid", "example", new {@link Item}(new {@link Item.Settings}());</code>
     * <p>After register, log4j will be remind you: "register modid:example success!"</p>
     * @param modid Mod identifier.
     * @param name Item registry name.
     * @param item Item.
     * @return Register item.
     */
    public static Item register(String modid, String name, Item item) {
        if (Loggers.enableRegisterLog) {
            SquidCraft.debug("register " + modid + ":" + name + " success!");
        }
        return Registry.register(Registry.ITEM, new Identifier(modid, name), item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Helmet prefix.
     * @param item Helmet item.
     * @return Register item.
     */
    public static Item registerHelmet(String modid, String name, Item item) {
        return register(modid, name + "_helmet", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Chestplate prefix.
     * @param item Chestplate item.
     * @return Register item.
     */
    public static Item registerChestplate(String modid, String name, Item item) {
        return register(modid, name + "_chestplate", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Leggings prefix.
     * @param item Leggings item.
     * @return Register item.
     */
    public static Item registerLeggings(String modid, String name, Item item) {
        return register(modid, name + "_leggings", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Boots prefix.
     * @param item Boots item.
     * @return Register item.
     */
    public static Item registerBoots(String modid, String name, Item item) {
        return register(modid, name + "_boots", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Axe prefix.
     * @param item Axe item.
     * @return Register item.
     */
    public static Item registerAxe(String modid, String name, Item item) {
        return register(modid, name + "_axe", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Hoe prefix.
     * @param item Hoe item.
     * @return Register item.
     */
    public static Item registerHoe(String modid, String name, Item item) {
        return register(modid, name + "_hoe", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Pickaxe prefix.
     * @param item Pickaxe item.
     * @return Register item.
     */
    public static Item registerPickaxe(String modid, String name, Item item) {
        return register(modid, name + "_pickaxe", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Shovel prefix.
     * @param item Shovel item.
     * @return Register item.
     */
    public static Item registerShovel(String modid, String name, Item item) {
        return register(modid, name + "_shovel", item);
    }

    /**
     * @param modid Mod identifier.
     * @param name Sword prefix.
     * @param item Sword item.
     * @return Register item.
     */
    public static Item registerSword(String modid, String name, Item item) {
        return register(modid, name + "_sword", item);
    }

    /**
     * <p>This method can collect {@linkplain io.github.squid233.squidcraft.api.item.Item items} and register.</p>
     * @param modid Mod identifier.
     * @param items The items.
     */
    public static void registerAll(String modid, io.github.squid233.squidcraft.api.item.Item... items) {
        for (io.github.squid233.squidcraft.api.item.Item item : items) {
            register(modid, item.getRegistryName(), item);
        }
    }

}


<|start_filename|>backup/squid233/squidcraft/block/SquidSideBlock.java<|end_filename|>
package io.github.squid233.squidcraft.block;

import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.HorizontalFacingBlock;
import net.minecraft.block.ShapeContext;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.state.StateManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;

import static net.minecraft.state.property.Properties.HORIZONTAL_FACING;

public class SquidSideBlock extends HorizontalFacingBlock {

    //private static final DirectionProperty FACING = DirectionProperty.of("facing", Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.UP, Direction.DOWN);
    //private static final DirectionProperty HORIZONTAL_FACING = DirectionProperty.of("facing", Direction.Type.HORIZONTAL);

    public SquidSideBlock(Settings settings) {
        super(settings);
        setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
    }

    @Override
    protected void appendProperties(StateManager.Builder<Block, BlockState> stateManager) {
        stateManager.add(HORIZONTAL_FACING);
    }

    @SuppressWarnings("deprecation")
    @Override
    public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
        Direction dir = state.get(FACING);
        switch(dir) {
            case NORTH:
                return VoxelShapes.cuboid(0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.5f);
            case SOUTH:
                return VoxelShapes.cuboid(0.0f, 0.0f, 0.5f, 1.0f, 1.0f, 1.0f);
            case EAST:
                return VoxelShapes.cuboid(0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
            case WEST:
                return VoxelShapes.cuboid(0.0f, 0.0f, 0.0f, 0.5f, 1.0f, 1.0f);
            default:
                return VoxelShapes.fullCube();
        }
    }

    @Override
    public BlockState getPlacementState(ItemPlacementContext ctx) {
        return this.getDefaultState().with(FACING, ctx.getPlayerFacing());
    }
}


<|start_filename|>backup/squid233/squidcraft/util/register/BlockRegister.java<|end_filename|>
package io.github.squid233.squidcraft.util.register;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.api.BlockRegistries;
import io.github.squid233.squidcraft.api.ItemRegistries;
import io.github.squid233.squidcraft.api.block.BlockFood.SquidCraftFood;
import io.github.squid233.squidcraft.api.block.BlockFood.SquidCraftFood.ItemBlock;
import io.github.squid233.squidcraft.api.util.Loggers;
import io.github.squid233.squidcraft.block.SquidSideBlock;
import io.github.squid233.squidcraft.block.tile.BiggerChestBlock;
import io.github.squid233.squidcraft.block.tile.BiggerChestBlockEntity;
import io.github.squid233.squidcraft.client.gui.BiggerChestScreenHandler;
import io.github.squid233.squidcraft.item.ItemGroups;
import io.github.squid233.squidcraft.util.Identifier;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.CarrotsBlock;
import net.minecraft.block.CarvedPumpkinBlock;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.FoodComponent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemGroup;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.registry.Registry;

import static io.github.squid233.squidcraft.item.ItemGroups.SQUID_CRAFT;

/**
 * You always register block, add {@link ItemGroups}, add lang, add blockstates, add models, add textures, add loot tables and add recipes.
 */
public class BlockRegister {

    private static Block register(String name, Block block, Item.Settings settings) {
        return BlockRegistries.register(SquidCraft.MODID, name, block, settings);
    }

    private static Block register(String name, Block block, ItemGroup group) {
        return register(name, block, new Item.Settings().group(group));
    }

    private static Block register(String name, Block block) {
        return BlockRegistries.register(SquidCraft.MODID, name, block);
    }

    private void register(String name, Block block, ItemBlock itemBlock) {
        ItemRegistries.register(SquidCraft.MODID, name, itemBlock);
        if (Loggers.enableRegisterLog) {
            SquidCraft.debug("register " + SquidCraft.MODID + ":" + name + " block success!");
        }
        Registry.register(Registry.BLOCK, new Identifier(name), block);
    }

    public static final Block SQUID_BLOCK;
    public static final Block COMPRESS_SQUID_BLOCK;
    public static final Block LOW_SQUID_BLOCK;
    public static final Block LOW_COMPRESS_SQUID_BLOCK;
    public static final Block MEDIUM_SQUID_BLOCK;
    public static final Block MEDIUM_COMPRESS_SQUID_BLOCK;
    public static final Block HIGHER_SQUID_BLOCK;
    public static final Block HIGHER_COMPRESS_SQUID_BLOCK;
    public static final Block SUPER_SQUID_BLOCK;
    public static final Block SUPER_COMPRESS_SQUID_BLOCK;
    public static final Block ULTIMATE_SQUID_BLOCK;
    public static final Block ULTIMATE_COMPRESS_SQUID_BLOCK;
    public static final Block ONE_SQUID_BLOCK;
    public static final Block TWO_SQUID_BLOCK;
    public static final Block FOUR_SQUID_BLOCK;
    public static final Block EIGHT_SQUID_BLOCK;
    public static final Block SQUID_SIDE_BLOCK;
    public static final Block BIGGER_CHEST_BLOCK;
    public static final Block SOUL_JACK_O_LANTERN;
    public static final Block SHREDDED_SQUID_CROP;

    public static final Identifier BIGGER_CHEST = new Identifier("bigger_chest_block");
    //public static final String BIGGER_CHEST_TRANSLATION_KEY = Util.createTranslationKey("container", BIGGER_CHEST);
    public static final ScreenHandlerType<BiggerChestScreenHandler> BIGGER_CHEST_SCREEN_HANDLER_TYPE = ScreenHandlerRegistry.registerSimple(BIGGER_CHEST, BiggerChestScreenHandler::new);

    public static BlockEntityType<BiggerChestBlockEntity> BIGGER_CHEST_ENTITY_TYPE;
    public static final BiggerChestBlockEntity BIGGER_CHEST_BLOCK_ENTITY = new BiggerChestBlockEntity();

    static {
        // Squid blocks begin
        SQUID_BLOCK = new SquidCraftFood(0.5f, 1400, 128);
        COMPRESS_SQUID_BLOCK = new SquidCraftFood(0.525f, 6300, 192);
        LOW_SQUID_BLOCK = new SquidCraftFood(0.55f, 0.1f, 28350, 288);
        LOW_COMPRESS_SQUID_BLOCK = new SquidCraftFood(0.6f, 0.15f, 127575, 432);
        MEDIUM_SQUID_BLOCK = new SquidCraftFood(0.65f, 0.2f, 574088, 648);
        MEDIUM_COMPRESS_SQUID_BLOCK = new SquidCraftFood(0.7f, 0.25f, 1148175, 972);
        HIGHER_SQUID_BLOCK = new SquidCraftFood(0.75f, 0.3f, 1722262, 1458);
        HIGHER_COMPRESS_SQUID_BLOCK = new SquidCraftFood(0.8f, 0.35f, 2583394, 2187);
        SUPER_SQUID_BLOCK = new SquidCraftFood(0.85f, 0.4f, 3875091, 3281);
        SUPER_COMPRESS_SQUID_BLOCK = new SquidCraftFood(0.9f, 0.45f, 5812636, 4921);
        ULTIMATE_SQUID_BLOCK = new SquidCraftFood(0.95f, 0.5f, 6393900, 7381);
        ULTIMATE_COMPRESS_SQUID_BLOCK = new SquidCraftFood(1, 0.55f, 7033289, 11072);
        // Squid blocks end

        // Multi squid blocks begin
        ONE_SQUID_BLOCK = new SquidCraftFood(1.5f, 0.6f, 7384954, 12179);
        TWO_SQUID_BLOCK = new SquidCraftFood(2, 0.65f, 7754202, 13397);
        FOUR_SQUID_BLOCK = new SquidCraftFood(2.5f, 0.7f, 8141912, 14736);
        EIGHT_SQUID_BLOCK = new SquidCraftFood(3, 0.75f, 8549007, 16210);
        // Multi squid blocks end

        SQUID_SIDE_BLOCK = register("squid_side_block", new SquidSideBlock(FabricBlockSettings.of(Material.SOIL).hardness(0.5f)),
                new Item.Settings().group(SQUID_CRAFT).food(new FoodComponent.Builder().hunger(700).saturationModifier(64).meat().alwaysEdible().build()));

        BIGGER_CHEST_BLOCK = new BiggerChestBlock(FabricBlockSettings.of(Material.METAL));

        SOUL_JACK_O_LANTERN = register("soul_jack_o_lantern", new CarvedPumpkinBlock(AbstractBlock.Settings.copy(Blocks.JACK_O_LANTERN)) {
        }, SQUID_CRAFT);

        SHREDDED_SQUID_CROP = register("shredded_squid_crop", new CarrotsBlock(FabricBlockSettings.copyOf(Blocks.CARROTS)) {
            @Override
            protected ItemConvertible getSeedsItem() {
                return ItemRegister.SHREDDED_SQUID;
            }
        });
    }

    public BlockRegister() {
        registerContainer(new Item.Settings().group(SQUID_CRAFT));
        BIGGER_CHEST_ENTITY_TYPE = Registry.register(Registry.BLOCK_ENTITY_TYPE, BIGGER_CHEST,
                BlockEntityType.Builder.create(BiggerChestBlockEntity::new, BIGGER_CHEST_BLOCK).build(null));

        /*ContainerProviderRegistry.INSTANCE.registerFactory(BIGGER_CHEST, (syncId, identifier, player, buf) -> {
            final BlockPos pos = buf.readBlockPos();
            return Objects.requireNonNull(player.world.getBlockState(pos).createScreenHandlerFactory(player.world, pos))
                    .createMenu(syncId, player.inventory, player);
        });*/

        register("squid_block", SQUID_BLOCK, new ItemBlock(SQUID_BLOCK));
        register("compress_squid_block", COMPRESS_SQUID_BLOCK, new ItemBlock(COMPRESS_SQUID_BLOCK));
        register("low_squid_block", LOW_SQUID_BLOCK, new ItemBlock(LOW_SQUID_BLOCK));
        register("low_compress_squid_block", LOW_COMPRESS_SQUID_BLOCK, new ItemBlock(LOW_COMPRESS_SQUID_BLOCK));
        register("medium_squid_block", MEDIUM_SQUID_BLOCK, new ItemBlock(MEDIUM_SQUID_BLOCK));
        register("medium_compress_squid_block", MEDIUM_COMPRESS_SQUID_BLOCK, new ItemBlock(MEDIUM_COMPRESS_SQUID_BLOCK));
        register("higher_squid_block", HIGHER_SQUID_BLOCK, new ItemBlock(HIGHER_SQUID_BLOCK));
        register("higher_compress_squid_block", HIGHER_COMPRESS_SQUID_BLOCK, new ItemBlock(HIGHER_COMPRESS_SQUID_BLOCK));
        register("super_squid_block", SUPER_SQUID_BLOCK, new ItemBlock(SUPER_SQUID_BLOCK));
        register("super_compress_squid_block", SUPER_COMPRESS_SQUID_BLOCK, new ItemBlock(SUPER_COMPRESS_SQUID_BLOCK));
        register("ultimate_squid_block", ULTIMATE_SQUID_BLOCK, new ItemBlock(ULTIMATE_SQUID_BLOCK));
        register("ultimate_compress_squid_block", ULTIMATE_COMPRESS_SQUID_BLOCK, new ItemBlock(ULTIMATE_COMPRESS_SQUID_BLOCK));

        register("one_squid_block", ONE_SQUID_BLOCK, new ItemBlock(ONE_SQUID_BLOCK));
        register("two_squid_block", TWO_SQUID_BLOCK, new ItemBlock(TWO_SQUID_BLOCK));
        register("four_squid_block", FOUR_SQUID_BLOCK, new ItemBlock(FOUR_SQUID_BLOCK));
        register("eight_squid_block", EIGHT_SQUID_BLOCK, new ItemBlock(EIGHT_SQUID_BLOCK));


    }

    private void registerContainer(Item.Settings settings) {
        Registry.register(Registry.BLOCK, BIGGER_CHEST, BIGGER_CHEST_BLOCK);
        Registry.register(Registry.ITEM, BIGGER_CHEST, new BlockItem(BIGGER_CHEST_BLOCK, settings));
        SquidCraft.logInfo("register container");
    }

}

<|start_filename|>backup/squid233/squidcraft/SquidCraft.java<|end_filename|>
package io.github.squid233.squidcraft;

import io.github.squid233.squidcraft.api.util.Loggers;
import io.github.squid233.squidcraft.config.CreateConfig;
import io.github.squid233.squidcraft.util.ModEntities;
import io.github.squid233.squidcraft.util.handle.LootTablesHandle;
import io.github.squid233.squidcraft.util.register.*;
import net.fabricmc.api.ModInitializer;
import org.apache.logging.log4j.LogManager;

/**
 * @author squid233 and baka4n → (logger4j test)!
 */
public final class SquidCraft implements ModInitializer {

	public static final String MODID = "squidcraft";

	@Override
	public void onInitialize() {
		CreateConfig.create();
		new ItemRegister();
		logInfo("item register success");
		new BlockRegister();
		logInfo("block register success");
		new FluidRegister();
		logInfo("fluid register success");
		new EnchantmentRegister();
		logInfo("enchantment register success");
		new WorldGenRegister();
		logInfo("world generator register success");
		new LootTablesHandle();
		logInfo("loot table register success");
		new ModEntities();
		logInfo("entities register success");
		new SoundsRegister();
		logInfo("sounds register success");
		logInfo("load on initialize success");
	}

	public static void logInfo(String info) {
		Loggers.logInfo("SquidCraft", info);
	}

	public static void debug(String debug) {
		LogManager.getLogger("SquidCraft").debug(debug);
	}

}


<|start_filename|>backup/squid233/squidcraft/util/ModEnchantments.java<|end_filename|>
package io.github.squid233.squidcraft.util;

import net.minecraft.enchantment.Enchantment;

public class ModEnchantments {
    public static Enchantment FROST;
    public static Enchantment FIRE_BOOM;
    public static Enchantment INSANE;
    public static Enchantment ELECTRIC_POWER;
}


<|start_filename|>backup/squid233/squidcraft/api/RegistryAll.java<|end_filename|>
package io.github.squid233.squidcraft.api;

import net.minecraft.item.Item;

public class RegistryAll {

    public static void registerItems(String namespace, String[] itemsName, Item... items) {
        for (int i = 0; i < itemsName.length; i++) {
            ItemRegistries.register(namespace, itemsName[i], items[i]);
        }
    }
}


<|start_filename|>backup/squid233/squidcraft/api/BlockRegistries.java<|end_filename|>
package io.github.squid233.squidcraft.api;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.api.util.Loggers;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class BlockRegistries {
    /**
     * <h1>The register method</h1>
     * <p>You can use this method just like this below:</p>
     * <code>public static final {@link Block} EXAMPLE_BLOCK = register("modid", "example", new {@link Block}(new {@link Block.Settings}()), new {@link Item.Settings}());</code>
     * <p>After register, log4j will be tell you:</p>
     * <code>"register modid:example success!"<br>
     * "register modid:example block success!"</code>
     *
     * @param modid    Mod identifier.
     * @param name     Block registry name.
     * @param block    Block.
     * @param settings Block item settings.
     * @return Register block.
     */
    public static Block register(String modid, String name, Block block, Item.Settings settings) {
        ItemRegistries.register(modid, name, new BlockItem(block, settings));
        if (Loggers.enableRegisterLog) {
            SquidCraft.debug("register " + modid + ":" + name + " block success!");
        }
        return Registry.register(Registry.BLOCK, new Identifier(modid, name), block);
    }

    public static Block register(String modid, String name, Block block) {
        if (Loggers.enableRegisterLog) {
            SquidCraft.debug("register " + modid + ":" + name + " block success!");
        }
        return Registry.register(Registry.BLOCK, new Identifier(modid, name), block);
    }
}


<|start_filename|>backup/squid233/squidcraft/util/register/WorldGenRegister.java<|end_filename|>
package io.github.squid233.squidcraft.util.register;

/*import io.github.squid233.squidcraft.util.ModBiomes;
 *import net.fabricmc.fabric.api.biomes.v1.FabricBiomes;
 *import net.fabricmc.fabric.api.biomes.v1.OverworldBiomes;
 *import net.fabricmc.fabric.api.biomes.v1.OverworldClimate;
 */

import io.github.squid233.squidcraft.mixin.VanillaLayeredBiomeSourceAccessor;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.Biome;

import java.util.ArrayList;
import java.util.List;

import static io.github.squid233.squidcraft.util.ModBiomes.*;

public class WorldGenRegister {

    public WorldGenRegister() {

        /*
        OverworldBiomes.addContinentalBiome(ModBiomes.SQUID_BIOME, OverworldClimate.TEMPERATE, 3d);
        OverworldBiomes.addShoreBiome(ModBiomes.SQUID_BIOME, Biomes.BEACH, 1);
        FabricBiomes.addSpawnBiome(ModBiomes.SQUID_BIOME);

        OverworldBiomes.addContinentalBiome(ModBiomes.CHAOS_SQUID_BIOME, OverworldClimate.TEMPERATE, 3d);
        OverworldBiomes.addShoreBiome(ModBiomes.CHAOS_SQUID_BIOME, Biomes.BEACH, 1);
        FabricBiomes.addSpawnBiome(ModBiomes.CHAOS_SQUID_BIOME);
         */

        List<RegistryKey<Biome>> biomes = new ArrayList<>(VanillaLayeredBiomeSourceAccessor.getBiomes());
        biomes.add(SQUID_BIOME_KEY);
        biomes.add(CHAOS_SQUID_BIOME_KEY);
        VanillaLayeredBiomeSourceAccessor.setBiomes(biomes);
    }
}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/AxeItem.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import net.minecraft.item.ToolMaterial;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class AxeItem extends net.minecraft.item.AxeItem {
    public AxeItem(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
        super(material, attackDamage, attackSpeed, settings);
    }
}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/Items.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import io.github.squid233.squidcraft.util.Identifier;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ShovelItem;
import net.minecraft.item.SwordItem;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;

import java.util.HashMap;
import java.util.List;

import static io.github.squid233.squidcraft.item.ItemGroups.SQUID_CRAFT;
import static io.github.squid233.squidcraft.item.ItemGroups.SQUID_CRAFT_COMBAT_AND_TOOLS;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class Items {
    private static final HashMap<net.minecraft.util.Identifier, Item> MAP = new HashMap<>(19);
    public static final Item.Settings SQUID_CRAFT_SETTING = new SettingsGroup(SQUID_CRAFT);

    public static final Item SHREDDED_SQUID;
    public static final Item COOKED_SHREDDED_SQUID;
    public static final Item A_PILE_COOKED_SHREDDED_SQUID;
    public static final Item SQUID_COOKIE;
    public static final Item SQUID_HELMET;
    public static final Item SQUID_CHESTPLATE;
    public static final Item SQUID_LEGGINGS;
    public static final Item SQUID_BOOTS;
    public static final Item SQUID_AXE;
    public static final Item SQUID_HOE;
    public static final Item SQUID_PICKAXE;
    public static final Item SQUID_SHOVEL;
    public static final Item SQUID_SWORD;

    static {
        SHREDDED_SQUID = reg("shredded_squid", new FoodItem(SQUID_CRAFT_SETTING, 1, 0.4f).meat().build());
        COOKED_SHREDDED_SQUID = reg("cooked_shredded_squid", new FoodItem(SQUID_CRAFT_SETTING, 2, 0.6f).meat().build());
        A_PILE_COOKED_SHREDDED_SQUID = reg("a_pile_cooked_shredded_squid", new FoodItem(SQUID_CRAFT_SETTING, 18, 0.8f).meat().build());
        SQUID_COOKIE = reg("squid_cookie", new FoodItem(SQUID_CRAFT_SETTING, 162, 3.2f) {
            @Override
            public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
                super.appendTooltip(stack, world, tooltip, context);
                tooltip.add(new TranslatableText("item.squidcraft.squid_cookie.tooltip"));
            }
        }.meat().alwaysEdible().build());
        SQUID_HELMET = regArmor(ArmorMaterials.SQUID, EquipmentSlot.HEAD, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS));
        SQUID_CHESTPLATE = regArmor(ArmorMaterials.SQUID, EquipmentSlot.CHEST, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS));
        SQUID_LEGGINGS = regArmor(ArmorMaterials.SQUID, EquipmentSlot.LEGS, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS));
        SQUID_BOOTS = regArmor(ArmorMaterials.SQUID, EquipmentSlot.FEET, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS));
        SQUID_AXE = reg("squid_axe", new AxeItem(ToolMaterials.SQUID, 0, -2.2f, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS)));
        SQUID_HOE = reg("squid_hoe", new HoeItem(ToolMaterials.SQUID, -4, -2.4f, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS)));
        SQUID_PICKAXE = reg("squid_pickaxe", new PickaxeItem(ToolMaterials.SQUID, -1, -1, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS)));
        SQUID_SHOVEL = reg("squid_shovel", new ShovelItem(ToolMaterials.SQUID, -2, -2, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS)));
        SQUID_SWORD = reg("squid_sword", new SwordItem(ToolMaterials.SQUID, -1, 0, new SettingsGroup(SQUID_CRAFT_COMBAT_AND_TOOLS)));
    }

    private static Item reg(String id, Item item) {
        MAP.put(new Identifier(id), item);
        return item;
    }

    private static Item regArmor(ArmorMaterial material, EquipmentSlot slot, Item.Settings settings) {
        String type;
        switch (slot.getName()) {
            case "head":
                type = "helmet";
                break;
            case "chest":
                type = "chestplate";
                break;
            case "legs":
                type = "leggings";
                break;
            case "feet":
                type = "boots";
                break;
            default:
                type = "";
        }
        return reg(material.getName() + "_" + type, new ArmorItem(material, slot, settings));
    }

    private static boolean initialized = false;
    public static void init() {
        if (!initialized) {
            initialized = true;
            MAP.forEach((identifier, item) -> Registry.register(Registry.ITEM, identifier, item));
        }
    }
}


<|start_filename|>backup/squid233/squidcraft/client/gui/AuthorsGui.java<|end_filename|>
package io.github.squid233.squidcraft.client.gui;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ScreenTexts;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;

public class AuthorsGui extends Screen {
    private final Screen screen;

    public AuthorsGui(Screen screen) {
        super(new LiteralText(""));
        this.screen = screen;
    }

    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float delta) {
        renderBackground(matrixStack);
        tooltip("authors.squidcraft.info", this.width / 100, this.height / 9);
        tooltip("squid233", 21 * this.width / 100, this.height / 9);
        tooltip("baka4n", 41 * this.width / 100, this.height / 9);
        super.render(matrixStack, mouseX, mouseY, delta);
    }

    @Override
    public void init() {
        myButton(3 * this.width / 4, 8 * this.height / 9, ScreenTexts.BACK, (buttonWidget) -> this.screen.onClose());
    }

    private void myButton(int x, int y, Text text, ButtonWidget.PressAction button) {
        this.addButton(new ButtonWidget(x, y, 100, 20, text, button));
    }

    private void tooltip(String translationKey, int x, int y) {
        renderTooltip(new MatrixStack(), new TranslatableText(translationKey), x, y);
    }
}


<|start_filename|>backup/squid233/squidcraft/entity/CookieCreeperRenderer.java<|end_filename|>
package io.github.squid233.squidcraft.entity;

import io.github.squid233.squidcraft.SquidCraft;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.MobEntityRenderer;
import net.minecraft.client.render.entity.model.CreeperEntityModel;
import net.minecraft.util.Identifier;

public class CookieCreeperRenderer extends MobEntityRenderer<CookieCreeperEntity, CreeperEntityModel<CookieCreeperEntity>> {

    public CookieCreeperRenderer(EntityRenderDispatcher entityRenderDispatcher) {
        super(entityRenderDispatcher, new CreeperEntityModel<>(), 1);
    }

    @Override
    public Identifier getTexture(CookieCreeperEntity entity) {
        return new Identifier(SquidCraft.MODID, "textures/entity/cookie_creeper.png");
    }
}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/ToolMaterials.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy;

import java.util.function.Supplier;

/**
 * @author squid233
 * @date 2020/9/20
 */
public enum ToolMaterials implements ToolMaterial {
    /**
     * Squid toll material
     */
    SQUID(250, 10, 7, 4, 15, () -> Ingredient.ofItems(Items.SQUID_COOKIE));

    private final int durability;
    private final float miningSpeed;
    private final float attackDamage;
    private final int miningLevel;
    private final int enchantability;
    private final Lazy<Ingredient> repairIngredient;

    ToolMaterials(int durability, float miningSpeed, float attackDamage, int miningLevel, int enchantability, Supplier<Ingredient> repairIngredient) {
        this.durability = durability;
        this.miningSpeed = miningSpeed;
        this.attackDamage = attackDamage;
        this.miningLevel = miningLevel;
        this.enchantability = enchantability;
        this.repairIngredient = new Lazy<>(repairIngredient);
    }

    @Override
    public int getDurability() {
        return durability;
    }

    @Override
    public float getMiningSpeedMultiplier() {
        return miningSpeed;
    }

    @Override
    public float getAttackDamage() {
        return attackDamage;
    }

    @Override
    public int getMiningLevel() {
        return miningLevel;
    }

    @Override
    public int getEnchantability() {
        return enchantability;
    }

    @Override
    public Ingredient getRepairIngredient() {
        return repairIngredient.get();
    }
}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/SettingsGroup.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class SettingsGroup extends Item.Settings {
    public SettingsGroup(ItemGroup group) {
        super();
        group(group);
    }
}


<|start_filename|>backup/squid233/squidcraft/api/block/BlockFood.java<|end_filename|>
package io.github.squid233.squidcraft.api.block;

import io.github.squid233.squidcraft.item.ItemGroups;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.item.BlockItem;
import net.minecraft.item.FoodComponent;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.world.BlockView;

import javax.annotation.Nullable;
import java.util.List;

public class BlockFood {

    public static class SquidCraftFood extends Block {

        private final int hunger;
        private final float saturationModifier;

        public SquidCraftFood(float hardness, float resistance, int hunger, float saturation) {
            super(FabricBlockSettings.of(Material.SOIL).strength(hardness, resistance));
            this.hunger = hunger;
            this.saturationModifier = saturation;
        }

        public SquidCraftFood(float hardness, int hunger, float saturation) {
            this(hardness, 0, hunger, saturation);
        }

        @Override
        public void appendTooltip(ItemStack stack,
                                 @Nullable BlockView world,
                                 List<Text> tooltip,
                                 TooltipContext options) {
            tooltip.add(new TranslatableText("item.food.hunger", hunger));
            tooltip.add(new TranslatableText("item.food.saturation", saturationModifier));
            tooltip.add(new TranslatableText("item.food.isWolfFood", true));
            tooltip.add(new TranslatableText("item.food.alwaysEdible"));
        }

        public static class ItemBlock extends BlockItem {

            public ItemBlock(SquidCraftFood block) {
                super(block,
                        new Settings()
                                .group(ItemGroups.SQUID_CRAFT)
                                .food(
                                        new FoodComponent.Builder()
                                                .hunger(block.hunger)
                                                .saturationModifier(block.saturationModifier)
                                                .meat().alwaysEdible().build()));
            }

            public ItemBlock(Block block) {
                this((SquidCraftFood) block);
            }

        }
    }
}


<|start_filename|>backup/squid233/squidcraft/config/CreateConfig.java<|end_filename|>
package io.github.squid233.squidcraft.config;

import org.intellij.lang.annotations.MagicConstant;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import static io.github.squid233.squidcraft.config.Configs.*;

/**
 *@author baka4n
 * <p> 对 properties 进行有序排列</p>
 * <p> windows about SEPARATOR → \\ , linux about SEPARATOR → // , you can to linux server to running it. </p>
 */
public class CreateConfig {
    public static final String SEPARATOR = File.separator + File.separator;
	public static final MyProperties PROPERTIES = new MyProperties();

    public static void create() {
        File configs = new File("config");
        File squidcraft = new File("config" + SEPARATOR + "squidcraft");
        if (!configs.exists() && !configs.isDirectory()) {
            configs.mkdir();
        }
        if (!squidcraft.exists() && !squidcraft.isDirectory()) {
            squidcraft.mkdir();
        }
        try {
            PROPERTIES.load(new BufferedInputStream(new FileInputStream("config" + SEPARATOR + "squidcraft" + SEPARATOR + "config.properties")));
        } catch (FileNotFoundException e) {
            putIn2(HIDE_MAIN_SCREEN_BUTTON, "false", SQUID_BLOCK_SPAWN_SIZE, "3");
            putIn2(SQUID_BLOCK_PER_CHUNK_SPAWN_COUNT, "8", SQUID_BLOCK_SPAWN_MIN_Y_LEVEL, "16");
            putIn2(SQUID_BLOCK_SPAWN_MAX_Y_LEVEL, "64", ELECTRIC_POWER_MAX_LEVEL, "5");
            putIn2(YOUR_ITEM_MAX_COUNT, "64", YOUR_ITEM_2_MAX_VALUE, "64");
            put(ENABLE_REGISTER_LOG, "false");
            try {
                PROPERTIES.store(new BufferedOutputStream(
                        new FileOutputStream("config" + SEPARATOR + "squidcraft" + SEPARATOR + "config.properties")),
                        "save Config File.");
            } catch (IOException f) {
                f.printStackTrace();
            }
        } catch (IOException i) {
            i.printStackTrace();
        }
    }

    public static void put(String k, String v) {
        PROPERTIES.put(k, v);
    }

    public static void putIn2(String k1, String v1, String k2, String v2) {
        put(k1, v1);
        put(k2, v2);
    }

    public static String get(@MagicConstant(flagsFromClass = Configs.class) String cfg) {
        try {
            return PROPERTIES.getProperty(cfg);
        } catch (ArrayIndexOutOfBoundsException e) {
            return PROPERTIES.getProperty(HIDE_MAIN_SCREEN_BUTTON);
        }
    }

    public static int getInt(@MagicConstant(flagsFromClass = Configs.class) String cfg) {
        return Integer.parseInt(get(cfg));
    }

    public static boolean getBoolean(@MagicConstant(flagsFromClass = Configs.class) String cfg) {
        return Boolean.parseBoolean(get(cfg));
    }
}


<|start_filename|>backup/squid233/squidcraft/enchantment/ElectricPowerEnchantment.java<|end_filename|>
package io.github.squid233.squidcraft.enchantment;

import io.github.squid233.squidcraft.config.Configs;
import io.github.squid233.squidcraft.config.CreateConfig;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;

public class ElectricPowerEnchantment extends Enchantment {
    public ElectricPowerEnchantment(Rarity rarity, EnchantmentTarget type, EquipmentSlot[] slotTypes) {
        super(rarity, type, slotTypes);
    }

    @Override
    public int getMinPower(int level) {
        return 5;
    }

    @Override
    public int getMaxLevel() {
        return CreateConfig.getInt(Configs.ELECTRIC_POWER_MAX_LEVEL);
    }

    @Override
    public void onTargetDamaged(LivingEntity user, Entity target, int level) {
        if (target instanceof LivingEntity) {
            if (level > 5) {
                target.kill();
            } else {
                ((LivingEntity) target).addStatusEffect(new StatusEffectInstance(StatusEffects.INSTANT_DAMAGE, 20 * 2 * level, level - 1));
            }
        }
    }

    @Override
    public void onUserDamaged(LivingEntity user, Entity attacker, int level) {
        if (attacker instanceof LivingEntity) {
            ((LivingEntity) attacker).addStatusEffect(new StatusEffectInstance(StatusEffects.INSTANT_DAMAGE, 20 * 2 * level, level - 1));
        }
    }
}


<|start_filename|>src/main/resources/data/squidcraft/advancements/first_cooking.json<|end_filename|>
{
  "parent": "squidcraft:root",
  "display": {
    "icon": {
      "item": "squidcraft:cooked_shredded_squid"
    },
    "title": {
      "translate": "advancements.squidcraft.first_cooking.title"
    },
    "description": {
      "translate": "advancements.squidcraft.first_cooking.desc"
    }
  },
  "criteria": {
    "first_cooking": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "item": "squidcraft:cooked_shredded_squid"
          }
        ]
      }
    }
  },
  "requirements": [
    [
      "first_cooking"
    ]
  ],
  "rewards": {
    "recipes": [
      "squidcraft:a_pile_cooked_shredded_squid"
    ]
  }
}

<|start_filename|>backup/squid233/squidcraft/util/register/ItemRegister.java<|end_filename|>
package io.github.squid233.squidcraft.util.register;

import io.github.squid233.squidcraft.api.ItemRegistries;
import io.github.squid233.squidcraft.api.item.ItemFood;
import io.github.squid233.squidcraft.armor.ArmorMaterials;
import io.github.squid233.squidcraft.item.ModToolMaterial;
import io.github.squid233.squidcraft.item.YourItem;
import io.github.squid233.squidcraft.item.YourItem2;
import io.github.squid233.squidcraft.util.Identifier;
import io.github.squid233.squidcraft.util.ModEntities;
import io.github.squid233.squidcraft.util.Registry;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.AxeItem;
import net.minecraft.item.BucketItem;
import net.minecraft.item.HoeItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.PickaxeItem;
import net.minecraft.item.ShovelItem;
import net.minecraft.item.SpawnEggItem;
import net.minecraft.item.SwordItem;
import net.minecraft.sound.SoundCategory;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Hand;
import net.minecraft.util.TypedActionResult;
import net.minecraft.world.World;

import java.util.List;

import static io.github.squid233.squidcraft.SquidCraft.MODID;
import static io.github.squid233.squidcraft.item.ItemGroups.SQUID_CRAFT;
import static io.github.squid233.squidcraft.item.ItemGroups.SQUID_CRAFT_COMBAT_AND_TOOLS;
import static io.github.squid233.squidcraft.util.Registry.item;

public class ItemRegister {
    // Always register item, add item group, add models, add textures and add recipes.
    public static final Item SHREDDED_SQUID;
    public static final Item COOKED_SHREDDED_SQUID;
    public static final Item A_PILE_COOKED_SHREDDED_SQUID;
    public static final Item SQUID_COOKIE;
    public static final Item SQUID_HELMET;
    public static final Item SQUID_CHESTPLATE;
    public static final Item SQUID_LEGGINGS;
    public static final Item SQUID_BOOTS;
    public static final Item SQUID_AXE;
    public static final Item SQUID_HOE;
    public static final Item SQUID_PICKAXE;
    public static final Item SQUID_SHOVEL;
    public static final Item SQUID_SWORD;
    public static final Item COOKIE_CREEPER_SPAWN_EGG;
    public static final Item CUBE_SPAWN_EGG;
    public static final Item MILK_BUCKET;
    public static final Item MUSIC_RECORD;
    public static final io.github.squid233.squidcraft.api.item.Item
            YOUR_ITEM = new YourItem(),
            YOUR_ITEM_2 = new YourItem2();

    static {
        SHREDDED_SQUID = item("shredded_squid", new ItemFood.Meat(SQUID_CRAFT, 1, 0.4f));
        COOKED_SHREDDED_SQUID = item("cooked_shredded_squid", new ItemFood.Meat(SQUID_CRAFT, 2, 0.6f));
        A_PILE_COOKED_SHREDDED_SQUID = item("a_pile_cooked_shredded_squid", new ItemFood.Meat(SQUID_CRAFT, 18, 0.8f));
        SQUID_COOKIE = item("squid_cookie",
                new ItemFood.Meat.Big(SQUID_CRAFT, 162, 3.2f) {
                    @Override
                    public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context) {
                        super.appendTooltip(stack, world, tooltip, context);
                        tooltip.add(new TranslatableText("item.squidcraft.squid_cookie.tooltip"));
                    }
                });

        SQUID_HELMET = helmet(ArmorMaterials.SQUID, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS));
        SQUID_CHESTPLATE = chestplate(new ArmorItem(ArmorMaterials.SQUID, EquipmentSlot.CHEST, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)));
        SQUID_LEGGINGS = leggings(new ArmorItem(ArmorMaterials.SQUID, EquipmentSlot.LEGS, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)));
        SQUID_BOOTS = boots(new ArmorItem(ArmorMaterials.SQUID, EquipmentSlot.FEET, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)));

        SQUID_AXE = axe(new AxeItem(ModToolMaterial.SQUID, -0, -2.2f, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)) {});
        SQUID_HOE = hoe(new HoeItem(ModToolMaterial.SQUID, -4, -2.4f, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)) {});
        SQUID_PICKAXE = pickaxe(new PickaxeItem(ModToolMaterial.SQUID, -1, -1, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)) {});
        SQUID_SHOVEL = shovel(new ShovelItem(ModToolMaterial.SQUID, -2, -2, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)));
        SQUID_SWORD = sword(new SwordItem(ModToolMaterial.SQUID, 1, -0, new Item.Settings().group(SQUID_CRAFT_COMBAT_AND_TOOLS)));

        COOKIE_CREEPER_SPAWN_EGG = item("cookie_creeper_spawn_egg",
                new SpawnEggItem(ModEntities.COOKIE_CREEPER, 0x0DA70B, 0x73420E, new Item.Settings().group(SQUID_CRAFT)));
        CUBE_SPAWN_EGG = item("cube_spawn_egg",
                new SpawnEggItem(ModEntities.CUBE, 0xFFA7A4, 0x7BD4FF, new Item.Settings().group(SQUID_CRAFT)));

        MILK_BUCKET = item("milk_bucket",
                new BucketItem(FluidRegister.STILL_MILK, new Item.Settings().group(SQUID_CRAFT).recipeRemainder(Items.BUCKET).maxCount(1)));
        MUSIC_RECORD = item("music_record", new Item(new Item.Settings().group(SQUID_CRAFT)) {
            @Override
            public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand hand) {
                if (!world.isClient) {
                    world.playSound(user, user.getBlockPos(), SoundsRegister.MUSIC_EVENT, SoundCategory.RECORDS, 0.5f, 0.5f);
                }
                return TypedActionResult.success(user.getStackInHand(hand));
            }
        });
    }

    public ItemRegister() {
        registerAll(YOUR_ITEM, YOUR_ITEM_2);

        for (String nm : Registry.ITEMS.keySet()) {
            net.minecraft.util.registry.Registry.register(net.minecraft.util.registry.Registry.ITEM, new Identifier(nm), Registry.ITEMS.get(nm));
        }
    }

    private static Item register(String name, Item item) {
        return ItemRegistries.register(MODID, name, item);
    }

    private static Item helmet(ArmorMaterial material, Item.Settings settings) {
        return ItemRegistries.registerHelmet(MODID, "squid", new ArmorItem(material, EquipmentSlot.HEAD, settings));
    }

    private static Item chestplate(Item item) {
        return ItemRegistries.registerChestplate(MODID, "squid", item);
    }

    private static Item leggings(Item item) {
        return ItemRegistries.registerLeggings(MODID, "squid", item);
    }

    private static Item boots(Item item) {
        return ItemRegistries.registerBoots(MODID, "squid", item);
    }

    private static Item axe(Item item) {
        return ItemRegistries.registerAxe(MODID, "squid", item);
    }

    private static Item hoe(Item item) {
        return ItemRegistries.registerHoe(MODID, "squid", item);
    }

    private static Item pickaxe(Item item) {
        return ItemRegistries.registerPickaxe(MODID, "squid", item);
    }

    private static Item shovel(Item item) {
        return ItemRegistries.registerShovel(MODID, "squid", item);
    }

    private static Item sword(Item item) {
        return ItemRegistries.registerSword(MODID, "squid", item);
    }

    private void registerAll(io.github.squid233.squidcraft.api.item.Item... items) {
        ItemRegistries.registerAll(MODID, items);
    }
}


<|start_filename|>backup/squid233/squidcraft/util/ModBiomes.java<|end_filename|>
package io.github.squid233.squidcraft.util;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.mixin.BuiltinBiomesAccessor;
import io.github.squid233.squidcraft.util.register.SoundsRegister;
import io.github.squid233.squidcraft.world.biome.BiomeUtils;
import net.minecraft.sound.BiomeMoodSound;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder;

public class ModBiomes {
    public static final RegistryKey<Biome> SQUID_BIOME_KEY = register("squid_biome");
    public static final RegistryKey<Biome> CHAOS_SQUID_BIOME_KEY = register("chaos_squid_biome");
    public static final Biome SQUID_BIOME;
    public static final Biome CHAOS_SQUID_BIOME;

    static {
        SQUID_BIOME = register(SQUID_BIOME_KEY,
                BiomeUtils.createSquidBiome(SurfaceBuilder.DEFAULT, Biome.Precipitation.NONE, 0.8F, 0.4F, SoundsRegister.MUSIC_SOUND));
        CHAOS_SQUID_BIOME = register(CHAOS_SQUID_BIOME_KEY,
                BiomeUtils.createSquidBiome(SurfaceBuilder.SWAMP, Biome.Precipitation.RAIN, 0.6F, 0.6F, BiomeMoodSound.CAVE));
    }

    private static RegistryKey<Biome> register(String name) {
        return RegistryKey.of(Registry.BIOME_KEY, new Identifier(SquidCraft.MODID, name));
    }

    private static Biome register(RegistryKey<Biome> registryKey, Biome biome) {
        Registry.register(BuiltinRegistries.BIOME, registryKey.getValue(), biome);
        BuiltinBiomesAccessor.getRawIdMap().put(BuiltinRegistries.BIOME.getRawId(biome), registryKey);
        return biome;
    }
}

<|start_filename|>src/main/resources/assets/squidcraft/lang/en_us.json<|end_filename|>
{
  "advancements.squidcraft.root.title": "SquidCraft",
  "advancements.squidcraft.root.desc": "Get started, Cooking it!",
  "advancements.squidcraft.first_cooking.title": "First Cooking",
  "advancements.squidcraft.first_cooking.desc": "Now, we can make \"A Pile Cooked Shredded Squid\"!",
  "advancements.squidcraft.a_pile.title": "A Pile Cooked Shredded Squid",
  "advancements.squidcraft.a_pile.desc": "If you make a squid cookie, you can find more surprise!",
  "advancements.squidcraft.cookie.title": "Squid Cookie",
  "advancements.squidcraft.cookie.desc": "Oh, yum! You can make a block to eat or build!",
  "advancements.squidcraft.block.title": "Squid Block",
  "advancements.squidcraft.block.desc": "This block is very full!",

  "authors.squidcraft.info": "Authors:",

  "biome.squidcraft.chaos_squid_biome": "Chaos Squid Biome",
  "biome.squidcraft.squid_biome": "Squid Biome",

  "block.squidcraft.bigger_chest_block": "Bigger Chest",
  "block.squidcraft.compress_squid_block": "Compress Block of Squid",
  "block.squidcraft.eight_squid_block": "Eight Block of Squid",
  "block.squidcraft.four_squid_block": "Four Block of Squid",
  "block.squidcraft.higher_compress_squid_block": "Higher Compress Block of Squid",
  "block.squidcraft.higher_squid_block": "Higher Block of Squid",
  "block.squidcraft.low_compress_squid_block": "Low Compress Block of Squid",
  "block.squidcraft.low_squid_block": "Low Block of Squid",
  "block.squidcraft.medium_compress_squid_block": "Medium Compress Block of Squid",
  "block.squidcraft.medium_squid_block": "Medium Block of Squid",
  "block.squidcraft.one_squid_block": "One Block of Squid",
  "block.squidcraft.shredded_squid_crop": "Shredded Squid Crop",
  "block.squidcraft.soul_jack_o_lantern": "Soul Jack o'Lantern",
  "block.squidcraft.squid_block": "Block of Squid",
  "block.squidcraft.squid_side_block": "Block of Squid Side Slab",
  "block.squidcraft.super_compress_squid_block": "Super Compress Block of Squid",
  "block.squidcraft.super_squid_block": "Super Block of Squid",
  "block.squidcraft.two_squid_block": "Two Block of Squid",
  "block.squidcraft.ultimate_compress_squid_block": "Ultimate Compress Block of Squid",
  "block.squidcraft.ultimate_squid_block": "Ultimate Block of Squid",

  "button.reset.text": "Reset to default value",
  "button.squidcraft.text":"SquidCraft",

  "container.squidcraft.bigger_chest": "Bigger Chest",
  "container.squidcraft.bigger_chest_block": "Bigger Chest",

  "enchantment.squidcraft.electric_power": "Electric Power",
  "enchantment.squidcraft.fire_boom": "Fire Boom",
  "enchantment.squidcraft.frost": "Frost",
  "enchantment.squidcraft.insane": "Insane Enchantment",

  "entity.squidcraft.cookie_creeper": "Cookie Creeper",
  "entity.squidcraft.cube": "Cube",

  "fluid.squidcraft.flowing_milk": "Flowing Milk",
  "fluid.squidcraft.milk": "Milk",

  "item.food.alwaysEdible": "Always Edible",
  "item.food.hunger": "Hunger: %d",
  "item.food.isWolfFood": "Can feed the wolf: %s",
  "item.food.saturation": "Saturation: %f",
  "item.squidcraft.a_pile_cooked_shredded_squid": "A Pile Cooked Shredded Squid",
  "item.squidcraft.cooked_sausage": "Cooked Sausage",
  "item.squidcraft.cooked_shredded_squid": "Cooked Shredded Squid",
  "item.squidcraft.cookie_creeper_spawn_egg":"Cookie Creeper Spawn Egg",
  "item.squidcraft.cube_spawn_egg":"Cube Spawn Egg",
  "item.squidcraft.hot_dog": "Hot Dog",
  "item.squidcraft.milk_bucket": "Milk Bucket",
  "item.squidcraft.pineapple": "Pineapple",
  "item.squidcraft.sausage": "Sausage",
  "item.squidcraft.shredded_squid": "Shredded Squid",
  "item.squidcraft.squid_axe": "Squid Axe",
  "item.squidcraft.squid_boots": "Squid Boots",
  "item.squidcraft.squid_chestplate": "Squid Chestplate",
  "item.squidcraft.squid_cookie": "Squid Cookie",
  "item.squidcraft.squid_cookie.tooltip": "Craft a squid block!",
  "item.squidcraft.squid_helmet": "Squid Helmet",
  "item.squidcraft.squid_hoe": "Squid Hoe",
  "item.squidcraft.squid_leggings": "Squid Leggings",
  "item.squidcraft.squid_pickaxe": "Squid Pickaxe",
  "item.squidcraft.squid_shovel": "Squid Shovel",
  "item.squidcraft.squid_sword": "Squid Sword",
  "item.squidcraft.tomato": "Tomato",
  "item.squidcraft.your_item": "Your Item",
  "item.squidcraft.your_item_2": "Your Item 2",

  "itemGroup.squidcraft.sc_combat_and_tools": "SquidCraft Combat and Tools",
  "itemGroup.squidcraft.squid_craft": "SquidCraft",
  "itemGroup.squidcraft.yummyfood": "YummyFood",

  "key.squidcraft.useless_key": "Useless Key",

  "screen.config.squidcraft": "SquidCraft Config"
}

<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/PickaxeItem.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import net.minecraft.item.ToolMaterial;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class PickaxeItem extends net.minecraft.item.PickaxeItem {
    public PickaxeItem(ToolMaterial material, int attackDamage, float attackSpeed, Settings settings) {
        super(material, attackDamage, attackSpeed, settings);
    }
}


<|start_filename|>backup/squid233/squidcraft/world/Features.java<|end_filename|>
package io.github.squid233.squidcraft.world;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.world.feature.SquidSpiralFeature;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;

public class Features {
    public static final Feature<DefaultFeatureConfig> SQUID_SPIRAL = Registry.register(
            Registry.FEATURE,
            new Identifier(SquidCraft.MODID, "squid_spiral"),
            new SquidSpiralFeature(DefaultFeatureConfig.CODEC)
    );
}


<|start_filename|>backup/squid233/squidcraft/modmenu/SquidCraftModMenuApiImpl.java<|end_filename|>
package io.github.squid233.squidcraft.modmenu;

import io.github.prospector.modmenu.api.ConfigScreenFactory;
import io.github.prospector.modmenu.api.ModMenuApi;

public class SquidCraftModMenuApiImpl implements ModMenuApi {
    @Override
    public ConfigScreenFactory<?> getModConfigScreenFactory() {
        return SquidCraftConfigScreen::new;
    }
}


<|start_filename|>backup/squid233/squidcraft/mixin/DefaultBiomeFeaturesMixin.java<|end_filename|>
package io.github.squid233.squidcraft.mixin;

import io.github.squid233.squidcraft.world.feature.OreFeature;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
 * @author squid233
 */
@Mixin(DefaultBiomeFeatures.class)
public class DefaultBiomeFeaturesMixin {
    @Inject(method = "addDefaultOres(Lnet/minecraft/world/biome/GenerationSettings$Builder;)V", at = @At("TAIL"))
    private static void addDefaultOres(GenerationSettings.Builder builder, CallbackInfo ci) {
        builder.feature(GenerationStep.Feature.UNDERGROUND_ORES, OreFeature.SQUID_BLOCK_OVERWORLD);
    }
}


<|start_filename|>backup/squid233/squidcraft/world/feature/OreFeature.java<|end_filename|>
package io.github.squid233.squidcraft.world.feature;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.config.Configs;
import io.github.squid233.squidcraft.config.CreateConfig;
import io.github.squid233.squidcraft.util.register.BlockRegister;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;

public class OreFeature {
    public static ConfiguredFeature<?, ?> SQUID_BLOCK_OVERWORLD = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE,
            new Identifier(SquidCraft.MODID, "squid_block_overworld"), Feature.ORE
            .configure(new OreFeatureConfig(
                    OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
                    BlockRegister.SQUID_BLOCK.getDefaultState(),
                    // vein size
                    CreateConfig.getInt(Configs.SQUID_BLOCK_SPAWN_SIZE)
            ))
            .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(
                    // bottom offset
                    0,
                    // min y level
                    CreateConfig.getInt(Configs.SQUID_BLOCK_SPAWN_MIN_Y_LEVEL),
                    // max y level
                    CreateConfig.getInt(Configs.SQUID_BLOCK_SPAWN_MAX_Y_LEVEL)
            )))
            .spreadHorizontally()
            // number of veins per chunk
            .repeat(CreateConfig.getInt(Configs.SQUID_BLOCK_PER_CHUNK_SPAWN_COUNT)));
}


<|start_filename|>src/main/resources/assets/squidcraft/models/block/squid_side_block_texture.json<|end_filename|>
{
  "parent": "squidcraft:block/squid_side_block",
  "textures": {
    "bottom": "squidcraft:block/squid_block",
    "top": "squidcraft:block/squid_block",
    "side": "squidcraft:block/squid_block"
  }
}

<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/ArmorMaterialBuilder.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy;

import java.util.function.Supplier;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class ArmorMaterialBuilder {
    private static final int[] BASE_DURABILITY = {13, 15, 16, 11};
    private final String name;
    private int durability;
    private final int[] protectionAmounts = new int[4];
    private int enchantability;
    private SoundEvent equipSound;
    private Lazy<Ingredient> repairIngredient;
    private float toughness;
    private float knockbackResistance;

    public ArmorMaterialBuilder(String name) {
        this.name = name;
    }

    public ArmorMaterialBuilder durability(int durabilityMultiplier) {
        this.durability = durabilityMultiplier;
        return this;
    }

    public ArmorMaterialBuilder protectionAmounts(int head, int chest, int legs, int feet) {
        protectionAmounts[0] = feet;
        protectionAmounts[1] = legs;
        protectionAmounts[2] = chest;
        protectionAmounts[3] = head;
        return this;
    }

    public ArmorMaterialBuilder enchantability(int enchantability) {
        this.enchantability = enchantability;
        return this;
    }

    public ArmorMaterialBuilder equipSound(SoundEvent equipSound) {
        this.equipSound = equipSound;
        return this;
    }

    public ArmorMaterialBuilder repairIngredient(Supplier<Ingredient> repairIngredient) {
        this.repairIngredient = new Lazy<>(repairIngredient);
        return this;
    }

    public ArmorMaterialBuilder toughness(float toughness) {
        this.toughness = toughness;
        return this;
    }

    public ArmorMaterialBuilder knockbackResistance(float knockbackResistance) {
        this.knockbackResistance = knockbackResistance;
        return this;
    }

    public ArmorMaterial build() {
        if (name == null) {
            throw new IllegalStateException("Cannot build ArmorMaterial - name is null");
        }
        return new ArmorMaterial() {
            @Override
            public int getDurability(EquipmentSlot slot) {
                return BASE_DURABILITY[slot.getEntitySlotId()] * durability;
            }

            @Override
            public int getProtectionAmount(EquipmentSlot slot) {
                return protectionAmounts[slot.getEntitySlotId()];
            }

            @Override
            public int getEnchantability() {
                return enchantability;
            }

            @Override
            public SoundEvent getEquipSound() {
                if (equipSound == null) {
                    return SoundEvents.ITEM_ARMOR_EQUIP_GENERIC;
                }
                return equipSound;
            }

            @Override
            public Ingredient getRepairIngredient() {
                if (repairIngredient == null) {
                    return Ingredient.EMPTY;
                }
                return repairIngredient.get();
            }

            @Override
            @Environment(EnvType.CLIENT)
            public String getName() {
                return name;
            }

            @Override
            public float getToughness() {
                return toughness;
            }

            @Override
            public float getKnockbackResistance() {
                return knockbackResistance;
            }
        };
    }
}


<|start_filename|>backup/squid233/squidcraft/client/SquidCraftClient.java<|end_filename|>
package io.github.squid233.squidcraft.client;

import io.github.squid233.squidcraft.client.gui.BiggerChestScreen;
import io.github.squid233.squidcraft.entity.CookieCreeperRenderer;
import io.github.squid233.squidcraft.entity.CubeEntityRenderer;
import io.github.squid233.squidcraft.entity.LavaSquidRenderer;
import io.github.squid233.squidcraft.util.ModEntities;
import io.github.squid233.squidcraft.util.register.BlockRegister;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import net.minecraft.client.render.RenderLayer;

import static io.github.squid233.squidcraft.util.KeyBindings.KEY_BINDING_0;

@SuppressWarnings("unused")
@Environment(EnvType.CLIENT)
public final class SquidCraftClient implements ClientModInitializer {
    @Override
    public void onInitializeClient() {
        KeyBindingHelper.registerKeyBinding(KEY_BINDING_0);
        ClientTickEvents.END_CLIENT_TICK.register(e -> {
            if (KEY_BINDING_0.isPressed()) {
                System.out.println("was pressed!");
            }
        });

        /*ScreenProviderRegistry.INSTANCE.<BiggerChestScreenHandler>registerFactory(BlockRegister.BIGGER_CHEST, (container) -> {
            assert MinecraftClient.getInstance().player != null;
            return new BiggerChestScreen(container, MinecraftClient.getInstance().player.inventory, new TranslatableText(BlockRegister.BIGGER_CHEST_TRANSLATION_KEY));
        });*/

        ScreenRegistry.register(null, BiggerChestScreen::new);

        EntityRendererRegistry.INSTANCE.register(ModEntities.COOKIE_CREEPER, (entityRenderDispatcher, context) -> new CookieCreeperRenderer(entityRenderDispatcher));

        EntityRendererRegistry.INSTANCE.register(ModEntities.LAVA_SQUID, ((entityRenderDispatcher, context) -> new LavaSquidRenderer(entityRenderDispatcher)));

        /*
         * Registers our Cube Entity's renderer, which provides a model and texture for the entity.
         *
         * Entity Renderers can also manipulate the model before it renders based on entity context (EndermanEntityRenderer#render).
         */
        EntityRendererRegistry.INSTANCE.register(ModEntities.CUBE, (dispatcher, context) -> new CubeEntityRenderer(dispatcher));

        BlockRenderLayerMap.INSTANCE.putBlock(BlockRegister.SHREDDED_SQUID_CROP, RenderLayer.getCutout());
    }
}


<|start_filename|>backup/squid233/squidcraft/util/Registry.java<|end_filename|>
package io.github.squid233.squidcraft.util;

import net.minecraft.item.Item;

import java.util.HashMap;
import java.util.Map;

/**
 * @author squid233
 */
public class Registry {
    public static final Map<String, Item> ITEMS = new HashMap<>();

    public static Item item(String name, Item item) {
        ITEMS.put(name, item);
        return item;
    }
}


<|start_filename|>backup/squid233/squidcraft/util/register/SoundsRegister.java<|end_filename|>
package io.github.squid233.squidcraft.util.register;

import io.github.squid233.squidcraft.SquidCraft;
import net.minecraft.sound.BiomeMoodSound;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class SoundsRegister {

    public static final Identifier MUSIC_ID = new Identifier(SquidCraft.MODID, "music");
    public static SoundEvent MUSIC_EVENT = Registry.register(Registry.SOUND_EVENT, MUSIC_ID, new SoundEvent(MUSIC_ID));
    public static final BiomeMoodSound MUSIC_SOUND = new BiomeMoodSound(MUSIC_EVENT, 24000, 1, 0);

}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/block/FoodBlock.java<|end_filename|>
package io.github.squid233.squidcraft.block;

import io.github.squid233.squidcraft.item.FoodItem;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.item.Item;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class FoodBlock extends Block {
    private Item cachedItem;
    private final Item.Settings settings;
    private int hunger;
    private float saturation;
    private boolean isMeat;
    private boolean isSnack;
    private boolean isAlwaysEdible;
    private StatusEffectInstance statusEffect;
    private float chance;

    public FoodBlock(Settings settings, Item.Settings itemSettings, int hunger, float saturation) {
        super(settings);
        this.settings = itemSettings;
        this.hunger = hunger;
        this.saturation = saturation;
    }

    public FoodBlock(float hardness, float resistance, Item.Settings itemSettings, int hunger, float saturation) {
        this(FabricBlockSettings.of(Material.SOIL).strength(hardness, resistance), itemSettings, hunger, saturation);
    }

    public FoodBlock(float hardness, Item.Settings itemSettings, int hunger, float saturation) {
        this(hardness, 0, itemSettings, hunger, saturation);
    }

    public FoodBlock setHunger(int hunger) {
        this.hunger = hunger;
        return this;
    }

    public FoodBlock setSaturation(float saturation) {
        this.saturation = saturation;
        return this;
    }

    public FoodBlock setMeat(boolean meat) {
        isMeat = meat;
        return this;
    }

    public FoodBlock setSnack(boolean snack) {
        isSnack = snack;
        return this;
    }

    public FoodBlock setAlwaysEdible(boolean alwaysEdible) {
        isAlwaysEdible = alwaysEdible;
        return this;
    }

    public FoodBlock setStatusEffect(StatusEffectInstance statusEffect, float chance) {
        this.statusEffect = statusEffect;
        this.chance = chance;
        return this;
    }

    public Item.Settings getItemSettings() {
        return settings;
    }

    @Override
    public Item asItem() {
        if (cachedItem == null) {
            FoodItem fi = new FoodItem(settings).hunger(hunger).saturation(saturation);
            if (isMeat) {
                fi.meat();
            }
            if (isSnack) {
                fi.snack();
            }
            if (isAlwaysEdible) {
                fi.alwaysEdible();
            }
            if (statusEffect != null) {
                fi.statusEffect(statusEffect, chance);
            }
            cachedItem = fi.build();
        }
        return cachedItem;
    }
}


<|start_filename|>src/main/resources/fabric.mod.json<|end_filename|>
{
  "schemaVersion": 1,
  "id": "squidcraft",
  "version": "${version}",

  "name": "SquidCraft",
  "description": "The mod is add more food of squid!",
  "authors": [
    "squid233",
    "baka4n"
  ],
  "contact": {
    "homepage": "https://www.curseforge.com/minecraft/mc-mods/squidcraft",
    "issues": "https://github.com/squid233/SquidCraft/issues",
    "sources": "https://github.com/squid233/SquidCraft"
  },

  "license": "MIT",
  "icon": "assets/squidcraft/icon.png",

  "environment": "*",
  "entrypoints": {
    "main": [
      "io.github.squid233.squidcraft.SquidCraft",
      "io.github.squid233.yummyfood.YummyFood"
    ],
    "client": [
      "io.github.squid233.squidcraft.client.SquidCraftClient",
      "io.github.squid233.squidcraft.client.SquidCraftFluidRenderClient"
    ],
    "modmenu": [
      "io.github.squid233.squidcraft.modmenu.SquidCraftModMenuApiImpl"
    ]
  },
  "mixins": [
    "squidcraft.mixins.json"
  ],

  "depends": {
    "fabricloader": ">=0.9.0",
    "fabric": ">=0.16.0",
    "minecraft": "1.16.x"
  },
  "suggests": {
    "flamingo": "*"
  }
}


<|start_filename|>src/main/resources/assets/squidcraft/lang/zh_cn.json<|end_filename|>
{
  "advancements.squidcraft.root.title": "鱿鱼工艺",
  "advancements.squidcraft.root.desc": "要想开始，烤它！",
  "advancements.squidcraft.first_cooking.title": "第一次烘烤",
  "advancements.squidcraft.first_cooking.desc": "现在，我们可以制作”一堆熟鱿鱼丝”了！",
  "advancements.squidcraft.a_pile.title": "一堆熟鱿鱼丝",
  "advancements.squidcraft.a_pile.desc": "如果你制作一块鱿鱼饼，你会发现更多惊喜的！",
  "advancements.squidcraft.cookie.title": "鱿鱼饼",
  "advancements.squidcraft.cookie.desc": "真香！你可以制作一个方块，用于吃甚至是建筑！",
  "advancements.squidcraft.block.title": "鱿鱼块",
  "advancements.squidcraft.block.desc": "这个方块非常的full！",

  "authors.squidcraft.info": "作者名单：",

  "biome.squidcraft.chaos_squid_biome": "混乱鱿鱼群系",
  "biome.squidcraft.squid_biome": "鱿鱼群系",

  "block.squidcraft.bigger_chest_block": "大箱子",
  "block.squidcraft.compress_squid_block": "压缩鱿鱼块",
  "block.squidcraft.eight_squid_block": "八个鱿鱼块",
  "block.squidcraft.four_squid_block": "四个鱿鱼块",
  "block.squidcraft.higher_compress_squid_block": "高级压缩鱿鱼块",
  "block.squidcraft.higher_squid_block": "高级鱿鱼块",
  "block.squidcraft.low_compress_squid_block": "低级压缩鱿鱼块",
  "block.squidcraft.low_squid_block": "低级鱿鱼块",
  "block.squidcraft.medium_compress_squid_block": "中级压缩鱿鱼块",
  "block.squidcraft.medium_squid_block": "中级鱿鱼块",
  "block.squidcraft.one_squid_block": "一个鱿鱼块",
  "block.squidcraft.shredded_squid_crop": "鱿鱼丝作物",
  "block.squidcraft.soul_jack_o_lantern": "灵魂南瓜灯",
  "block.squidcraft.squid_block": "鱿鱼块",
  "block.squidcraft.squid_side_block": "边侧鱿鱼块",
  "block.squidcraft.super_compress_squid_block": "超级压缩鱿鱼块",
  "block.squidcraft.super_squid_block": "超级鱿鱼块",
  "block.squidcraft.two_squid_block": "两个鱿鱼块",
  "block.squidcraft.ultimate_compress_squid_block": "终极压缩鱿鱼块",
  "block.squidcraft.ultimate_squid_block": "终极鱿鱼块",

  "button.reset.text": "重置至默认值",
  "button.squidcraft.text": "鱿鱼工艺",

  "container.squidcraft.bigger_chest": "大箱子",
  "container.squidcraft.bigger_chest_block": "大箱子",

  "enchantment.squidcraft.electric_power": "电力能源",
  "enchantment.squidcraft.fire_boom": "火焰爆炸",
  "enchantment.squidcraft.frost": "霜冻",
  "enchantment.squidcraft.insane": "疯狂附魔",

  "entity.squidcraft.cookie_creeper": "曲奇苦力怕",
  "entity.squidcraft.cube": "立方体",

  "fluid.squidcraft.flowing_milk": "流动的牛奶",
  "fluid.squidcraft.milk": "牛奶",

  "item.food.alwaysEdible": "总能吃",
  "item.food.hunger": "饥饿值：%d",
  "item.food.isWolfFood": "能喂狼吗：%s",
  "item.food.saturation": "饱和度：%f",
  "item.squidcraft.a_pile_cooked_shredded_squid": "一堆熟鱿鱼丝",
  "item.squidcraft.cooked_sausage": "熟香肠",
  "item.squidcraft.cooked_shredded_squid": "熟鱿鱼丝",
  "item.squidcraft.cookie_creeper_spawn_egg":"曲奇苦力怕刷怪蛋",
  "item.squidcraft.cube_spawn_egg":"立方体刷怪蛋",
  "item.squidcraft.hot_dog": "热狗",
  "item.squidcraft.milk_bucket": "牛奶桶",
  "item.squidcraft.pineapple": "菠萝",
  "item.squidcraft.sausage": "香肠",
  "item.squidcraft.shredded_squid": "鱿鱼丝",
  "item.squidcraft.squid_axe": "鱿鱼斧",
  "item.squidcraft.squid_boots": "鱿鱼靴子",
  "item.squidcraft.squid_chestplate": "鱿鱼胸甲",
  "item.squidcraft.squid_cookie": "鱿鱼饼",
  "item.squidcraft.squid_cookie.tooltip": "合成一个鱿鱼块！",
  "item.squidcraft.squid_helmet": "鱿鱼头盔",
  "item.squidcraft.squid_hoe": "鱿鱼锄",
  "item.squidcraft.squid_leggings": "鱿鱼护腿",
  "item.squidcraft.squid_pickaxe": "鱿鱼镐",
  "item.squidcraft.squid_shovel": "鱿鱼铲",
  "item.squidcraft.squid_sword": "鱿鱼剑",
  "item.squidcraft.tomato": "番茄",
  "item.squidcraft.your_item": "你的物品",
  "item.squidcraft.your_item_2": "你的物品2",

  "itemGroup.squidcraft.sc_combat_and_tools": "鱿鱼工艺 战斗用品与工具",
  "itemGroup.squidcraft.squid_craft": "鱿鱼工艺",
  "itemGroup.squidcraft.yummyfood": "美味的食物",

  "key.squidcraft.useless_key": "没用的按键",

  "screen.config.squidcraft": "鱿鱼工艺配置"
}

<|start_filename|>backup/squid233/squidcraft/client/gui/BiggerChestScreenHandler.java<|end_filename|>
package io.github.squid233.squidcraft.client.gui;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.util.register.BlockRegister;
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.math.BlockPos;
import org.jetbrains.annotations.Nullable;

import java.util.Objects;

public class BiggerChestScreenHandler extends ScreenHandler implements ExtendedScreenHandlerFactory {
    private final Inventory inventory; // Chest inventory
    private static final int INVENTORY_SIZE = 54; // 6 rows * 9 cols

    public BiggerChestScreenHandler(int syncId, PlayerInventory playerInventory, Inventory inventory) {
        super(BlockRegister.BIGGER_CHEST_SCREEN_HANDLER_TYPE, syncId); // Since we didn't create a ContainerType, we will place null here.
        this.inventory = inventory;
        checkSize(inventory, INVENTORY_SIZE);
        inventory.onOpen(playerInventory.player);

        // Creating Slots for GUI. A Slot is essentially a correspoding from inventory itemstacks to the GUI position.
        int i;
        int j;

        // Chest Inventory
        for (i = 0; i < 6; i++) {
            for (j = 0; j < 9; j++) {
                this.addSlot(new Slot(inventory, i * 9 + j, 8 + j * 18, 18 + i * 18));
            }
        }


        // Player Inventory (27 storage + 9 hotbar)
        for (i = 0; i < 3; i++) {
            for (j = 0; j < 9; j++) {
                this.addSlot(new Slot(playerInventory, i * 9 + j + 9, 8 + j * 18, 18 + i * 18 + 103 + 18));
            }
        }


        for (j = 0; j < 9; j++) {
            this.addSlot(new Slot(playerInventory, j, 8 + j * 18, 18 + 161 + 18));
        }
    }

    public BiggerChestScreenHandler(int syncId, PlayerInventory playerInventory) {
        this(syncId, playerInventory, BlockRegister.BIGGER_CHEST_BLOCK_ENTITY);
    }

    @Override
    public boolean canUse(PlayerEntity player) {
        return this.inventory.canPlayerUse(player);
    }

    // Shift + Player Inv Slot
    @Override
    public ItemStack transferSlot(PlayerEntity player, int invSlot) {
        ItemStack newStack = ItemStack.EMPTY;
        Slot slot = this.slots.get(invSlot);
        if (slot != null && slot.hasStack()) {
            ItemStack originalStack = slot.getStack();
            newStack = originalStack.copy();
            if (invSlot < this.inventory.size()) {
                if (!this.insertItem(originalStack, this.inventory.size(), this.slots.size(), true)) {
                    return ItemStack.EMPTY;
                }
            } else if (!this.insertItem(originalStack, 0, this.inventory.size(), false)) {
                return ItemStack.EMPTY;
            }

            if (originalStack.isEmpty()) {
                slot.setStack(ItemStack.EMPTY);
            } else {
                slot.markDirty();
            }
        }

        return newStack;
    }

    @Override
    public void writeScreenOpeningData(ServerPlayerEntity player, PacketByteBuf buf) {
        final BlockPos pos = buf.readBlockPos();
        Objects.requireNonNull(player.world.getBlockState(pos).createScreenHandlerFactory(player.world, pos)).createMenu(syncId, player.inventory, player);
    }

    @Override
    public Text getDisplayName() {
        return new TranslatableText("container" + SquidCraft.MODID + "bigger_chest");
    }

    @Nullable
    @Override
    public ScreenHandler createMenu(int syncId, PlayerInventory inv, PlayerEntity player) {
        return this;
    }
}


<|start_filename|>backup/squid233/squidcraft/api/item/Item.java<|end_filename|>
package io.github.squid233.squidcraft.api.item;

import io.github.squid233.squidcraft.api.ItemRegistries;

/**
 * <h1>The item class</h1>
 * <p>The item class need with
 * {@linkplain ItemRegistries#registerAll(String, Item...)
 * registerAll(String modid, Item... items)} use.</p>
 * <h2>How to use</h2>
 * <ol>
 *     <li>The 1st method:</li>
 *     <p>
 *         <code>import io.github.squid233.squidcraft.api.item.Item;
 *         <br /><br />
 *         public class ExampleItem extends Item {<br>
 *         &nbsp;&nbsp;&nbsp;&nbsp;public ExampleItem(Settings settings) {<br>
 *         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;super(settings);<br>
 *         &nbsp;&nbsp;&nbsp;&nbsp;}<br>
 *         <span></span>@Override<br>
 *                public String getRegistryName() {<br>
 *         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "example";<br>
 *         &nbsp;&nbsp;&nbsp;&nbsp;}<br>
 *         }
 *         </code>
 *     </p>
 *     <li>The 2nd method:</li>
 *     <p>
 *         <code>public static final String {@link Item} EXAMPLE_ITEM = new {@link Item}(new {@linkplain net.minecraft.item.Item.Settings Item.Settings()}){<span></span>@Override public String getRegistryName(){return "example";}}</code>
 *     </p>
 * </ol>
 */
public abstract class Item extends net.minecraft.item.Item {

    public Item(Settings settings) {
        super(settings);
    }

    /**
     * The registers will use the registry name.
     * @return a string.
     */
    public abstract String getRegistryName();

}


<|start_filename|>backup/squid233/squidcraft/util/register/EnchantmentRegister.java<|end_filename|>
package io.github.squid233.squidcraft.util.register;

import io.github.squid233.squidcraft.enchantment.ElectricPowerEnchantment;
import io.github.squid233.squidcraft.enchantment.FireBoomEnchantment;
import io.github.squid233.squidcraft.enchantment.FrostEnchantment;
import io.github.squid233.squidcraft.enchantment.InsaneEnchantment;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import static io.github.squid233.squidcraft.SquidCraft.MODID;
import static io.github.squid233.squidcraft.util.ModEnchantments.*;

public class EnchantmentRegister {
    public EnchantmentRegister() {
        FROST = Registry.register(
                Registry.ENCHANTMENT,
                new Identifier(MODID, "frost"),
                new FrostEnchantment(
                        Enchantment.Rarity.RARE,
                        EnchantmentTarget.WEAPON,
                        new EquipmentSlot[] {
                                EquipmentSlot.MAINHAND
                        }
                )
        );
        FIRE_BOOM = Registry.register(
                Registry.ENCHANTMENT,
                new Identifier(MODID, "fire_boom"),
                new FireBoomEnchantment(
                        Enchantment.Rarity.RARE,
                        EnchantmentTarget.WEAPON,
                        new EquipmentSlot[] {
                                EquipmentSlot.MAINHAND
                        }
                )
        );
        INSANE = Registry.register(
                Registry.ENCHANTMENT,
                new Identifier(MODID, "insane"),
                new InsaneEnchantment(
                        Enchantment.Rarity.VERY_RARE,
                        EnchantmentTarget.ARMOR,
                        new EquipmentSlot[] {
                                EquipmentSlot.HEAD,
                                EquipmentSlot.CHEST,
                                EquipmentSlot.LEGS,
                                EquipmentSlot.FEET
                        }
                )
        );
        ELECTRIC_POWER = Registry.register(
                Registry.ENCHANTMENT,
                new Identifier(MODID, "electric_power"),
                new ElectricPowerEnchantment(
                        Enchantment.Rarity.RARE,
                        EnchantmentTarget.WEAPON,
                        new EquipmentSlot[] {
                                EquipmentSlot.MAINHAND,
                                EquipmentSlot.OFFHAND
                        }
                )
        );
    }
}


<|start_filename|>backup/squid233/squidcraft/entity/LavaSquidEntity.java<|end_filename|>
package io.github.squid233.squidcraft.entity;

import net.minecraft.entity.EntityType;
import net.minecraft.entity.passive.SquidEntity;
import net.minecraft.world.World;

@SuppressWarnings("EntityConstructor")
public class LavaSquidEntity extends SquidEntity {

    public LavaSquidEntity(EntityType<? extends SquidEntity> entityType, World world) {
        super(entityType, world);
    }

}


<|start_filename|>backup/squid233/squidcraft/util/handle/LootTablesHandle.java<|end_filename|>
package io.github.squid233.squidcraft.util.handle;

import io.github.squid233.squidcraft.util.register.ItemRegister;
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
import net.minecraft.loot.ConstantLootTableRange;
import net.minecraft.loot.LootPool;
import net.minecraft.loot.entry.ItemEntry;
import net.minecraft.util.Identifier;

public class LootTablesHandle {
    private static final Identifier SQUID_LOOT_TABLE_ID = new Identifier("minecraft", "entities/squid");
    public LootTablesHandle() {
        LootTableLoadingCallback.EVENT.register((resourceManager, manager, id, supplier, setter) -> {
            if (SQUID_LOOT_TABLE_ID.equals(id)) {
                LootPool poolBuilder = FabricLootPoolBuilder.builder()
                        .rolls(ConstantLootTableRange.create(8))
                        .withEntry(ItemEntry.builder(ItemRegister.SHREDDED_SQUID).build())
                        .build();
                supplier.withPool(poolBuilder);
            }
        });

    }
}


<|start_filename|>backup/squid233/squidcraft/util/KeyBindings.java<|end_filename|>
package io.github.squid233.squidcraft.util;

import io.github.squid233.squidcraft.SquidCraft;
import net.minecraft.client.options.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;

public class KeyBindings {
    public static final KeyBinding KEY_BINDING_0 = new KeyBinding(
            "key." + SquidCraft.MODID + ".useless_key",
    InputUtil.Type.KEYSYM,
    GLFW.GLFW_KEY_CAPS_LOCK,
            "SquidCraft"
            );

}


<|start_filename|>backup/squid233/squidcraft/entity/CookieCreeperEntity.java<|end_filename|>
package io.github.squid233.squidcraft.entity;

import net.minecraft.entity.EntityType;
import net.minecraft.entity.mob.CreeperEntity;
import net.minecraft.world.World;

@SuppressWarnings("EntityConstructor")
public class CookieCreeperEntity extends CreeperEntity {
    public CookieCreeperEntity(EntityType<? extends CreeperEntity> entityType, World world) {
        super(entityType, world);
    }
}


<|start_filename|>backup/squid233/squidcraft/enchantment/InsaneEnchantment.java<|end_filename|>
package io.github.squid233.squidcraft.enchantment;

import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;

import static io.github.squid233.squidcraft.enchantment.StatusEffectInstances.*;

public class InsaneEnchantment extends Enchantment {
    public InsaneEnchantment(Rarity rarity, EnchantmentTarget type, EquipmentSlot[] slotTypes) {
        super(rarity, type, slotTypes);
    }

    @Override
    public int getMinPower(int level) {
        return 29;
    }

    @Override
    public void onUserDamaged(LivingEntity user, Entity attacker, int level) {
        user.addStatusEffect(ABSORPTION_INSTANCE);
        user.addStatusEffect(BAD_OMEN_INSTANCE);
        user.addStatusEffect(BLINDNESS_INSTANCE);
        user.addStatusEffect(CONDUIT_POWER_INSTANCE);
        user.addStatusEffect(DOLPHINS_GRACE_INSTANCE);
        user.addStatusEffect(FIRE_RESISTANCE_INSTANCE);
        user.addStatusEffect(GLOWING_INSTANCE);
        user.addStatusEffect(HASTE_INSTANCE);
        user.addStatusEffect(HEALTH_BOOST_INSTANCE);
        user.addStatusEffect(HERO_OF_THE_VILLAGE_INSTANCE);
        user.addStatusEffect(HUNGER_INSTANCE);
        user.addStatusEffect(INSTANT_DAMAGE_INSTANCE);
        user.addStatusEffect(INSTANT_HEALTH_INSTANCE);
        user.addStatusEffect(INVISIBILITY_INSTANCE);
        user.addStatusEffect(JUMP_BOOST_INSTANCE);
        user.addStatusEffect(LEVITATION_INSTANCE);
        user.addStatusEffect(LUCK_INSTANCE);
        user.addStatusEffect(MINING_FATIGUE_INSTANCE);
        user.addStatusEffect(NAUSEA_INSTANCE);
        user.addStatusEffect(NIGHT_VISION_INSTANCE);
        user.addStatusEffect(POISON_INSTANCE);
        user.addStatusEffect(REGENERATION_INSTANCE);
        user.addStatusEffect(RESISTANCE_INSTANCE);
        user.addStatusEffect(SATURATION_INSTANCE);
        user.addStatusEffect(SLOW_FALLING_INSTANCE);
        user.addStatusEffect(SLOWNESS_INSTANCE);
        user.addStatusEffect(SPEED_INSTANCE);
        user.addStatusEffect(STRENGTH_INSTANCE);
        user.addStatusEffect(UNLUCK_INSTANCE);
        user.addStatusEffect(WATER_BREATHING_INSTANCE);
        user.addStatusEffect(WEAKNESS_INSTANCE);
        user.addStatusEffect(WITHER_INSTANCE);
    }
}


<|start_filename|>backup/squid233/squidcraft/client/gui/BiggerChestScreen.java<|end_filename|>
package io.github.squid233.squidcraft.client.gui;

import com.mojang.blaze3d.systems.RenderSystem;
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

public class BiggerChestScreen extends HandledScreen<BiggerChestScreenHandler> implements ScreenRegistry.Factory<BiggerChestScreenHandler, BiggerChestScreen> {

    // a path to gui texture, you may replace it with new Identifier(YourMod.MOD_ID, "textures/gui/container/your_container.png");
    private static final Identifier TEXTURE = new Identifier("textures/gui/container/generic_54.png");

    public BiggerChestScreen(BiggerChestScreenHandler screenHandler, PlayerInventory playerInventory, Text title) {
        super(screenHandler, playerInventory, title);
        this.backgroundHeight = 114 + 6 * 18;
    }

    @Override
    protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) {
        this.textRenderer.draw(matrices, this.title.getString(), 8.0F, 6.0F, 4210752);
        this.textRenderer.draw(matrices, this.playerInventory.getDisplayName().getString(), 8.0F, (float) (this.backgroundHeight - 96 + 2), 4210752);
    }

    @Override
    @SuppressWarnings("deprecation")
    protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
        RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
        assert this.client != null;
        this.client.getTextureManager().bindTexture(TEXTURE);
        int i = (this.width - this.backgroundWidth) / 2;
        int j = (this.height - this.backgroundHeight) / 2;
        drawTexture(matrices, i, j, 0, 0, this.backgroundWidth,6 * 18 + 17);
        drawTexture(matrices, i, j + 6 * 18 + 17, 0, 126, this.backgroundWidth, 96);
    }

    @Override
    public BiggerChestScreen create(BiggerChestScreenHandler handler, PlayerInventory inventory, Text title) {
        return this;
    }
}


<|start_filename|>backup/squid233/yummyfood/item/ItemGroup.java<|end_filename|>
package io.github.squid233.yummyfood.item;

import io.github.squid233.squidcraft.SquidCraft;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;

import static io.github.squid233.yummyfood.YummyFood.*;

public class ItemGroup {
    public static final net.minecraft.item.ItemGroup YUMMYFOOD = FabricItemGroupBuilder.create(
            new Identifier(SquidCraft.MODID, "yummyfood"))
            .icon(() -> new ItemStack(HOT_DOG))
            .appendItems(stacks -> {
                stacks.add(new ItemStack(PINEAPPLE));
                stacks.add(new ItemStack(TOMATO));
                stacks.add(new ItemStack(SAUSAGE));
                stacks.add(new ItemStack(COOKED_SAUSAGE));
                stacks.add(new ItemStack(HOT_DOG));
            })
            .build();
}


<|start_filename|>backup/squid233/squidcraft/api/package-info.java<|end_filename|>
/**
 * <h1>API Pack</h1>
 * <p>This is the API Pack. You can import this mod to used the classes.
 * The classes are very good.</p>
 * <dl>
 *     <li>{@linkplain io.github.squid233.squidcraft.api.item.Item Item}</li>
 *     <li>{@linkplain io.github.squid233.api.block.Block Block}</li>
 * </dl>
 * @author squid233
 */
package io.github.squid233.squidcraft.api;

<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/ArmorMaterials.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import net.minecraft.item.ArmorMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvents;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class ArmorMaterials {
    public static final ArmorMaterial SQUID = new ArmorMaterialBuilder("squid")
            .durability(5)
            .protectionAmounts(5, 8, 7, 4)
            .enchantability(15)
            .equipSound(SoundEvents.ITEM_ARMOR_EQUIP_LEATHER)
            .toughness(0.5f)
            .knockbackResistance(0)
            .repairIngredient(() -> Ingredient.ofItems(Items.SQUID_COOKIE))
            .build();
}


<|start_filename|>backup/squid233/squidcraft/enchantment/FireBoomEnchantment.java<|end_filename|>
package io.github.squid233.squidcraft.enchantment;

import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentTarget;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.LivingEntity;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;

public class FireBoomEnchantment extends Enchantment {
    public FireBoomEnchantment(Rarity rarity, EnchantmentTarget type, EquipmentSlot[] slotTypes) {
        super(rarity, type, slotTypes);
    }

    @Override
    public int getMinPower(int level) {
        return 2;
    }

    @Override
    public int getMaxLevel() {
        return 5;
    }

    @Override
    public void onTargetDamaged(LivingEntity user, Entity target, int level) {
        if(target instanceof LivingEntity) {
            World world = user.world;
            boolean bl = world.getGameRules().getBoolean(GameRules.DO_MOB_GRIEFING);
            world.createExplosion(target, target.prevX, target.prevY, target.prevZ, level, bl, bl ? Explosion.DestructionType.DESTROY : Explosion.DestructionType.NONE);
            world.spawnEntity(target);
        }
        super.onTargetDamaged(user, target, level);
    }
}


<|start_filename|>backup/squid233/squidcraft/item/ItemGroups.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import io.github.squid233.squidcraft.util.Identifier;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;

import static io.github.squid233.squidcraft.util.register.BlockRegister.*;
import static io.github.squid233.squidcraft.util.register.ItemRegister.*;

public class ItemGroups {
    /**
     * Let it cannot constructing
     */
    private ItemGroups() {

    }

    public static final ItemGroup SQUID_CRAFT = FabricItemGroupBuilder.create(
            new Identifier("squid_craft"))
            .icon(() -> new ItemStack(SQUID_BLOCK))
            .appendItems(stacks -> {
                stacks.add(new ItemStack(SHREDDED_SQUID));
                stacks.add(new ItemStack(COOKED_SHREDDED_SQUID));
                stacks.add(new ItemStack(A_PILE_COOKED_SHREDDED_SQUID));
                stacks.add(new ItemStack(SQUID_COOKIE));

                stacks.add(new ItemStack(SQUID_BLOCK));
                stacks.add(new ItemStack(COMPRESS_SQUID_BLOCK));
                stacks.add(new ItemStack(LOW_SQUID_BLOCK));
                stacks.add(new ItemStack(LOW_COMPRESS_SQUID_BLOCK));
                stacks.add(new ItemStack(MEDIUM_SQUID_BLOCK));
                stacks.add(new ItemStack(MEDIUM_COMPRESS_SQUID_BLOCK));
                stacks.add(new ItemStack(HIGHER_SQUID_BLOCK));
                stacks.add(new ItemStack(HIGHER_COMPRESS_SQUID_BLOCK));
                stacks.add(new ItemStack(SUPER_SQUID_BLOCK));
                stacks.add(new ItemStack(SUPER_COMPRESS_SQUID_BLOCK));
                stacks.add(new ItemStack(ULTIMATE_SQUID_BLOCK));
                stacks.add(new ItemStack(ULTIMATE_COMPRESS_SQUID_BLOCK));

                stacks.add(new ItemStack(ONE_SQUID_BLOCK));
                stacks.add(new ItemStack(TWO_SQUID_BLOCK));
                stacks.add(new ItemStack(FOUR_SQUID_BLOCK));
                stacks.add(new ItemStack(EIGHT_SQUID_BLOCK));

                stacks.add(new ItemStack(SQUID_SIDE_BLOCK));

                stacks.add(new ItemStack(BIGGER_CHEST_BLOCK));

                stacks.add(new ItemStack(COOKIE_CREEPER_SPAWN_EGG));
                stacks.add(new ItemStack(CUBE_SPAWN_EGG));
                stacks.add(new ItemStack(YOUR_ITEM));
                stacks.add(new ItemStack(YOUR_ITEM_2));

                stacks.add(new ItemStack(SOUL_JACK_O_LANTERN));
                stacks.add(new ItemStack(MILK_BUCKET));

                stacks.add(new ItemStack(MUSIC_RECORD));
            })
            .build();



    public static final ItemGroup SQUID_CRAFT_COMBAT_AND_TOOLS = FabricItemGroupBuilder.create(
            new Identifier("sc_combat_and_tools"))
            .icon(() -> new ItemStack(SQUID_SWORD))
            .appendItems(stacks -> {
                stacks.add(new ItemStack(SQUID_HELMET));
                stacks.add(new ItemStack(SQUID_CHESTPLATE));
                stacks.add(new ItemStack(SQUID_LEGGINGS));
                stacks.add(new ItemStack(SQUID_BOOTS));

                stacks.add(new ItemStack(SQUID_AXE));
                stacks.add(new ItemStack(SQUID_HOE));
                stacks.add(new ItemStack(SQUID_PICKAXE));
                stacks.add(new ItemStack(SQUID_SHOVEL));
                stacks.add(new ItemStack(SQUID_SWORD));

            })
            .build();

}


<|start_filename|>backup/squid233/squidcraft/entity/LavaSquidRenderer.java<|end_filename|>
package io.github.squid233.squidcraft.entity;

import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.MobEntityRenderer;
import net.minecraft.client.render.entity.model.SquidEntityModel;
import net.minecraft.util.Identifier;

public class LavaSquidRenderer extends MobEntityRenderer<LavaSquidEntity, SquidEntityModel<LavaSquidEntity>> {

    public LavaSquidRenderer(EntityRenderDispatcher entityRenderDispatcher) {
        super(entityRenderDispatcher, new SquidEntityModel<>(), 0.7F);
    }

    @Override
    public Identifier getTexture(LavaSquidEntity entity) {
        return new Identifier("textures/entity/squid.png");
    }
}


<|start_filename|>backup/squid233/squidcraft/world/biome/BiomeUtils.java<|end_filename|>
package io.github.squid233.squidcraft.world.biome;

import io.github.squid233.squidcraft.world.Features;
import io.github.squid233.squidcraft.world.feature.OreFeature;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.sound.BiomeMoodSound;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeEffects;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.ProbabilityConfig;
import net.minecraft.world.gen.decorator.ChanceDecoratorConfig;
import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.decorator.DecoratorConfig;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.FeatureConfig;
import net.minecraft.world.gen.feature.MineshaftFeature;
import net.minecraft.world.gen.feature.MineshaftFeatureConfig;
import net.minecraft.world.gen.feature.ShipwreckFeatureConfig;
import net.minecraft.world.gen.surfacebuilder.ConfiguredSurfaceBuilder;
import net.minecraft.world.gen.surfacebuilder.SurfaceBuilder;
import net.minecraft.world.gen.surfacebuilder.TernarySurfaceConfig;

import static net.minecraft.entity.EntityType.*;
import static net.minecraft.entity.SpawnGroup.WATER_CREATURE;
import static net.minecraft.world.gen.GenerationStep.Feature.VEGETAL_DECORATION;
import static net.minecraft.world.gen.feature.DefaultBiomeFeatures.*;
import static net.minecraft.world.gen.feature.StructureFeature.MINESHAFT;
import static net.minecraft.world.gen.feature.StructureFeature.SHIPWRECK;

public class BiomeUtils {

    protected static void adds(GenerationSettings.Builder b) {
        addOceanCarvers(b);
        addDefaultLakes(b);
        addDungeons(b);
        addDefaultOres(b);
        addDefaultDisks(b);
        addMineables(b);
        addWaterBiomeOakTrees(b);
        addDefaultFlowers(b);
        addDefaultGrass(b);
        addDefaultMushrooms(b);
        addDefaultVegetation(b);
        addSprings(b);
        addSeagrassOnStone(b);
        addKelp(b);
        addFrozenTopLayer(b);
        addClay(b);
        addDefaultUndergroundStructures(b);
    }

    public static void spawnWaterCreature(SpawnSettings.Builder b, EntityType<? extends Entity> entityType, int w, int min, int max) {
        b.spawn(WATER_CREATURE, new SpawnSettings.SpawnEntry(entityType, w, min, max));
    }

    public static GenerationSettings.Builder buildGrassSurface(GenerationSettings.Builder anotherGenSet, SurfaceBuilder<TernarySurfaceConfig> surfaceBuilder) {
        return anotherGenSet.surfaceBuilder(new ConfiguredSurfaceBuilder<>(surfaceBuilder, SurfaceBuilder.GRASS_CONFIG));
    }

    public static Biome createSquidBiome(SurfaceBuilder<TernarySurfaceConfig> surfaceBuilder,
                                         Biome.Precipitation precipitation,
                                         float temperature,
                                         float downfall,
                                         BiomeMoodSound moodSound) {
        SpawnSettings.Builder b = new SpawnSettings.Builder();
        GenerationSettings.Builder bb = buildGrassSurface(new GenerationSettings.Builder().feature(GenerationStep.Feature.UNDERGROUND_ORES, OreFeature.SQUID_BLOCK_OVERWORLD)
                .feature(GenerationStep.Feature.SURFACE_STRUCTURES,
                Features.SQUID_SPIRAL.configure(FeatureConfig.DEFAULT).decorate(Decorator.CHANCE.configure(new ChanceDecoratorConfig(100)))), surfaceBuilder);
        bb.structureFeature(MINESHAFT.configure(new MineshaftFeatureConfig(0.004F, MineshaftFeature.Type.NORMAL)));
        bb.structureFeature(SHIPWRECK.configure(new ShipwreckFeatureConfig(false)));
        adds(bb);
        bb.feature(VEGETAL_DECORATION, Feature.SEAGRASS.configure(new ProbabilityConfig(0.3F)).decorate(Decorator.TOP_SOLID_HEIGHTMAP.configure(DecoratorConfig.DEFAULT)));
        spawnWaterCreature(b, SQUID, 96, 4, 6);
        spawnWaterCreature(b, COD, 10, 3, 6);
        spawnWaterCreature(b, DOLPHIN, 2, 1, 2);
        return new Biome.Builder()
                .spawnSettings(b.build())
                .generationSettings(bb.build())
                .precipitation(precipitation)
                .category(Biome.Category.OCEAN)
                .depth(0.125F)
                .scale(0.05F)
                .temperature(temperature)
                .downfall(downfall)
                .effects(new BiomeEffects.Builder()
                        .waterColor(4159204)
                        .waterFogColor(329011)
                        .fogColor(12638463)
                        .moodSound(moodSound)
                        .build())
                .build();
    }
}

<|start_filename|>backup/squid233/squidcraft/api/FluidRegistries.java<|end_filename|>
package io.github.squid233.squidcraft.api;

import net.minecraft.block.Block;
import net.minecraft.fluid.FlowableFluid;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class FluidRegistries {
    /**
     * Let it cannot constructing
     */
    private FluidRegistries() {

    }

    /**
     * This method can register still fluid and flowing fluid.
     * @param modid Mod identifier
     * @param fluidName Still fluid's register name is fluidName. Flowing fluid's register name is flowing_ + fluidName.
     * @param stillFluid The still fluid.
     * @param flowingFluid The flowing fluid.
     * @param fluidBlock The fluid block.
     */
    public static void registerFluid(String modid, String fluidName, FlowableFluid stillFluid, FlowableFluid flowingFluid, Block fluidBlock) {
        Registry.register(Registry.FLUID, new Identifier(modid, fluidName), stillFluid);
        Registry.register(Registry.FLUID, new Identifier(modid, "flowing_"+ fluidName), flowingFluid);
        Registry.register(Registry.BLOCK, new Identifier(modid, fluidName), fluidBlock);
    }
}


<|start_filename|>src/main/resources/assets/squidcraft/blockstates/shredded_squid_crop.json<|end_filename|>
{
  "variants": {
    "age=0": {
      "model": "squidcraft:block/shredded_squid_crop_stage0"
    },
    "age=1": {
      "model": "squidcraft:block/shredded_squid_crop_stage0"
    },
    "age=2": {
      "model": "squidcraft:block/shredded_squid_crop_stage1"
    },
    "age=3": {
      "model": "squidcraft:block/shredded_squid_crop_stage1"
    },
    "age=4": {
      "model": "squidcraft:block/shredded_squid_crop_stage2"
    },
    "age=5": {
      "model": "squidcraft:block/shredded_squid_crop_stage2"
    },
    "age=6": {
      "model": "squidcraft:block/shredded_squid_crop_stage2"
    },
    "age=7": {
      "model": "squidcraft:block/shredded_squid_crop_stage3"
    }
  }
}

<|start_filename|>backup/squid233/squidcraft/world/feature/SquidSpiralFeature.java<|end_filename|>
package io.github.squid233.squidcraft.world.feature;

import com.mojang.serialization.Codec;
import io.github.squid233.squidcraft.util.register.BlockRegister;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.world.Heightmap;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;

import java.util.Random;

public class SquidSpiralFeature extends Feature<DefaultFeatureConfig> {
    public SquidSpiralFeature(Codec<DefaultFeatureConfig> codec) {
        super(codec);
    }

    @Override
    public boolean generate(StructureWorldAccess access, ChunkGenerator generator, Random random, BlockPos pos, DefaultFeatureConfig config) {
        BlockPos topPos = access.getTopPosition(Heightmap.Type.WORLD_SURFACE, pos);
        Direction offset = Direction.NORTH;
        for (int y = 1; y < 16; y++) {
            offset = offset.rotateYClockwise();
            access.setBlockState(topPos.up(y).offset(offset), BlockRegister.SQUID_BLOCK.getDefaultState(), 3);
        } return true;
    }
}


<|start_filename|>backup/squid233/squidcraft/item/ModToolMaterial.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import io.github.squid233.squidcraft.util.register.ItemRegister;
import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy;

import java.util.function.Supplier;

public enum ModToolMaterial implements ToolMaterial {
    SQUID(250, 10, 7, 4, 15, () -> {
        return Ingredient.ofItems(ItemRegister.SQUID_COOKIE);
    });

    private final int durability;
    private final float miningSpeed;
    private final float attackDamage;
    private final int miningLevel;
    private final int enchantability;
    private final Lazy<Ingredient> repairIngredient;

    ModToolMaterial(int durability, float miningSpeed, float attackDamage, int miningLevel, int enchantability, Supplier<Ingredient> repairIngredient) {
        this.durability = durability;
        this.miningSpeed = miningSpeed;
        this.attackDamage = attackDamage;
        this.miningLevel = miningLevel;
        this.enchantability = enchantability;
        this.repairIngredient = new Lazy<>(repairIngredient);
    }

    @Override
    public int getDurability() {
        return this.durability;
    }

    @Override
    public float getMiningSpeedMultiplier() {
        return this.miningSpeed;
    }

    @Override
    public float getAttackDamage() {
        return this.attackDamage;
    }

    @Override
    public int getMiningLevel() {
        return this.miningLevel;
    }

    @Override
    public int getEnchantability() {
        return this.enchantability;
    }

    @Override
    public Ingredient getRepairIngredient() {
        return this.repairIngredient.get();
    }
}


<|start_filename|>backup/squid233/squidcraft/mixin/SquidCraftMixin.java<|end_filename|>
package io.github.squid233.squidcraft.mixin;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.client.gui.AuthorsGui;
import io.github.squid233.squidcraft.config.Configs;
import io.github.squid233.squidcraft.config.CreateConfig;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerWarningScreen;
import net.minecraft.client.gui.screen.world.SelectWorldScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.realms.gui.screen.RealmsBridgeScreen;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

/**
 * @author baka4n and squid233
 * <p>Mixin inject, Inserts atfer the value specified by the code!</p>
 */
@Mixin(TitleScreen.class)
public abstract class SquidCraftMixin extends Screen {

    @Inject(at = @At("HEAD"), method = "init()V")
    private void init(CallbackInfo info) {
        log("This line is print by SquidCraft mod!");
    }

    private void log(String message) {
        SquidCraft.logInfo(message);
    }

    /**
     * @author baka4n
     * @reason Add mod button
     * @param y int
     * @param spacingY int
     */
    @Overwrite
    private void initWidgetsNormal(int y, int spacingY) {
        if ("false".equals(CreateConfig.get(Configs.HIDE_MAIN_SCREEN_BUTTON))) {
            this.addButton(new ButtonWidget(this.width / 2, y + spacingY, 100, 20, new TranslatableText("button.squidcraft.text"), (action) -> {
                MinecraftClient.getInstance().openScreen(new AuthorsGui(this));
                log("By Squid233 & baka4n");
            }));
        }
        this.addButton(new ButtonWidget(this.width / 2 - 100, y, 200, 20, new TranslatableText("menu.singleplayer"), (buttonWidget) -> {
            assert this.client != null;
            this.client.openScreen(new SelectWorldScreen(this));
        }));
        assert this.client != null;
        boolean bl = this.client.isMultiplayerEnabled();
        ButtonWidget.TooltipSupplier tooltipSupplier = bl ? ButtonWidget.EMPTY : (buttonWidget, matrixStack, i, j) -> {
            if (!buttonWidget.active) {
                this.renderOrderedTooltip(matrixStack, this.client.textRenderer.wrapLines(new TranslatableText("title.multiplayer.disabled"), Math.max(this.width / 2 - 43, 170)), i, j);
            }

        };
        this.addButton(new ButtonWidget(this.width / 2 - 100, y + spacingY, 100, 20, new TranslatableText("menu.multiplayer"), (buttonWidget) -> {
            Screen screen = this.client.options.skipMultiplayerWarning ? new MultiplayerScreen(this) : new MultiplayerWarningScreen(this);
            this.client.openScreen(screen);
        }, tooltipSupplier)).active = bl;
        this.addButton(new ButtonWidget(this.width / 2 - 100, y + spacingY * 2, 200, 20, new TranslatableText("menu.online"), (buttonWidget) -> this.switchToRealms(), tooltipSupplier)).active = bl;
    }

    /**
     * import minecraft switch To Realms
     * @author baka4n
     */
    private void switchToRealms() {
        RealmsBridgeScreen realmsBridge = new RealmsBridgeScreen();
        realmsBridge.switchToRealms(this);
    }

    /**
     * <p>Mixin SquidCraftMixin to Title Screen!</p>
     * @author squid233 and baka4n
     * @param title The title
     */
    protected SquidCraftMixin(Text title) {
        super(title);
    }

}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/SquidCraft.java<|end_filename|>
package io.github.squid233.squidcraft;

import io.github.squid233.squidcraft.block.Blocks;
import io.github.squid233.squidcraft.item.Items;
import net.fabricmc.api.ModInitializer;
import net.minecraft.client.gui.screen.TitleScreen;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class SquidCraft implements ModInitializer {
    public static final String MODID = "squidcraft";
    public static Logger logger;

    static {
        logger = LogManager.getLogger(MODID);
        new TitleScreen().addButton()
    }

    @Override
    public void onInitialize() {
        Items.init();
        Blocks.init();
    }
}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/ItemGroups.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import io.github.squid233.squidcraft.util.Identifier;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class ItemGroups {
    public static final ItemGroup SQUID_CRAFT = FabricItemGroupBuilder.build(new Identifier("squid_craft"), () -> new ItemStack(Items.SQUID_COOKIE));

    public static final ItemGroup SQUID_CRAFT_COMBAT_AND_TOOLS = FabricItemGroupBuilder.build(new Identifier("squid_craft"), () -> new ItemStack(Items.SQUID_HELMET));
}


<|start_filename|>backup/squid233/squidcraft/enchantment/StatusEffectInstances.java<|end_filename|>
package io.github.squid233.squidcraft.enchantment;

import net.minecraft.entity.effect.StatusEffectInstance;

import static net.minecraft.entity.effect.StatusEffects.*;

public class StatusEffectInstances {
    public static final StatusEffectInstance ABSORPTION_INSTANCE = new StatusEffectInstance(ABSORPTION);
    public static final StatusEffectInstance BAD_OMEN_INSTANCE = new StatusEffectInstance(BAD_OMEN);
    public static final StatusEffectInstance BLINDNESS_INSTANCE = new StatusEffectInstance(BLINDNESS);
    public static final StatusEffectInstance CONDUIT_POWER_INSTANCE = new StatusEffectInstance(CONDUIT_POWER);
    public static final StatusEffectInstance DOLPHINS_GRACE_INSTANCE = new StatusEffectInstance(DOLPHINS_GRACE);
    public static final StatusEffectInstance FIRE_RESISTANCE_INSTANCE = new StatusEffectInstance(FIRE_RESISTANCE);
    public static final StatusEffectInstance GLOWING_INSTANCE = new StatusEffectInstance(GLOWING);
    public static final StatusEffectInstance HASTE_INSTANCE = new StatusEffectInstance(HASTE);
    public static final StatusEffectInstance HEALTH_BOOST_INSTANCE = new StatusEffectInstance(HEALTH_BOOST);
    public static final StatusEffectInstance HERO_OF_THE_VILLAGE_INSTANCE = new StatusEffectInstance(HERO_OF_THE_VILLAGE);
    public static final StatusEffectInstance HUNGER_INSTANCE = new StatusEffectInstance(HUNGER);
    public static final StatusEffectInstance INSTANT_DAMAGE_INSTANCE = new StatusEffectInstance(INSTANT_DAMAGE);
    public static final StatusEffectInstance INSTANT_HEALTH_INSTANCE = new StatusEffectInstance(INSTANT_HEALTH);
    public static final StatusEffectInstance INVISIBILITY_INSTANCE = new StatusEffectInstance(INVISIBILITY);
    public static final StatusEffectInstance JUMP_BOOST_INSTANCE = new StatusEffectInstance(JUMP_BOOST);
    public static final StatusEffectInstance LEVITATION_INSTANCE = new StatusEffectInstance(LEVITATION);
    public static final StatusEffectInstance LUCK_INSTANCE = new StatusEffectInstance(LUCK);
    public static final StatusEffectInstance MINING_FATIGUE_INSTANCE = new StatusEffectInstance(MINING_FATIGUE);
    public static final StatusEffectInstance NAUSEA_INSTANCE = new StatusEffectInstance(NAUSEA);
    public static final StatusEffectInstance NIGHT_VISION_INSTANCE = new StatusEffectInstance(NIGHT_VISION);
    public static final StatusEffectInstance POISON_INSTANCE = new StatusEffectInstance(POISON);
    public static final StatusEffectInstance REGENERATION_INSTANCE = new StatusEffectInstance(REGENERATION);
    public static final StatusEffectInstance RESISTANCE_INSTANCE = new StatusEffectInstance(RESISTANCE);
    public static final StatusEffectInstance SATURATION_INSTANCE = new StatusEffectInstance(SATURATION);
    public static final StatusEffectInstance SLOW_FALLING_INSTANCE = new StatusEffectInstance(SLOW_FALLING);
    public static final StatusEffectInstance SLOWNESS_INSTANCE = new StatusEffectInstance(SLOWNESS);
    public static final StatusEffectInstance SPEED_INSTANCE = new StatusEffectInstance(SPEED);
    public static final StatusEffectInstance STRENGTH_INSTANCE = new StatusEffectInstance(STRENGTH);
    public static final StatusEffectInstance UNLUCK_INSTANCE = new StatusEffectInstance(UNLUCK);
    public static final StatusEffectInstance WATER_BREATHING_INSTANCE = new StatusEffectInstance(WATER_BREATHING);
    public static final StatusEffectInstance WEAKNESS_INSTANCE = new StatusEffectInstance(WEAKNESS);
    public static final StatusEffectInstance WITHER_INSTANCE = new StatusEffectInstance(WITHER);

}


<|start_filename|>src/main/java/io/github/squid233/squidcraft/item/FoodItem.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.item.FoodComponent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class FoodItem {
    private final Item.Settings settings;
    private int hunger;
    private float saturation;
    private boolean isMeat;
    private boolean isSnack;
    private boolean isAlwaysEdible;
    private StatusEffectInstance statusEffect;
    private float chance;

    public FoodItem(Item.Settings settings) {
        this.settings = settings;
    }

    public FoodItem(Item.Settings settings, int hunger, float saturation) {
        this(settings);
        hunger(hunger).saturation(saturation);
    }

    public FoodItem hunger(int hunger) {
        this.hunger = hunger;
        return this;
    }

    public FoodItem saturation(float saturation) {
        this.saturation = saturation;
        return this;
    }

    public FoodItem meat() {
        isMeat = true;
        return this;
    }

    public FoodItem snack() {
        isSnack = true;
        return this;
    }

    public FoodItem alwaysEdible() {
        isAlwaysEdible = true;
        return this;
    }

    public FoodItem statusEffect(StatusEffectInstance effect, float chance) {
        statusEffect = effect;
        this.chance = chance;
        return this;
    }

    @Environment(EnvType.CLIENT)
    public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
        tooltip.add(new TranslatableText("item.food.hunger", hunger));
        tooltip.add(new TranslatableText("item.food.saturation", saturation));
        tooltip.add(new TranslatableText("item.food.isWolfFood", isMeat));
        if (isAlwaysEdible) {
            tooltip.add(new TranslatableText("item.food.alwaysEdible"));
        }
    }

    public Item build() {
        FoodComponent.Builder b = new FoodComponent.Builder().hunger(hunger).saturationModifier(saturation);
        if (isMeat) {
            b.meat();
        }
        if (isSnack) {
            b.snack();
        }
        if (isAlwaysEdible) {
            b.alwaysEdible();
        }
        if (statusEffect != null) {
            b.statusEffect(statusEffect, chance);
        }
        return new Item(settings.food(b.build())) {
            @Override
            @Environment(EnvType.CLIENT)
            public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> tooltip, TooltipContext context) {
                FoodItem.this.appendTooltip(stack, world, tooltip, context);
            }
        };
    }
}


<|start_filename|>backup/squid233/squidcraft/modmenu/SquidCraftConfigScreen.java<|end_filename|>
package io.github.squid233.squidcraft.modmenu;

import io.github.prospector.modmenu.api.ConfigScreenFactory;
import io.github.squid233.squidcraft.config.Configs;
import io.github.squid233.squidcraft.config.CreateConfig;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ScreenTexts;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.LiteralText;
import net.minecraft.text.TranslatableText;

public class SquidCraftConfigScreen extends Screen implements ConfigScreenFactory<SquidCraftConfigScreen> {

    private final Screen previousScreen;
    private ButtonWidget hideMainScreenButtonConfig;

    private int paneWidth;
    private final int textFieldWidth = paneWidth - 32 - 22;

    protected SquidCraftConfigScreen(Screen previous) {
        super(new TranslatableText("screen.config.squidcraft"));

        previousScreen = previous;
        paneWidth = width / 2 - 8;

        hideMainScreenButtonConfig = new ButtonWidget(120, 22, textFieldWidth, 20,
                new LiteralText(CreateConfig.get(Configs.HIDE_MAIN_SCREEN_BUTTON)), button -> {
            if ("false".equals(CreateConfig.get(Configs.HIDE_MAIN_SCREEN_BUTTON))) {
                CreateConfig.PROPERTIES.setProperty("hideMainScreenButton", "true");
                hideMainScreenButtonConfig.setMessage(NormalTexts.TRUE);
            } else {
                CreateConfig.PROPERTIES.setProperty("hideMainScreenButton", "false");
                hideMainScreenButtonConfig.setMessage(NormalTexts.FALSE);
            }
        });
    }

    @Override
    public SquidCraftConfigScreen create(Screen parent) {
        return this;
    }

    @Override
    public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
        renderBackground(matrices);
        drawCenteredText(matrices, this.textRenderer, this.title, this.width / 2, 15, 0xffffff);
        textRenderer.drawWithShadow(matrices, "hideMainScreenButton", 0, 22, 0xffffff);
        //hideMainScreenButtonConfig.render(matrices, mouseX, mouseY, delta);
        super.render(matrices, mouseX, mouseY, delta);
    }

    @Override
    protected void init() {
        //children.add(this.hideMainScreenButtonConfig);
        addButton(new ButtonWidget(this.width / 2 - 154, this.height - 28, 150, 20, new TranslatableText("button.reset.text"),
                button -> children()));
        addButton(new ButtonWidget(this.width / 2 + 4, this.height - 28, 150, 20, ScreenTexts.DONE, button -> {
            assert client != null;
            client.openScreen(previousScreen);
        }));
        addButton(hideMainScreenButtonConfig);
        //setInitialFocus(hideMainScreenButtonConfig);
    }

    /*@Override
    public boolean keyPressed(int int_1, int int_2, int int_3) {
        return super.keyPressed(int_1, int_2, int_3) || hideMainScreenButtonConfig.keyPressed(int_1, int_2, int_3);
    }

    @Override
    public boolean charTyped(char chr, int keyCode) {
        return hideMainScreenButtonConfig.charTyped(chr, keyCode);
    }

    @Override
    public void tick() {
        hideMainScreenButtonConfig.tick();
    }*/
}


<|start_filename|>backup/squid233/squidcraft/block/tile/BiggerChestBlock.java<|end_filename|>
package io.github.squid233.squidcraft.block.tile;

import io.github.squid233.squidcraft.util.register.BlockRegister;
import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState;
import net.minecraft.block.BlockWithEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.ItemScatterer;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;

import javax.annotation.Nullable;
import java.util.List;

public class BiggerChestBlock extends BlockWithEntity {

    public BiggerChestBlock(Settings settings) {
        super(settings);
    }

    // A side effect of extending BlockWithEntity is it changes the render type to INVISIBLE, so we have to revert this
    @Override
    public BlockRenderType getRenderType(BlockState state) {
        return BlockRenderType.MODEL;
    }

    // We will create the BlockEntity later.
    @Override
    public BlockEntity createBlockEntity(BlockView view) {
        return BlockRegister.BIGGER_CHEST_BLOCK_ENTITY;
    }

    @Override
    public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) {
        if (itemStack.hasCustomName()) {
            BlockEntity blockEntity = world.getBlockEntity(pos);
            if (blockEntity instanceof BiggerChestBlockEntity) {
                ((BiggerChestBlockEntity) blockEntity).setCustomName(itemStack.getName());
            }
        }
    }

    @Override
    @SuppressWarnings("deprecation")
    public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
        if (!world.isClient) {
            BlockEntity blockEntity = world.getBlockEntity(pos);
            if (blockEntity instanceof BiggerChestBlockEntity) {
                //ContainerProviderRegistry.INSTANCE.openContainer(BlockRegister.BIGGER_CHEST, player, buf -> buf.writeBlockPos(pos));
                world.playSound(player, player.getBlockPos(), SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5f, 0.5f);
                player.openHandledScreen(createScreenHandlerFactory(state, world, pos));
            }
        }
        return ActionResult.SUCCESS;
    }

    // Scatter the items in the chest when it is removed.
    @Override
    @SuppressWarnings("deprecation")
    public void onStateReplaced(BlockState state, World world, BlockPos pos, BlockState newState, boolean moved) {
        if (state.getBlock() != newState.getBlock()) {
            BlockEntity blockEntity = world.getBlockEntity(pos);
            if (blockEntity instanceof BiggerChestBlockEntity) {
                ItemScatterer.spawn(world, pos, (BiggerChestBlockEntity) blockEntity);
                // update comparators
                world.updateComparators(pos, this);
            }
            super.onStateReplaced(state, world, pos, newState, moved);
        }
    }

    @Override
    @SuppressWarnings("deprecation")
    public boolean hasComparatorOutput(BlockState state) {
        return true;
    }

    @Override
    @SuppressWarnings("deprecation")
    public int getComparatorOutput(BlockState state, World world, BlockPos pos) {
        return ScreenHandler.calculateComparatorOutput(world.getBlockEntity(pos));
    }



    @Override
    public void appendTooltip(ItemStack stack, @Nullable BlockView world, List<Text> tooltip, TooltipContext options) {
        tooltip.add(new LiteralText("Don't use this block!!! Your game will be throw java.lang.NullPointerException!"));
    }
}


<|start_filename|>backup/squid233/squidcraft/api/util/Loggers.java<|end_filename|>
package io.github.squid233.squidcraft.api.util;

import io.github.squid233.squidcraft.config.Configs;
import io.github.squid233.squidcraft.config.CreateConfig;
import org.apache.logging.log4j.LogManager;

public class Loggers {
    /** Default false */
    public static boolean enableRegisterLog = CreateConfig.getBoolean(Configs.ENABLE_REGISTER_LOG);

    /**
     * @param senderName logger name
     * @param info logger info
     */
    public static void logInfo(String senderName, String info) {
        LogManager.getLogger(senderName).info(info);
    }
}


<|start_filename|>backup/squid233/squidcraft/item/YourItem.java<|end_filename|>
package io.github.squid233.squidcraft.item;

import io.github.squid233.squidcraft.api.item.Item;
import io.github.squid233.squidcraft.config.Configs;
import io.github.squid233.squidcraft.config.CreateConfig;

public class YourItem extends Item {
    public YourItem() {
        super(new Settings().group(ItemGroups.SQUID_CRAFT).maxCount(CreateConfig.getInt(Configs.YOUR_ITEM_MAX_COUNT)));
    }

    @Override
    public String getRegistryName() {
        return "your_item";
    }
}


<|start_filename|>backup/squid233/squidcraft/block/tile/BiggerChestBlockEntity.java<|end_filename|>
package io.github.squid233.squidcraft.block.tile;

import io.github.squid233.squidcraft.SquidCraft;
import io.github.squid233.squidcraft.client.gui.BiggerChestScreenHandler;
import io.github.squid233.squidcraft.util.register.BlockRegister;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.LootableContainerBlockEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventories;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.collection.DefaultedList;

public class BiggerChestBlockEntity extends LootableContainerBlockEntity {
    private DefaultedList<ItemStack> inventory;
    private static final int INVENTORY_SIZE = 54; // 9 * 6 = 54

    public BiggerChestBlockEntity() {
        super(BlockRegister.BIGGER_CHEST_ENTITY_TYPE);
        this.inventory = DefaultedList.ofSize(INVENTORY_SIZE, ItemStack.EMPTY);
    }

    @Override
    protected Text getContainerName() {
        return new TranslatableText("container." + SquidCraft.MODID + ".bigger_chest");
    }

    @Override
    protected ScreenHandler createScreenHandler(int syncId, PlayerInventory playerInventory) {
        return new BiggerChestScreenHandler(syncId, playerInventory, this);
    }

    @Override
    protected DefaultedList<ItemStack> getInvStackList() {
        return this.inventory;
    }

    @Override
    protected void setInvStackList(DefaultedList<ItemStack> list) {
        this.inventory = list;
    }

    @Override
    public int size() {
        return INVENTORY_SIZE;
    }

    @Override
    public void fromTag(BlockState state, CompoundTag tag) {
        super.fromTag(state, tag);
        this.inventory = DefaultedList.ofSize(this.size(), ItemStack.EMPTY);
        if (!this.deserializeLootTable(tag)) {
            Inventories.fromTag(tag, this.inventory);
        }
    }

    @Override
    public CompoundTag toTag(CompoundTag tag) {
        super.toTag(tag);
        if (!this.serializeLootTable(tag)) {
            Inventories.toTag(tag, this.inventory);
        }
        return tag;
    }
}


<|start_filename|>backup/squid233/squidcraft/entity/CubeEntityRenderer.java<|end_filename|>
package io.github.squid233.squidcraft.entity;

import io.github.squid233.squidcraft.SquidCraft;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.MobEntityRenderer;
import net.minecraft.util.Identifier;

/*
 * A renderer is used to provide an entity model, shadow size, and texture.
 */
public class CubeEntityRenderer extends MobEntityRenderer<CubeEntity, CubeEntityModel> {

    public CubeEntityRenderer(EntityRenderDispatcher entityRenderDispatcher) {
        super(entityRenderDispatcher, new CubeEntityModel(), 0.5f);
    }

    @Override
    public Identifier getTexture(CubeEntity entity) {
        return new Identifier(SquidCraft.MODID, "textures/entity/cube.png");
    }
}

<|start_filename|>src/main/java/io/github/squid233/squidcraft/block/Blocks.java<|end_filename|>
package io.github.squid233.squidcraft.block;

import com.mojang.authlib.GameProfile;
import io.github.squid233.squidcraft.item.SettingsGroup;
import io.github.squid233.squidcraft.util.Identifier;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.registry.Registry;

import java.util.HashMap;
import java.util.UUID;

import static io.github.squid233.squidcraft.item.ItemGroups.SQUID_CRAFT;

/**
 * @author squid233
 * @date 2020/9/20
 */
public class Blocks {
    private static final HashMap<net.minecraft.util.Identifier, Block> MAP = new HashMap<>(20);
    private static final HashMap<net.minecraft.util.Identifier, Item> ITEM_MAP = new HashMap<>(20);

    public static final Block SQUID_BLOCK;
    public static final Block COMPRESS_SQUID_BLOCK;
    public static final Block LOW_SQUID_BLOCK;
    public static final Block LOW_COMPRESS_SQUID_BLOCK;
    public static final Block MEDIUM_SQUID_BLOCK;
    public static final Block MEDIUM_COMPRESS_SQUID_BLOCK;
    public static final Block HIGHER_SQUID_BLOCK;
    public static final Block HIGHER_COMPRESS_SQUID_BLOCK;
    public static final Block SUPER_SQUID_BLOCK;
    public static final Block SUPER_COMPRESS_SQUID_BLOCK;
    public static final Block ULTIMATE_SQUID_BLOCK;
    public static final Block ULTIMATE_COMPRESS_SQUID_BLOCK;
    public static final Block ONE_SQUID_BLOCK;
    public static final Block TWO_SQUID_BLOCK;
    public static final Block FOUR_SQUID_BLOCK;
    public static final Block EIGHT_SQUID_BLOCK;
    public static final Block SQUID_SIDE_BLOCK;
    public static final Block BIGGER_CHEST_BLOCK;
    public static final Block SOUL_JACK_O_LANTERN;
    public static final Block SHREDDED_SQUID_CROP;

    static {
        class FoodBlock extends io.github.squid233.squidcraft.block.FoodBlock {
            public FoodBlock(float hardness, int hunger, float saturation) {
                super(hardness, new SettingsGroup(SQUID_CRAFT), hunger, saturation);
            }

            public FoodBlock(float hardness, float resistance, int hunger, float saturation) {
                super(hardness, resistance, new SettingsGroup(SQUID_CRAFT), hunger, saturation);
            }
        }
        SQUID_BLOCK                   = regFood("squid_block",                   new FoodBlock(0.5f, 1000, 100));
        COMPRESS_SQUID_BLOCK          = regFood("compress_squid_block",          new FoodBlock(0.52f, 6000, 110));
        LOW_SQUID_BLOCK               = regFood("low_squid_block",               new FoodBlock(0.55f, 0.1f,  11000, 120));
        LOW_COMPRESS_SQUID_BLOCK      = regFood("low_compress_squid_block",      new FoodBlock(0.6f,  0.15f, 16000, 130));
        MEDIUM_SQUID_BLOCK            = regFood("medium_squid_block",            new FoodBlock(0.65f, 0.2f,  21000, 140));
        MEDIUM_COMPRESS_SQUID_BLOCK   = regFood("medium_compress_squid_block",   new FoodBlock(0.7f,  0.25f, 26000, 150));
        HIGHER_SQUID_BLOCK            = regFood("higher_squid_block",            new FoodBlock(0.75f, 0.3f,  31000, 160));
        HIGHER_COMPRESS_SQUID_BLOCK   = regFood("higher_compress_squid_block",   new FoodBlock(0.8f,  0.35f, 36000, 170));
        SUPER_SQUID_BLOCK             = regFood("super_squid_block",             new FoodBlock(0.85f, 0.4f,  41000, 180));
        SUPER_COMPRESS_SQUID_BLOCK    = regFood("super_compress_squid_block",    new FoodBlock(0.9f,  0.45f, 46000, 190));
        ULTIMATE_SQUID_BLOCK          = regFood("ultimate_squid_block",          new FoodBlock(0.95f, 0.5f,  51000, 200));
        ULTIMATE_COMPRESS_SQUID_BLOCK = regFood("ultimate_compress_squid_block", new FoodBlock(1,     0.55f, 56000, 210));
        ONE_SQUID_BLOCK               = regFood("one_squid_block",               new FoodBlock(1.5f,  0.6f,  61000, 220));
        TWO_SQUID_BLOCK               = regFood("two_squid_block",               new FoodBlock(2,     0.65f, 66000, 230));
        FOUR_SQUID_BLOCK              = regFood("four_squid_block",              new FoodBlock(2.5f,  0.7f,  71000, 240));
        EIGHT_SQUID_BLOCK             = regFood("eight_squid_block",             new FoodBlock(3,     0.75f, 76000, 250));
    }

    private static Block reg(String id, Block block, Item.Settings itemSettings, boolean hasItem) {
        MAP.put(new Identifier(id), block);
        if (hasItem) {
            ITEM_MAP.put(new Identifier(id), new BlockItem(block, itemSettings));
        }
        return block;
    }

    private static Block reg(String id, Block block, Item.Settings itemSettings) {
        return reg(id, block, itemSettings, true);
    }

    private static Block regFood(String id, FoodBlock foodBlock) {
        return reg(id, foodBlock, foodBlock.getItemSettings());
    }

    private static boolean initialized = false;
    public static void init() {
        if (!initialized) {
            initialized = true;
            MAP.forEach((identifier, block) -> Registry.register(Registry.BLOCK, identifier, block));
            ITEM_MAP.forEach((identifier, item) -> Registry.register(Registry.ITEM, identifier, item));
        }
    }
}
