Skip to content
This repository was archived by the owner on Jul 16, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6cc705f
wip
shedaniel May 14, 2020
32ce0c6
thing
shedaniel May 14, 2020
e276e04
Port to 1.16.1
shedaniel Jul 26, 2020
4b7bbf4
Fix enchants and luck
shedaniel Jul 26, 2020
69afcfa
Fix #36
shedaniel Jul 27, 2020
201a5ac
Fix #38
shedaniel Jul 28, 2020
79973ae
Updated gradle settings
thakyZ Sep 3, 2020
3c7726e
Ported to 1.16.2
thakyZ Sep 3, 2020
7c8ca1b
Merge branch '1.16.2' into 1.16
shedaniel Sep 8, 2020
12a3787
Full 1.16.2 update with better texture
shedaniel Sep 9, 2020
967a775
Set missing mining level for diamond
dragonmaus Oct 9, 2020
f0c869c
Initial 1.17.1
PTOM76 Jul 15, 2022
236ae52
Initial 1.17.1
PTOM76 Jul 15, 2022
c10b90a
I'm not sure, so I will stop supporting REI.
PTOM76 Jul 15, 2022
537c7db
fix
PTOM76 Jul 15, 2022
f46b4fd
Fix REI
PTOM76 Jul 16, 2022
225a1fb
tweaked strength
PTOM76 Jul 16, 2022
794aaef
Merge branch '1.16' of https://github.com/dragonmaus/Materialisation …
PTOM76 Jul 16, 2022
c258bdd
fix
PTOM76 Jul 16, 2022
4d9a86c
Fix access widener
PTOM76 Jul 16, 2022
4643275
Initial 1.19
PTOM76 Jul 16, 2022
de2d50f
Port to 1.18.
PTOM76 Jul 16, 2022
ab5ebbf
Add Copper, Flint, Netherite Materials
PTOM76 Jul 16, 2022
bd4e759
Fix mining speed
PTOM76 Jul 16, 2022
5c78819
Fix mining speed
PTOM76 Jul 17, 2022
2331f09
Fix config
PTOM76 Jul 17, 2022
858dfbf
Fix config
PTOM76 Jul 17, 2022
9509548
Fix config
PTOM76 Jul 21, 2022
54ec09b
Fix config
PTOM76 Jul 21, 2022
8db7f61
Arrp 0.5.5
PTOM76 Jul 21, 2022
81ffbe1
Fixed MixinPlugin
PTOM76 Jul 21, 2022
7bb8713
Fixed crush bug
PTOM76 Jul 22, 2022
e16871d
Fixed crush bug
PTOM76 Jul 22, 2022
b8fd4bf
Merge branch '1.18.2' of https://github.com/PTOM76/Materialisation in…
PTOM76 Jul 22, 2022
5bfed5b
Fixed crush bug
PTOM76 Jul 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 84 additions & 44 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,63 +1,103 @@
plugins {
id 'fabric-loom' version '0.4.3'
id "fabric-loom" version "0.10-SNAPSHOT"
id 'maven-publish'
}

archivesBaseName = "Materialisation"
version = "2.6"
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16

def minecraftVersion = "1.15.2"
def yarnBuild = "1"
def cr_version = "1.4.1+1.14.4"
def netherthings_version = "1.2.0"
group = project.maven_group
version = project.mod_version
archivesBaseName = project.archives_base_name

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
repositories {
maven { url 'https://raw.githubusercontent.com/Devan-Kerman/Devan-Repo/master/' }
maven { url 'https://jitpack.io' }
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases" }
maven { url "https://storage.googleapis.com/devan-maven/" }
mavenLocal()
}

loom {
accessWidenerPath = file("src/main/resources/materialisation.accesswidener")
}

dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"

minecraft {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}") {
exclude(group: "net.fabricmc.fabric-api")
}
include("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}")
compileOnly("com.google.code.findbugs:jsr305:3.0.2") { transitive = false }
modImplementation("com.terraformersmc:modmenu:${project.modmenu}")
modImplementation("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei}")
modImplementation group: 'net.devtech', name: 'arrp', version: '0.2.6'
include group: 'net.devtech', name: 'arrp', version: '0.2.6'
}

