Skip to content
This repository has been archived by the owner on Dec 19, 2020. It is now read-only.

Commit

Permalink
see changelog.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Jul 26, 2020
1 parent deaa8bd commit 05bda92
Show file tree
Hide file tree
Showing 153 changed files with 718 additions and 217 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ...ds/[email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file removed [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file added [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed ...ds/[email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified ...ods/[email protected]_16_1.1.16.1+build.21-v2-sources.jar
Binary file not shown.
Binary file modified ...mapped_mods/[email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .../[email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file removed [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file removed [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
Binary file not shown.
Binary file added [email protected]_16_1.1.16.1+build.21-v2.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// uncomment to import JetBrains annotation
compileOnly "org.jetbrains:annotations:18.0.0"
// compileOnly "org.jetbrains:annotations:18.0.0"

compileOnly "com.google.code.findbugs:jsr305:3.0.2"

// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
Expand Down
Binary file removed build/libs/SquidCraft-1.16-0.2.0-dev.jar
Binary file not shown.
17 changes: 14 additions & 3 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
2020-7-7 ~ 7-8 1.16-0.2.0
2020-7-7 ~ 7-26 1.16-0.2.0

1. delete 18 useless texture
1. delete 20 useless texture
2. fix shredded squid crop texture
3. delete some useless i18n
3. delete some useless translation
4. move "io.github.squid233.api" to "io.github.squid233.squidcraft.api"
5. delete "io.github.squid233.squidcraft.api.block" pack
6. add new API: io.github.squid233.squidcraft.api.item.ItemFood"
6. add new API: io.github.squid233.squidcraft.api.block.BlockFood"
7. fix translation
8. add new entity: cube
9. cube can spawn in plains
10. change some blocks' hunger and saturation

To-do List
TODO cookie creeper can't spawn
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1536M -Dhttps.proxyHost=127.0.0.1 -Dhttp.proxyHost=127.0.0.1 -Dhttps.proxyPort=7890 -Dhttp.proxyPort=7890
org.gradle.jvmargs=-Xmx1536M \
-Dhttps.proxyHost=127.0.0.1 -Dhttp.proxyHost=127.0.0.1 -Dhttps.proxyPort=10809 -Dhttp.proxyPort=10809

# Fabric Properties
# check these on https://fabricmc.net/use
Expand All @@ -14,4 +15,4 @@ org.gradle.jvmargs=-Xmx1536M -Dhttps.proxyHost=127.0.0.1 -Dhttp.proxyHost=127.0.

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.15.1+build.380-1.16
fabric_version=0.16.0+build.384-1.16.1
32 changes: 17 additions & 15 deletions src/main/java/io/github/squid233/squidcraft/SquidCraft.java
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
package io.github.squid233.squidcraft;

import io.github.squid233.squidcraft.api.util.Loggers;
import io.github.squid233.squidcraft.api.util.MinecraftMod;
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.registers.*;
import net.fabricmc.api.ModInitializer;

import static io.github.squid233.squidcraft.api.util.Loggers.log;

/**
* @author squid233 and baka4n → (logger4j test)!
*/
public final class SquidCraft implements ModInitializer, MinecraftMod {
@MinecraftMod(modid = SquidCraft.MODID)
public final class SquidCraft implements ModInitializer {

public static final String MODID = "squidcraft";

@Override
public void onInitialize() {
String s = "SquidCraft register all";
CreateConfig.create();
//noinspection InstantiationOfUtilityClass
new ItemRegister();
log(s, "item register success");
logInfo("item register success");
new BlockRegister();
log(s, "block register success");
logInfo("block register success");
new FluidRegister();
log(s, "fluid register success");
logInfo("fluid register success");
new EnchantmentRegister();
log(s, "enchantment register success");
logInfo("enchantment register success");
new WorldGenRegister();
log(s, "world generator register success");
logInfo("world generator register success");
new LootTablesHandle();
log(s, "loot table register success");
log(s, "load on initialize success");
logInfo("loot table register success");
new ModEntities();
logInfo("entities register success");
logInfo("load on initialize success");
}

@Override
public String getModName() {
return "SquidCraft";
public static void logInfo(String info) {
Loggers.logInfo(SquidCraft.class, info);
}

}
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
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;

import static io.github.squid233.squidcraft.api.util.Loggers.log;

public class BlockRegisters {
/**
* <h1>The register method</h1>
Expand All @@ -17,25 +16,24 @@ public class BlockRegisters {
* <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 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) {
String s = "register block and block item";
ItemRegisters.register(modid, name, new BlockItem(block, settings));
if (Loggers.enableRegisterLog) {
log(s, "register " + modid + ":" + name + " block success!");
SquidCraft.logInfo("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) {
String s = "register block";
if (Loggers.enableRegisterLog) {
log(s, "register " + modid + ":" + name + " block success!");
SquidCraft.logInfo("register " + modid + ":" + name + " block success!");
}
return Registry.register(Registry.BLOCK, new Identifier(modid, name), block);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
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;

import static io.github.squid233.squidcraft.api.util.Loggers.log;

/**
* items register api → (item, tool and armor) register.
*/
Expand All @@ -24,7 +23,7 @@ public class ItemRegisters {
*/
public static Item register(String modid, String name, Item item) {
if (Loggers.enableRegisterLog) {
log("Items Register", "register " + modid + ":" + name + " success!");
SquidCraft.logInfo("register " + modid + ":" + name + " success!");
}
return Registry.register(Registry.ITEM, new Identifier(modid, name), item);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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 net.minecraft.world.World;

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 buildTooltip(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));
}

public static class ItemBlock extends BlockItem {

private final int hunger;
private final float saturationModifier;

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()));
hunger = block.hunger;
saturationModifier = block.saturationModifier;
}

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

@Override
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", saturationModifier));
tooltip.add(new TranslatableText("item.food.isWolfFood", true));
}
}
}
}
108 changes: 108 additions & 0 deletions src/main/java/io/github/squid233/squidcraft/api/item/ItemFood.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
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 saturationModifier;

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

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


/**
* 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) {
tooltip.add(new TranslatableText("item.food.hunger", hunger));
tooltip.add(new TranslatableText("item.food.saturation", saturationModifier));
tooltip.add(new TranslatableText("item.food.isWolfFood", 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 saturationModifier;

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

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

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

public static class Big extends Item {

private final int hunger;
private final float saturationModifier;

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

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

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

}

}
}
Loading

0 comments on commit 05bda92

Please sign in to comment.