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

Commit

Permalink
update to 20w22a
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed May 30, 2020
1 parent 09af4d5 commit 2e2dceb
Show file tree
Hide file tree
Showing 339 changed files with 4,500 additions and 53 deletions.
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
# gradle

.gradle/
build/
.gradle/6.3/
.gradle/buildOutputCleanup/
.gradle/checksums/
.gradle/loom-cache/launch.cfg
.gradle/loom-cache/log4j.xml
.gradle/vcs-1/
.gradle/vcsWorkingDirs/
build/classes/
build/generated/
build/loom-cache/
build/resources/
build/tmp/
out/
run/
classes/

# eclipse
Expand Down
Binary file added ...s/[email protected]+build.1-v2-sources.jar
Binary file not shown.
Binary file added ...pped_mods/[email protected]+build.1-v2.jar
Binary file not shown.
Binary file added ...s/[email protected]+build.1-v2-sources.jar
Binary file not shown.
Binary file added ...pped_mods/[email protected]+build.1-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 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 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 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 not shown.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ dependencies {
// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

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

// 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
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G -Dhttps.proxyHost=127.0.0.1 -Dhttp.proxyHost=127.0.0.1 -Dhttps.proxyPort=10809 -Dhttp.proxyPort=10809
org.gradle.jvmargs=-Xmx1G -Dhttps.proxyHost=127.0.0.1 -Dhttp.proxyHost=127.0.0.1 -Dhttps.proxyPort=10809 -Dhttp.proxyPort=10809 -XX:+UseG1GC

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.15.2
yarn_mappings=1.15.2+build.15
minecraft_version=20w22a
yarn_mappings=20w22a+build.1
loader_version=0.8.4+build.198

# Mod Properties
mod_version = 1.15.2-0.4.9
mod_version = 1.16-0.1.0
maven_group = io.github.squid233.squidcraft
archives_base_name = SquidCraft

# 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.10.8+build.310-1.15
fabric_version=0.11.1+build.350-1.16
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Tue May 26 13:24:44 CST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
14 changes: 14 additions & 0 deletions minecraftargs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-XX:+UseLargePagesInMetaspace
-XX:+UseG1GC
-XX:+UnlockExperimentalVMOptions
-XX:MaxGCPauseMillis=100
-XX:+DisableExplicitGC
-XX:TargetSurvivorRatio=90
-XX:G1NewSizePercent=50
-XX:G1MaxNewSizePercent=80
-XX:G1MixedGCLiveThresholdPercent=35
-XX:+AlwaysPreTouch
-XX:+ParallelRefProcEnabled
-Dfabric.dli.config=D:\SquidCraft-1.16.x\.gradle\loom-cache\launch.cfg
-Dfabric.dli.env=client
-Dfabric.dli.main=net.fabricmc.loader.launch.knot.KnotClient
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginManagement {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
url = 'https://maven.modmuss50.me/'
}
gradlePluginPortal()
}
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/io/github/squid233/api/block/Block.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.squid233.api.block;

public abstract class Block extends net.minecraft.block.Block {

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

public abstract String getRegistryName();

}
11 changes: 11 additions & 0 deletions src/main/java/io/github/squid233/api/item/Item.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.squid233.api.item;

public abstract class Item extends net.minecraft.item.Item {

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

public abstract String getRegistryName();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.github.squid233.api.state.property;

import net.minecraft.state.property.DirectionProperty;
import net.minecraft.util.math.Direction;

public class Properties {
}
40 changes: 40 additions & 0 deletions src/main/java/io/github/squid233/squidcraft/SquidCraft.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package io.github.squid233.squidcraft;

import io.github.squid233.squidcraft.config.CreateConfig;
import io.github.squid233.squidcraft.util.handle.LootTablesHandle;
import io.github.squid233.squidcraft.util.registers.*;
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() {
String s = "SquidCraft register all";
CreateConfig.config();
new ItemRegister();
log(s, "item register success");
new BlockRegister();
log(s, "block register success");
new FluidRegister();
log(s, "fluid register success");
new EnchantmentRegister();
log(s, "enchantment register success");
new WorldGenRegister();
log(s, "world generator register success");
new LootTablesHandle();
log(s, "loot table register success");
log(s, "load on initialize success");
}

/**
* @param s1 logger name
* @param s2 logger info
*/
public static void log(String s1, String s2) {
LogManager.getLogger(s1).info(s2);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.github.squid233.squidcraft.api;

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.SquidCraft.log;

public class BlockRegisters {
/**
* <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 remind 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) {
String s = "register block and block item";
ItemRegisters.register(modid, name, new BlockItem(block, settings));
//ItemRegisters.register(modid, name, new BlockItem(block, settings));
log(s, "register " + modid + ":" + name + " block success!");
return Registry.register(Registry.BLOCK, new Identifier(modid, name), block);
}
}
29 changes: 29 additions & 0 deletions src/main/java/io/github/squid233/squidcraft/api/FluidRegister.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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 FluidRegister {
/**
* Let it cannot constructing
*/
private FluidRegister() {

}

/**
* This method can register still fluid and flowing fluid.
* @param modid Mod identifier
* @param fluidID Still fluid's register name is fluidID. Flowing fluid's register name is flowing_ + fluidID.
* @param stillFluid The still fluid.
* @param flowingFluid The flowing fluid.
* @param fluidBlock The fluid block.
*/
public static void registerFluid(String modid, String fluidID, FlowableFluid stillFluid, FlowableFluid flowingFluid, Block fluidBlock) {
Registry.register(Registry.FLUID, new Identifier(modid, fluidID), stillFluid);
Registry.register(Registry.FLUID, new Identifier(modid, "flowing_"+fluidID), flowingFluid);
Registry.register(Registry.BLOCK, new Identifier(modid, fluidID), fluidBlock);
}
}
125 changes: 125 additions & 0 deletions src/main/java/io/github/squid233/squidcraft/api/ItemRegisters.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
package io.github.squid233.squidcraft.api;

import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import static io.github.squid233.squidcraft.SquidCraft.log;

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

/**
* <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) {
log("Items Register", "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);
}

public static void registerAll(String modid, io.github.squid233.api.item.Item... items) {
for (io.github.squid233.api.item.Item item : items) {
register(modid, item.getRegistryName(), item);
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.github.squid233.squidcraft.api;

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

public class SoundsRegister {
public static void registerSound(Identifier soundID, SoundEvent sound) {
Registry.register(Registry.SOUND_EVENT, soundID, sound);
log("register sounds", "register " + soundID + " success");
}
}
Loading

0 comments on commit 2e2dceb

Please sign in to comment.