processResources {
inputs.property "version", project.version
inputs.property "name", project.display_name
filesMatching('fabric.mod.json') {
expand 'version': project.version
expand 'name': project.display_name
}
inputs.property "version", project.version
}

repositories {
jcenter()
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 16
if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion
}
}

dependencies {
minecraft "com.mojang:minecraft:${minecraftVersion}"
mappings "net.fabricmc:yarn:${minecraftVersion}+build.${yarnBuild}:v2"
implementation "net.fabricmc:yarn:${minecraftVersion}+build.${yarnBuild}"
modImplementation("net.fabricmc.fabric-api:fabric-api:0.10.8+build.310-1.15") {
force = true
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
modImplementation "net.fabricmc:fabric-loader:0.7.8+build.184"
modImplementation("me.shedaniel.cloth:config-2:2.13.4") {
exclude(group: "net.fabricmc.fabric-api")
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
include("me.shedaniel.cloth:config-2:2.13.4")
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
modImplementation("me.shedaniel:RoughlyEnoughItems:3.6.14") {
exclude(group: "net.fabricmc.fabric-api")

// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
// modRuntime ("io.github.cottonmc:cotton-resources:${cr_version}") {
// exclude group: "net.fabricmc.fabric-api"
// exclude module: "modmenu"
// exclude module: "RoughlyEnoughItems"
// }
// modRuntime "nether-things:netherthings:${netherthings_version}"
// modRuntime "fabric-more-enchantments:MoEnchantments:1.5.9"
// modRuntime("me.sargunvohra.mcmods:auto-config:1.1.2+mc1.14.1") {
// transitive = false
// }

// OptiFabric
// modRuntime "optifabric:optifabric:0.4.0"
// modRuntime 'org.zeroturnaround:zt-zip:1.13'
// modRuntime('net.fabricmc:stitch:0.2.1.61') {
// transitive = false
// }
// modRuntime 'com.github.Chocohead:Fabric-ASM:c4ad22d'
}
}
18 changes: 17 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
#Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.jvmargs=-Xmx3G

maven_group=me.shedaniel
archives_base_name=materialisation
display_name=Materialisation
mod_version=3.0.10

minecraft_version=1.17.1
yarn_mappings=1.17.1+build.65
loader_version=0.13.3

#Fabric api
fabric_version=0.46.1+1.17

cloth_config=5.3.58
modmenu=2.0.14
rei=6.5.433
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ pluginManagement {
gradlePluginPortal()
}
}

rootProject.name = "Materialisation"
28 changes: 13 additions & 15 deletions src/main/java/me/shedaniel/materialisation/Materialisation.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
import me.shedaniel.materialisation.blocks.MaterialisingTableBlock;
import me.shedaniel.materialisation.config.ConfigHelper;
import me.shedaniel.materialisation.config.MaterialisationConfig;
import me.shedaniel.materialisation.containers.MaterialPreparerContainer;
import me.shedaniel.materialisation.containers.MaterialisingTableContainer;
import me.shedaniel.materialisation.gui.MaterialPreparerScreenHandler;
import me.shedaniel.materialisation.gui.MaterialisingTableScreenHandler;
import me.shedaniel.materialisation.items.*;
import me.shedaniel.materialisation.utils.ResettableSimpleRegistry;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.container.ContainerProviderRegistry;
import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
import net.minecraft.SharedConstants;
import net.minecraft.block.Block;
import net.minecraft.container.BlockContext;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.apache.logging.log4j.Level;
Expand All @@ -27,13 +27,16 @@
import java.lang.reflect.Field;
import java.util.Optional;

@SuppressWarnings("unused")
public class Materialisation implements ModInitializer {

public static final Logger LOGGER = LogManager.getLogger();
public static final Block MATERIALISING_TABLE = new MaterialisingTableBlock();
public static final Block MATERIAL_PREPARER = new MaterialPreparerBlock();
public static final Identifier MATERIAL_PREPARER_CONTAINER = new Identifier(ModReference.MOD_ID, "material_preparer");
public static final Identifier MATERIALISING_TABLE_CONTAINER = new Identifier(ModReference.MOD_ID, "materialising_table");
public static final ScreenHandlerType<MaterialPreparerScreenHandler> MATERIAL_PREPARER_SCREEN_HANDLER = ScreenHandlerRegistry.registerSimple(Materialisation.MATERIAL_PREPARER_CONTAINER, MaterialPreparerScreenHandler::new);
public static final ScreenHandlerType<MaterialisingTableScreenHandler> MATERIALISING_TABLE_SCREEN_HANDLER = ScreenHandlerRegistry.registerSimple(Materialisation.MATERIALISING_TABLE_CONTAINER, MaterialisingTableScreenHandler::new);
public static final Identifier MATERIALISING_TABLE_RENAME = new Identifier(ModReference.MOD_ID, "materialising_table_rename");
public static final Identifier MATERIALISING_TABLE_PLAY_SOUND = new Identifier(ModReference.MOD_ID, "materialising_table_play_sound");
public static final Item MATERIALISED_PICKAXE = new MaterialisedPickaxeItem(new Item.Settings());
Expand All @@ -57,9 +60,9 @@ public class Materialisation implements ModInitializer {
public static final Item SWORD_BLADE_PATTERN = new PatternItem(new Item.Settings().group(ItemGroup.MATERIALS));
public static final Item HAMMER_HEAD_PATTERN = new PatternItem(new Item.Settings().group(ItemGroup.MATERIALS));
public static final Item MEGAAXE_HEAD_PATTERN = new PatternItem(new Item.Settings().group(ItemGroup.MATERIALS));
public static final Registry<Modifier> MODIFIERS = new ResettableSimpleRegistry<>();
public static final Registry<Modifier> MODIFIERS = new ResettableSimpleRegistry<>("modifiers");
public static MaterialisationConfig config;

public static <T> Optional<T> getReflectionField(Object parent, Class<T> clazz, int index) {
try {
Field field = parent.getClass().getDeclaredFields()[index];
Expand All @@ -74,17 +77,12 @@ public static <T> Optional<T> getReflectionField(Object parent, Class<T> clazz,

@Override
public void onInitialize() {
MaterialisationModifierMaterials.register();
registerBlock("materialising_table", MATERIALISING_TABLE, ItemGroup.DECORATIONS);
registerBlock("material_preparer", MATERIAL_PREPARER, ItemGroup.DECORATIONS);
ContainerProviderRegistry.INSTANCE.registerFactory(MATERIALISING_TABLE_CONTAINER, (syncId, identifier, playerEntity, packetByteBuf) -> {
return new MaterialisingTableContainer(syncId, playerEntity.inventory, BlockContext.create(playerEntity.world, packetByteBuf.readBlockPos()));
});
ContainerProviderRegistry.INSTANCE.registerFactory(MATERIAL_PREPARER_CONTAINER, (syncId, identifier, playerEntity, packetByteBuf) -> {
return new MaterialPreparerContainer(syncId, playerEntity.inventory, BlockContext.create(playerEntity.world, packetByteBuf.readBlockPos()));
});
ServerSidePacketRegistry.INSTANCE.register(MATERIALISING_TABLE_RENAME, (packetContext, packetByteBuf) -> {
if (packetContext.getPlayer().container instanceof MaterialisingTableContainer) {
MaterialisingTableContainer container = (MaterialisingTableContainer) packetContext.getPlayer().container;
if (packetContext.getPlayer().currentScreenHandler instanceof MaterialisingTableScreenHandler) {
MaterialisingTableScreenHandler container = (MaterialisingTableScreenHandler)packetContext.getPlayer().currentScreenHandler;
String string_1 = SharedConstants.stripInvalidChars(packetByteBuf.readString(32767));
if (string_1.length() <= 35)
container.setNewItemName(string_1);
Expand Down Expand Up @@ -123,6 +121,7 @@ private void registerBlock(String name, Block block) {
registerBlock(name, block, new Item.Settings());
}

@SuppressWarnings("SameParameterValue")
private void registerBlock(String name, Block block, ItemGroup group) {
registerBlock(name, block, new Item.Settings().group(group));
}
Expand All @@ -135,5 +134,4 @@ private void registerBlock(String name, Block block, Item.Settings settings) {
private void registerItem(String name, Item item) {
Registry.register(Registry.ITEM, new Identifier(ModReference.MOD_ID, name), item);
}

}
Loading