Skip to content

Commit 931df81

Browse files
committed
Update to 1.19
1 parent fdc3047 commit 931df81

File tree

21 files changed

+122
-130
lines changed

21 files changed

+122
-130
lines changed

build.gradle

Lines changed: 35 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,16 @@
1-
buildscript {
2-
repositories {
3-
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
4-
maven { url = 'https://maven.minecraftforge.net' }
5-
mavenCentral()
6-
}
7-
dependencies {
8-
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
9-
classpath 'org.spongepowered:mixingradle:0.7.+'
10-
}
11-
}
12-
131
plugins {
14-
id "com.jfrog.bintray" version "1.8.1"
2+
id 'maven-publish'
3+
id 'net.minecraftforge.gradle' version '5.1.+'
154
}
165

17-
apply plugin: 'net.minecraftforge.gradle'
18-
apply plugin: 'idea'
19-
apply plugin: 'maven-publish'
20-
apply plugin: 'org.spongepowered.mixin'
21-
226
version = "${minecraft_version}-${mod_version}"
237
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
248
archivesBaseName = "StorageDrawers"
259

2610
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
2711
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
2812

29-
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
13+
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
3014
minecraft {
3115
// The mappings can be changed at any time and must be in the following format.
3216
// Channel: Version:
@@ -61,6 +45,9 @@ minecraft {
6145
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
6246
property 'forge.logging.console.level', 'debug'
6347

48+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
49+
property 'forge.enabledGameTestNamespaces', 'storagedrawers'
50+
6451
mods {
6552
storagedrawers {
6653
source sourceSets.main
@@ -83,6 +70,28 @@ minecraft {
8370
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
8471
property 'forge.logging.console.level', 'debug'
8572

73+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
74+
property 'forge.enabledGameTestNamespaces', 'storagedrawers'
75+
76+
mods {
77+
storagedrawers {
78+
source sourceSets.main
79+
}
80+
}
81+
}
82+
83+
// This run config launches GameTestServer and runs all registered gametests, then exits.
84+
// By default, the server will crash when no gametests are provided.
85+
// The gametest system is also enabled by default for other run configs under the /test command.
86+
gameTestServer {
87+
workingDirectory project.file('run')
88+
89+
property 'forge.logging.markers', 'REGISTRIES'
90+
91+
property 'forge.logging.console.level', 'debug'
92+
93+
property 'forge.enabledGameTestNamespaces', 'storagedrawers'
94+
8695
mods {
8796
storagedrawers {
8897
source sourceSets.main
@@ -156,8 +165,8 @@ repositories {
156165
dependencies {
157166
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
158167

159-
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}:api")
160-
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}:${jei_version}")
168+
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
169+
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
161170

162171
implementation fg.deobf("curse.maven:the-one-probe-245211:${top_id}")
163172
implementation fg.deobf("curse.maven:jade-324717:${jade_id}")
@@ -189,18 +198,14 @@ jar {
189198
manifest {
190199
attributes([
191200
"Specification-Title": "storagedrawers",
192-
"Specification-Vendor": "Justin Aquadro",
201+
"Specification-Vendor": "Texelsaur",
193202
"Specification-Version": "1", // We are version 1 of ourselves
194203
"Implementation-Title": project.name,
195204
"Implementation-Version": project.jar.archiveVersion,
196-
"Implementation-Vendor" :"Justin Aquadro",
205+
"Implementation-Vendor" :"Texelsaur",
197206
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
198207
])
199208
}
200-
//include "com/jaquadro/minecraft/storagedrawers/**"
201-
//include "assets/**"
202-
//include "mcmod.info"
203-
//include "pack.mcmeta"
204209
}
205210

206211
jar.finalizedBy('reobfJar')
@@ -251,19 +256,7 @@ publishing.publications {
251256
}
252257
}
253258

254-
bintrayUpload.dependsOn build
255-
256-
bintray {
257-
user = System.getenv('BINTRAY_USER')
258-
key = System.getenv('BINTRAY_KEY')
259-
publications = ['StorageDrawers']
260-
publish = true
261-
pkg {
262-
repo = 'dev'
263-
name = 'storagedrawers'
264-
version {
265-
name = project.jar.archiveVersion
266-
released = new Date()
267-
}
268-
}
259+
tasks.withType(JavaCompile).configureEach {
260+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
269261
}
262+

gradle.properties

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
org.gradle.jvmargs=-Xmx3G
22

3-
minecraft_base_version=1.18
4-
minecraft_version=1.18.2
5-
forge_version=40.0.15
6-
loader_version=38
7-
mod_version=10.2.0
3+
minecraft_base_version=1.19
4+
minecraft_version=1.19
5+
forge_version=41.0.63
6+
loader_version=41
7+
mod_version=11.0.0
88

99
# Mod dependency versions
10-
jei_version=9.5.0.132
11-
jade_id=3681449
10+
jei_version=11.0.0.206
11+
jade_id=3834997
1212
# mt_version=3.0.24.81
1313
# crafttweaker_version=7.0.0.45
14-
top_id=3671753
14+
top_id=3838419
1515

1616
# This determines the minimum version of forge required
1717
# Only Change when mod need access to a feature in forge that is not available in earlier versions
18-
min_forge_version=40.0.15
18+
min_forge_version=41.0.63

gradle/wrapper/gradle-wrapper.jar

285 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015-2021 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
3232
# Busybox and similar reduced shells will NOT work, because this script
3333
# requires all of these POSIX shell features:
3434
# * functions;
35-
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36-
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37-
# * compound commands having a testable exit status, especially «case»;
38-
# * various built-in commands including «command», «set», and «ulimit».
35+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37+
# * compound commands having a testable exit status, especially «case»;
38+
# * various built-in commands including «command», «set», and «ulimit».
3939
#
4040
# Important for patching:
4141
#

settings.gradle

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
rootProject.name = "StorageDrawers-${minecraft_base_version}"
2-
3-
//include '..:Chameleon'
4-
//project(':..:Chameleon').name = "Chameleon-${minecraft_base_version}"
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
maven { url = 'https://maven.minecraftforge.net/' }
5+
}
6+
}

src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import net.minecraft.core.BlockPos;
1010
import net.minecraft.core.Direction;
1111
import net.minecraft.server.level.ServerLevel;
12+
import net.minecraft.util.RandomSource;
1213
import net.minecraft.world.InteractionHand;
1314
import net.minecraft.world.InteractionResult;
1415
import net.minecraft.world.entity.player.Player;
@@ -26,7 +27,6 @@
2627
import org.jetbrains.annotations.NotNull;
2728

2829
import java.util.EnumSet;
29-
import java.util.Random;
3030

3131
public class BlockController extends HorizontalDirectionalBlock implements INetworked, EntityBlock
3232
{
@@ -110,7 +110,7 @@ public void toggle (@NotNull Level level, @NotNull BlockPos pos, @NotNull Player
110110
}
111111

112112
@Override
113-
public void tick (@NotNull BlockState state, @NotNull ServerLevel world, @NotNull BlockPos pos, @NotNull Random rand) {
113+
public void tick (@NotNull BlockState state, @NotNull ServerLevel world, @NotNull BlockPos pos, @NotNull RandomSource rand) {
114114
if (world.isClientSide)
115115
return;
116116

src/main/java/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import net.minecraft.core.Direction;
2121
import net.minecraft.nbt.CompoundTag;
2222
import net.minecraft.network.chat.Component;
23-
import net.minecraft.network.chat.TranslatableComponent;
2423
import net.minecraft.server.level.ServerPlayer;
2524
import net.minecraft.sounds.SoundEvents;
2625
import net.minecraft.sounds.SoundSource;
@@ -220,14 +219,14 @@ public InteractionResult use (@NotNull BlockState state, @NotNull Level level, @
220219
if (item.getItem() instanceof ItemUpgrade) {
221220
if (!blockEntityDrawers.upgrades().canAddUpgrade(item)) {
222221
if (!level.isClientSide)
223-
player.displayClientMessage(new TranslatableComponent("message.storagedrawers.cannot_add_upgrade"), true);
222+
player.displayClientMessage(Component.translatable("message.storagedrawers.cannot_add_upgrade"), true);
224223

225224
return InteractionResult.PASS;
226225
}
227226

228227
if (!blockEntityDrawers.upgrades().addUpgrade(item)) {
229228
if (!level.isClientSide)
230-
player.displayClientMessage(new TranslatableComponent("message.storagedrawers.max_upgrades"), true);
229+
player.displayClientMessage(Component.translatable("message.storagedrawers.max_upgrades"), true);
231230

232231
return InteractionResult.PASS;
233232
}
@@ -259,7 +258,7 @@ else if (StorageDrawers.config.cache.enableDrawerUI) {
259258
@Override
260259
@NotNull
261260
public Component getDisplayName () {
262-
return new TranslatableComponent(getDescriptionId());
261+
return Component.translatable(getDescriptionId());
263262
}
264263

265264
@Nullable

src/main/java/com/jaquadro/minecraft/storagedrawers/client/model/BasicDrawerModel.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import net.minecraft.core.Direction;
2424
import net.minecraft.resources.ResourceLocation;
2525
import net.minecraft.server.packs.resources.Resource;
26+
import net.minecraft.util.RandomSource;
2627
import net.minecraft.world.level.block.Block;
2728
import net.minecraft.world.level.block.state.BlockState;
2829
import net.minecraft.world.phys.AABB;
@@ -46,7 +47,6 @@
4647
import java.util.HashMap;
4748
import java.util.List;
4849
import java.util.Map;
49-
import java.util.Random;
5050
import java.util.function.Function;
5151

5252
public final class BasicDrawerModel
@@ -149,14 +149,13 @@ private static BlockModel getBlockModel (ResourceLocation location) {
149149
Resource iresource = null;
150150
Reader reader = null;
151151
try {
152-
iresource = Minecraft.getInstance().getResourceManager().getResource(location);
153-
reader = new InputStreamReader(iresource.getInputStream(), StandardCharsets.UTF_8);
152+
iresource = Minecraft.getInstance().getResourceManager().getResourceOrThrow(location);
153+
reader = new InputStreamReader(iresource.open(), StandardCharsets.UTF_8);
154154
return BlockModel.fromStream(reader);
155155
} catch (IOException e) {
156156
return null;
157157
} finally {
158158
IOUtils.closeQuietly(reader);
159-
IOUtils.closeQuietly((Closeable)iresource);
160159
}
161160
}
162161

@@ -302,7 +301,7 @@ public MergedModel (BakedModel mainModel, BakedModel... models) {
302301

303302
@Override
304303
@NotNull
305-
public List<BakedQuad> getQuads (@Nullable BlockState state, @Nullable Direction side, @NotNull Random rand) {
304+
public List<BakedQuad> getQuads (@Nullable BlockState state, @Nullable Direction side, @NotNull RandomSource rand) {
306305
List<BakedQuad> quads = Lists.newArrayList();
307306
quads.addAll(mainModel.getQuads(state, side, rand));
308307
for (BakedModel model : models)
@@ -389,7 +388,7 @@ public boolean usesBlockLight () {
389388

390389
@NotNull
391390
@Override
392-
public List<BakedQuad> getQuads (@Nullable BlockState state, @Nullable Direction side, @NotNull Random rand, @NotNull IModelData extraData) {
391+
public List<BakedQuad> getQuads (@Nullable BlockState state, @Nullable Direction side, @NotNull RandomSource rand, @NotNull IModelData extraData) {
393392
List<BakedQuad> quads = Lists.newArrayList();
394393
quads.addAll(mainModel.getQuads(state, side, rand, extraData));
395394

src/main/java/com/jaquadro/minecraft/storagedrawers/client/model/ProxyBuilderModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
77
import net.minecraft.client.resources.model.BakedModel;
88
import net.minecraft.core.Direction;
9+
import net.minecraft.util.RandomSource;
910
import net.minecraft.world.level.block.state.BlockState;
1011
import org.jetbrains.annotations.NotNull;
1112

1213
import java.util.ArrayList;
1314
import java.util.List;
14-
import java.util.Random;
1515

1616
public abstract class ProxyBuilderModel implements BakedModel
1717
{
@@ -33,7 +33,7 @@ public ProxyBuilderModel (BakedModel parent) {
3333

3434
@Override
3535
@NotNull
36-
public List<BakedQuad> getQuads (BlockState state, Direction side, @NotNull Random rand) {
36+
public List<BakedQuad> getQuads (BlockState state, Direction side, @NotNull RandomSource rand) {
3737
if (proxy == null || stateCache != state)
3838
setProxy(state);
3939

0 commit comments

Comments
 (0)