Skip to content

Commit

Permalink
Merge pull request #79 from cc-tweaked/mc-1.18.x/1.18.2
Browse files Browse the repository at this point in the history
update stable to 1.18.2
  • Loading branch information
Merith-TK authored Mar 29, 2022
2 parents 4bf0ad7 + d8bb05f commit 4ee94f4
Show file tree
Hide file tree
Showing 31 changed files with 445 additions and 361 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
release:
types:
- published
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v2
with:
path: |
~/.gradle/loom-cache
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build and publish with Gradle
run: ./gradlew build publish
env:
CURSEFORGE: ${{ secrets.CURSEFORGE }}
MODRINTH: ${{ secrets.MODRINTH }}
CHANGELOG: ${{ github.event.release.body }}
- name: Upload GitHub release
uses: AButler/[email protected]
with:
files: 'build/libs/*.jar;!build/libs/*-sources.jar;!build/libs/*-dev.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "src/main/resources/resourcepacks/overhaul"]
path = src/main/resources/resourcepacks/overhaul
url = https://github.com/cc-orgs/cc-overhaul
branch = main
50 changes: 50 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ plugins {
id "com.github.hierynomus.license" version "0.16.1"
id "org.jetbrains.kotlin.jvm" version "1.5.21"
id 'fabric-loom' version '0.10-SNAPSHOT'
id "com.modrinth.minotaur" version "2.+"
id 'com.matthewprenger.cursegradle' version '1.4.0'
}

def javaVersion = JavaLanguageVersion.of(17)
Expand Down Expand Up @@ -247,3 +249,51 @@ publishing {
// mavenLocal()
}
}

if (System.getenv("MODRINTH")) {
modrinth {
token = System.getenv("MODRINTH")

projectId = "eldBwa5V"
versionName = "[" + ((String) project.mc_version) + "] " + version
versionNumber = version
versionType = "release"
uploadFile = remapJar
gameVersions = [((String) project.mc_version)]
loaders = ["fabric"]
changelog = System.getenv("CHANGELOG")
}

remapJar {
finalizedBy project.tasks.modrinth
}
}

