Skip to content

Commit

Permalink
update to mc 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveG committed Dec 2, 2021
1 parent 723e5ee commit 8d9ae6e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 34 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ version = '1.0'
group = 'me.recursiveg' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'Mc122477Fix'

// Mojang ships Java 16 to end users in 1.17+ instead of Java 8 in 1.16 or lower, so your mod should target Java 16.
java.toolchain.languageVersion = JavaLanguageVersion.of(16)
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
Expand All @@ -33,7 +33,7 @@ minecraft {
//
// 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.17.1'
mappings channel: 'official', version: '1.18'

// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Currently, this location cannot be changed from the default.

Expand Down Expand Up @@ -128,7 +128,7 @@ dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its 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.17.1-37.0.2'
minecraft 'net.minecraftforge:forge:1.18-38.0.8'

// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
Expand All @@ -152,8 +152,7 @@ jar {
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "recursiveg",
// "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
"Implementation-Vendor" : "recursiveg"
])
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-7.2-20210702220150+0000-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions src/main/java/me/recursiveg/Mc122477Fix.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.client.event.ScreenEvent;
import net.minecraftforge.client.event.ScreenOpenEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
Expand All @@ -17,12 +17,12 @@ public Mc122477Fix() {

long lastScreenOpenTime = 0;
@SubscribeEvent
public void onScreenOpen(GuiOpenEvent ev) {
if (ev.getGui() instanceof ChatScreen || ev.getGui() instanceof CreativeModeInventoryScreen) lastScreenOpenTime = System.currentTimeMillis();
public void onScreenOpen(ScreenOpenEvent ev) {
if (ev.getScreen() instanceof ChatScreen || ev.getScreen() instanceof CreativeModeInventoryScreen) lastScreenOpenTime = System.currentTimeMillis();
}

@SubscribeEvent
public void onCharTyped(GuiScreenEvent.KeyboardCharTypedEvent.Pre ev) {
public void onCharTyped(ScreenEvent.KeyboardCharTypedEvent.Pre ev) {
if (System.currentTimeMillis() - lastScreenOpenTime < 50) ev.setCanceled(true);
}
}
21 changes: 1 addition & 20 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[37,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
loaderVersion="[38,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# A URL to refer people to when problems occur with this mod
issueTrackerURL="https://github.com/RecursiveG/Mc122477Fix/issues" #optional
# A list of mods - how many allowed here is determined by the individual mod loader
Expand All @@ -28,22 +28,3 @@ authors="RecursiveG" #optional
description='''
Fix MC-122477, which causes double-typing 't' or '/' on Linux.
'''
# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
[[dependencies.mc122477fix]] #optional
# the modid of the dependency
modId="forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory
# The version range of the dependency
versionRange="[37,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER
side="BOTH"
# Here's another dependency
[[dependencies.mc122477fix]]
modId="minecraft"
mandatory=true
versionRange="[1.17.1,1.18)"
ordering="NONE"
side="BOTH"
3 changes: 1 addition & 2 deletions src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"pack": {
"description": "examplemod resources",
"pack_format": 6,
"_comment": "A pack_format of 6 requires json lang files and some texture changes from 1.16.2. Note: we require v6 pack meta for all mods."
"pack_format": 8
}
}

0 comments on commit 8d9ae6e

Please sign in to comment.