Skip to content

Commit

Permalink
Merge pull request #61 from bl4ckscor3/1.20
Browse files Browse the repository at this point in the history
Update to 1.20(.1)
  • Loading branch information
realmayus authored Dec 7, 2023
2 parents b4eae2a + 53c1999 commit 09334dd
Show file tree
Hide file tree
Showing 21 changed files with 218 additions and 254 deletions.
37 changes: 18 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0,6.2)', changing: true
}
}

Expand All @@ -18,7 +18,6 @@ repositories {
}
}


apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
Expand All @@ -27,8 +26,11 @@ apply plugin: 'maven-publish'
version = '2.2.1'
group = 'realmayus.youmatter' // http://maven.apache.org/guides/mini/guide-naming-conventions.html

base {
archivesName = 'youmatter-1.20.1'
}

java {
archivesBaseName = 'youmatter-1.19.4'
toolchain.languageVersion = JavaLanguageVersion.of(17)
}

Expand All @@ -38,8 +40,9 @@ minecraft {
// stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'official', version: '1.19.4'
mappings channel: 'official', version: '1.20.1'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
copyIdeResources = true

// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
Expand Down Expand Up @@ -100,7 +103,7 @@ dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.19.4-45.0.9'
minecraft 'net.minecraftforge:forge:1.20.1-47.0.3'

// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
Expand All @@ -126,24 +129,30 @@ dependencies {
// implementation fg.deobf("curse.maven:tankdep-638508:4438326")
// implementation fg.deobf("curse.maven:tankdep2-320926:4183340")
// implementation fg.deobf("curse.maven:mekanism-268560:4385637")
// implementation fg.deobf("curse.maven:jei-238222:4434399")
implementation fg.deobf("curse.maven:jei-238222:4585879")
implementation fg.deobf("curse.maven:useful-machinery-355129:4587036")
implementation fg.deobf("curse.maven:useful-foundation-355245:4585346")
implementation fg.deobf("curse.maven:themcbroslib-387586:4584364")
}

// Example for how to get properties into the manifest for reading by the runtime..
jar {
tasks.named('jar', Jar).configure {
manifest {
attributes([
"Specification-Title": "youmatter",
"Specification-Vendor": "realmayus",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"realmayus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"Implementation-Vendor": "realmayus"
])
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}

// Example configuration to allow publishing using the maven-publish task
// we define a custom artifact that is sourced from the reobfJar output task
// and then declare that to be published
Expand All @@ -164,14 +173,4 @@ publishing {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
build.dependsOn sourcesJar

artifacts {
archives sourcesJar
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
27 changes: 12 additions & 15 deletions src/main/java/realmayus/youmatter/ModContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.FlowingFluid;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.common.extensions.IForgeMenuType;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fluids.FluidType;
import net.minecraftforge.fluids.ForgeFlowingFluid;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
Expand Down Expand Up @@ -51,36 +49,36 @@ public class ModContent {
public static final DeferredRegister<FluidType> FLUID_TYPES = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, YouMatter.MODID);

public static final RegistryObject<ScannerBlock> SCANNER_BLOCK = BLOCKS.register("scanner", () -> new ScannerBlock());
public static final RegistryObject<MenuType<ScannerMenu>> SCANNER_MENU = MENU_TYPES.register("scanner", () -> IForgeMenuType.create((windowId, inv, data) -> new ScannerMenu(windowId, inv.player.level, data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<MenuType<ScannerMenu>> SCANNER_MENU = MENU_TYPES.register("scanner", () -> IForgeMenuType.create((windowId, inv, data) -> new ScannerMenu(windowId, inv.player.level(), data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<BlockEntityType<ScannerBlockEntity>> SCANNER_BLOCK_ENTITY = BLOCK_ENTITY_TYPES.register("scanner", () -> BlockEntityType.Builder.of(ScannerBlockEntity::new, SCANNER_BLOCK.get()).build(null));
public static final RegistryObject<BlockItem> SCANNER_BLOCK_ITEM = ITEMS.register("scanner", () -> new BlockItem(SCANNER_BLOCK.get(), new Item.Properties()));

public static final RegistryObject<EncoderBlock> ENCODER_BLOCK = BLOCKS.register("encoder", () -> new EncoderBlock());
public static final RegistryObject<MenuType<EncoderMenu>> ENCODER_MENU = MENU_TYPES.register("encoder", () -> IForgeMenuType.create((windowId, inv, data) -> new EncoderMenu(windowId, inv.player.level, data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<MenuType<EncoderMenu>> ENCODER_MENU = MENU_TYPES.register("encoder", () -> IForgeMenuType.create((windowId, inv, data) -> new EncoderMenu(windowId, inv.player.level(), data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<BlockEntityType<EncoderBlockEntity>> ENCODER_BLOCK_ENTITY = BLOCK_ENTITY_TYPES.register("encoder", () -> BlockEntityType.Builder.of(EncoderBlockEntity::new, ENCODER_BLOCK.get()).build(null));
public static final RegistryObject<BlockItem> ENCODER_BLOCK_ITEM = ITEMS.register("encoder", () -> new BlockItem(ENCODER_BLOCK.get(), new Item.Properties()));

public static final RegistryObject<CreatorBlock> CREATOR_BLOCK = BLOCKS.register("creator", () -> new CreatorBlock());
public static final RegistryObject<MenuType<CreatorMenu>> CREATOR_MENU = MENU_TYPES.register("creator", () -> IForgeMenuType.create((windowId, inv, data) -> new CreatorMenu(windowId, inv.player.level, data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<MenuType<CreatorMenu>> CREATOR_MENU = MENU_TYPES.register("creator", () -> IForgeMenuType.create((windowId, inv, data) -> new CreatorMenu(windowId, inv.player.level(), data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<BlockEntityType<CreatorBlockEntity>> CREATOR_BLOCK_ENTITY = BLOCK_ENTITY_TYPES.register("creator", () -> BlockEntityType.Builder.of(CreatorBlockEntity::new, CREATOR_BLOCK.get()).build(null));
public static final RegistryObject<BlockItem> CREATOR_BLOCK_ITEM = ITEMS.register("creator", () -> new BlockItem(CREATOR_BLOCK.get(), new Item.Properties()));

public static final RegistryObject<ReplicatorBlock> REPLICATOR_BLOCK = BLOCKS.register("replicator", () -> new ReplicatorBlock());
public static final RegistryObject<MenuType<ReplicatorMenu>> REPLICATOR_MENU = MENU_TYPES.register("replicator", () -> IForgeMenuType.create((windowId, inv, data) -> new ReplicatorMenu(windowId, inv.player.level, data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<MenuType<ReplicatorMenu>> REPLICATOR_MENU = MENU_TYPES.register("replicator", () -> IForgeMenuType.create((windowId, inv, data) -> new ReplicatorMenu(windowId, inv.player.level(), data.readBlockPos(), inv, inv.player)));
public static final RegistryObject<BlockEntityType<ReplicatorBlockEntity>> REPLICATOR_BLOCK_ENTITY = BLOCK_ENTITY_TYPES.register("replicator", () -> BlockEntityType.Builder.of(ReplicatorBlockEntity::new, REPLICATOR_BLOCK.get()).build(null));
public static final RegistryObject<BlockItem> REPLICATOR_BLOCK_ITEM = ITEMS.register("replicator", () -> new BlockItem(REPLICATOR_BLOCK.get(), new Item.Properties()));

public static final RegistryObject<FluidType> STABILIZER_TYPE = FLUID_TYPES.register("stabilizer", () -> new StabilizerFluidType());
public static final RegistryObject<FlowingFluid> STABILIZER = FLUIDS.register("stabilizer", () -> new ForgeFlowingFluid.Source(ModContent.STABILIZER_PROPERIES));
public static final RegistryObject<FlowingFluid> STABILIZER_FLOWING = FLUIDS.register("stabilizer_flowing", () -> new ForgeFlowingFluid.Flowing(ModContent.STABILIZER_PROPERIES));
public static final RegistryObject<StabilizerFluidBlock> STABILIZER_FLUID_BLOCK = BLOCKS.register("stabilizer_fluid_block", () -> new StabilizerFluidBlock(STABILIZER, BlockBehaviour.Properties.of(Material.LAVA).noCollission().strength(1.0F).noLootTable()));
public static final RegistryObject<StabilizerFluidBlock> STABILIZER_FLUID_BLOCK = BLOCKS.register("stabilizer_fluid_block", () -> new StabilizerFluidBlock(STABILIZER, BlockBehaviour.Properties.of().noCollission().strength(1.0F).noLootTable()));
public static final RegistryObject<Item> STABILIZER_BUCKET = ITEMS.register("stabilizer_bucket", () -> new BucketItem(STABILIZER, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)));
public static final ForgeFlowingFluid.Properties STABILIZER_PROPERIES = new ForgeFlowingFluid.Properties(STABILIZER_TYPE, STABILIZER, STABILIZER_FLOWING).bucket(STABILIZER_BUCKET).block(STABILIZER_FLUID_BLOCK);

public static final RegistryObject<FluidType> UMATTER_TYPE = FLUID_TYPES.register("umatter", () -> new UMatterFluidType());
public static final RegistryObject<FlowingFluid> UMATTER = FLUIDS.register("umatter", () -> new ForgeFlowingFluid.Source(ModContent.UMATTER_PROPERTIES));
public static final RegistryObject<FlowingFluid> UMATTER_FLOWING = FLUIDS.register("umatter_flowing", () -> new ForgeFlowingFluid.Flowing(ModContent.UMATTER_PROPERTIES));
public static final RegistryObject<StabilizerFluidBlock> UMATTER_FLUID_BLOCK = BLOCKS.register("umatter_fluid_block", () -> new StabilizerFluidBlock(UMATTER, BlockBehaviour.Properties.of(Material.LAVA).noCollission().strength(1.0F).noLootTable()));
public static final RegistryObject<StabilizerFluidBlock> UMATTER_FLUID_BLOCK = BLOCKS.register("umatter_fluid_block", () -> new StabilizerFluidBlock(UMATTER, BlockBehaviour.Properties.of().noCollission().strength(1.0F).noLootTable()));
public static final RegistryObject<Item> UMATTER_BUCKET = ITEMS.register("umatter_bucket", () -> new BucketItem(UMATTER, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)));
public static final ForgeFlowingFluid.Properties UMATTER_PROPERTIES = new ForgeFlowingFluid.Properties(UMATTER_TYPE, UMATTER, UMATTER_FLOWING).bucket(UMATTER_BUCKET).block(UMATTER_FLUID_BLOCK);

Expand All @@ -90,9 +88,8 @@ public class ModContent {
public static final RegistryObject<ComputeModuleItem> COMPUTE_MODULE_ITEM = ITEMS.register("compute_module", () -> new ComputeModuleItem());
public static final RegistryObject<TransistorItem> TRANSISTOR_ITEM = ITEMS.register("transistor", () -> new TransistorItem());
public static final RegistryObject<TransistorRawItem> TRANSISTOR_RAW_ITEM = ITEMS.register("transistor_raw", () -> new TransistorRawItem());

public static void init() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();

public static void init(IEventBus modEventBus) {
BLOCKS.register(modEventBus);
MENU_TYPES.register(modEventBus);
BLOCK_ENTITY_TYPES.register(modEventBus);
Expand Down
Loading

0 comments on commit 09334dd

Please sign in to comment.