if (System.getenv("CURSEFORGE")) {
curseforge {
apiKey = System.getenv("CURSEFORGE")

project {
id = "462672"
releaseType = "release"
displayName = "[" + ((String) project.mc_version) + "] " + version
changelog = System.getenv("CHANGELOG")
changelogType = "markdown"
addGameVersion ((String) project.mc_version)
addGameVersion "Fabric"
mainArtifact(remapJar)

afterEvaluate {
uploadTask.dependsOn("remapJar")
}
}

options {
forgeGradleIntegration = false
}
}

remapJar {
finalizedBy project.tasks.curseforge
}
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
org.gradle.jvmargs=-Xmx3G

# Mod properties
mod_version=1.100.2
mod_version=1.100.5

# Minecraft properties
mc_version=1.18.1
fabric_api_version=0.44.0+1.18
fabric_loader_version=0.12.12
mc_version=1.18.2
fabric_api_version=0.47.8+1.18.2
fabric_loader_version=0.13.3

cloth_api_version=2.0.54
cloth_config_version=6.0.42
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/dan200/computercraft/ComputerCraftAPIImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import dan200.computercraft.core.asm.GenericMethod;
import dan200.computercraft.core.filesystem.FileMount;
import dan200.computercraft.core.filesystem.ResourceMount;
import dan200.computercraft.fabric.mixin.MinecraftServerAccess;
import dan200.computercraft.shared.*;
import dan200.computercraft.shared.peripheral.modem.wired.TileCable;
import dan200.computercraft.shared.peripheral.modem.wired.TileWiredModemFull;
Expand All @@ -34,7 +33,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
Expand All @@ -57,7 +56,7 @@ private ComputerCraftAPIImpl()

public static InputStream getResourceFile( String domain, String subPath )
{
ReloadableResourceManager manager = (ReloadableResourceManager) ((MinecraftServerAccess) GameInstanceUtils.getServer()).callGetResourceManager();
ResourceManager manager = GameInstanceUtils.getServer().getResourceManager();
try
{
return manager.getResource( new ResourceLocation( domain, subPath ) ).getInputStream();
Expand Down Expand Up @@ -100,7 +99,7 @@ public IWritableMount createSaveDirMount( @Nonnull Level world, @Nonnull String
@Override
public IMount createResourceMount( @Nonnull String domain, @Nonnull String subPath )
{
ReloadableResourceManager manager = (ReloadableResourceManager) ((MinecraftServerAccess) GameInstanceUtils.getServer()).callGetResourceManager();
ResourceManager manager = GameInstanceUtils.getServer().getResourceManager();
ResourceMount mount = ResourceMount.get( domain, subPath, manager );
return mount.exists( "" ) ? mount : null;
}
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/dan200/computercraft/api/ComputerCraftTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
package dan200.computercraft.api;

import dan200.computercraft.ComputerCraft;
import net.fabricmc.fabric.api.tag.TagFactory;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.Tag;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;

Expand All @@ -19,47 +19,47 @@ public class ComputerCraftTags
{
public static class Items
{
public static final Tag.Named<Item> COMPUTER = make( "computer" );
public static final Tag.Named<Item> TURTLE = make( "turtle" );
public static final Tag.Named<Item> WIRED_MODEM = make( "wired_modem" );
public static final Tag.Named<Item> MONITOR = make( "monitor" );
public static final TagKey<Item> COMPUTER = make( "computer" );
public static final TagKey<Item> TURTLE = make( "turtle" );
public static final TagKey<Item> WIRED_MODEM = make( "wired_modem" );
public static final TagKey<Item> MONITOR = make( "monitor" );

private static Tag.Named<Item> make( String name )
private static TagKey<Item> make( String name )
{
return TagFactory.ITEM.create( new ResourceLocation( ComputerCraft.MOD_ID, name ) );
return TagKey.create( Registry.ITEM_REGISTRY, new ResourceLocation( ComputerCraft.MOD_ID, name ) );
}
}

public static class Blocks
{
public static final Tag.Named<Block> COMPUTER = make( "computer" );
public static final Tag.Named<Block> TURTLE = make( "turtle" );
public static final Tag.Named<Block> WIRED_MODEM = make( "wired_modem" );
public static final Tag.Named<Block> MONITOR = make( "monitor" );
public static final TagKey<Block> COMPUTER = make( "computer" );
public static final TagKey<Block> TURTLE = make( "turtle" );
public static final TagKey<Block> WIRED_MODEM = make( "wired_modem" );
public static final TagKey<Block> MONITOR = make( "monitor" );

/**
* Blocks which can be broken by any turtle tool.
*/
public static final Tag.Named<Block> TURTLE_ALWAYS_BREAKABLE = make( "turtle_always_breakable" );
public static final TagKey<Block> TURTLE_ALWAYS_BREAKABLE = make( "turtle_always_breakable" );

/**
* Blocks which can be broken by the default shovel tool.
*/
public static final Tag.Named<Block> TURTLE_SHOVEL_BREAKABLE = make( "turtle_shovel_harvestable" );
public static final TagKey<Block> TURTLE_SHOVEL_BREAKABLE = make( "turtle_shovel_harvestable" );

/**
* Blocks which can be broken with the default sword tool.
*/
public static final Tag.Named<Block> TURTLE_SWORD_BREAKABLE = make( "turtle_sword_harvestable" );
public static final TagKey<Block> TURTLE_SWORD_BREAKABLE = make( "turtle_sword_harvestable" );

/**
* Blocks which can be broken with the default hoe tool.
*/
public static final Tag.Named<Block> TURTLE_HOE_BREAKABLE = make( "turtle_hoe_harvestable" );
public static final TagKey<Block> TURTLE_HOE_BREAKABLE = make( "turtle_hoe_harvestable" );

private static Tag.Named<Block> make( String name )
private static TagKey<Block> make( String name )
{
return TagFactory.BLOCK.create( new ResourceLocation( ComputerCraft.MOD_ID, name ) );
return TagKey.create( Registry.BLOCK_REGISTRY, new ResourceLocation( ComputerCraft.MOD_ID, name ) );
}
}
}
Loading

0 comments on commit 4ee94f4

Please sign in to comment.