Skip to content

Commit

Permalink
1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRealDinnerbone committed Jun 13, 2024
1 parent 87b499a commit f065668
Show file tree
Hide file tree
Showing 29 changed files with 60 additions and 140 deletions.
1 change: 1 addition & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
secrets:
nanite-token: ${{ secrets.NANITE_DEPLOY }}
with:
java-version: 21
use-snapshots: true
gradle-tasks: build publish
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### 5.0.0
### 6.0.0

- Updated to 1.20.5
- Updated to 1.21
39 changes: 12 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
plugins {
id("dev.nanite.mlp") version("0.1.8")
id("dev.nanite.mlp") version("0.1.10")
id("java-library")
id("maven-publish")
id("me.modmuss50.mod-publish-plugin") version "0.3.0"
// id 'org.jetbrains.gradle.plugin.idea-ext' version '1.0'

}


Expand All @@ -14,8 +12,8 @@ multiLoader.root() {
minecraftVersion.set(project.property("minecraft_version"))
modID.set(project.property("mod_id"))
splitSources.set(true)
convertAccessWidener.set(true)
accessWidenerFile.set(project(":common").file("src/main/resources/${mod_id}.accesswidener"))

dataGen {
useFabric.set(project(":common").file("src/generated/resources"))
}
Expand All @@ -27,15 +25,8 @@ allprojects {
setArchivesBaseName("${mod_name}-${project.name}".toLowerCase())
group = "com.unrealdinnerbone"

//
// idea {
// module {
// downloadSources = true
// downloadJavadoc = true
// }
// }
}

}

subprojects {

Expand All @@ -55,22 +46,26 @@ subprojects {
}
repositories {
maven {
name = "Creeperhost"
url = uri("https://maven.creeperhost.net/")
name = "NeoForge"
url = "https://maven.neoforged.net/"
}
maven {
name = "Nanite"
url = "https://maven.nanite.dev/releases"
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
maven {
name = "Nanite"
url = "https://maven.blamejared.com/"
url = "https://maven.nanite.dev/releases"
}
}
tasks.withType(ProcessResources).configureEach {
outputs.upToDateWhen { false }
}

test {
enabled = false
}

publishing {
repositories {
if (providers.environmentVariable("NANITE_TOKEN").isPresent()) {
Expand Down Expand Up @@ -108,12 +103,6 @@ publishMods {
modLoaders.add("fabric")
}

// def forgeOptions = publishOptions {
// file = project.provider { project(":forge").tasks.jar }.flatMap { it.archiveFile }
// displayName = "${project.name} Forge ${mod_version}+mc${minecraft_version}"
// modLoaders.add("forge")
// }

def neoOptions = publishOptions {
file = project.provider { project(":neo").tasks.jar }.flatMap { it.archiveFile }
displayName = "${project.name} Neo ${mod_version}+mc${minecraft_version}"
Expand All @@ -137,10 +126,6 @@ publishMods {
}
}

// curseforge("curseforgeForge") {
// from(curseForgeOptions, forgeOptions)
// }

curseforge("curseforgeNeoForge") {
from(curseForgeOptions, neoOptions)
}
Expand Down
8 changes: 8 additions & 0 deletions common/src/main/java/com/unrealdinnerbone/jamd/JAMD.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.unrealdinnerbone.jamd.compact.minecraft.MinecraftOreCompact;
import com.unrealdinnerbone.jamd.util.OreRegistry;
import com.unrealdinnerbone.trenzalore.api.platform.Services;
import com.unrealdinnerbone.trenzalore.lib.RLUtils;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import org.slf4j.Logger;

Expand Down Expand Up @@ -33,4 +35,10 @@ public static void onServerStart(MinecraftServer server) {
}
}


public static ResourceLocation rl(String value) {
return RLUtils.rl(MOD_ID, value);
}


}
7 changes: 4 additions & 3 deletions common/src/main/java/com/unrealdinnerbone/jamd/WorldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.unrealdinnerbone.jamd.api.FeatureTypeRegistry;
import com.unrealdinnerbone.jamd.block.base.PortalTileEntity;
import com.unrealdinnerbone.trenzalore.api.registry.RegistryEntry;
import com.unrealdinnerbone.trenzalore.lib.RLUtils;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.RegistryAccess;
Expand Down Expand Up @@ -53,13 +54,13 @@ public class WorldType {

public WorldType(String name, RegistryEntry<Block> block, RegistryEntry<BlockItem> item, RegistryEntry<BlockEntityType<PortalTileEntity>> blockEntity, TagKey<Biome> biomeTag) {
this.name = name;
this.key = KeySet.of(new ResourceLocation(JAMD.MOD_ID, name));
this.key = KeySet.of(RLUtils.rl(JAMD.MOD_ID, name));
this.block = block;
this.item = item;
this.blockEntity = blockEntity;
this.biomeTag = biomeTag;
this.ingoredConfigFeatures = TagKey.create(Registries.CONFIGURED_FEATURE, new ResourceLocation(JAMD.MOD_ID, name));
this.ingoredPlaceFeatures = TagKey.create(Registries.PLACED_FEATURE, new ResourceLocation(JAMD.MOD_ID, name));
this.ingoredConfigFeatures = TagKey.create(Registries.CONFIGURED_FEATURE, RLUtils.rl(JAMD.MOD_ID, name));
this.ingoredPlaceFeatures = TagKey.create(Registries.PLACED_FEATURE, RLUtils.rl(JAMD.MOD_ID, name));
this.configPath = JAMD.CONFIG_FOLDER.resolve(name + ".json");
TYPES.add(this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.unrealdinnerbone.jamd.api;

import com.unrealdinnerbone.trenzalore.api.platform.Services;
import com.unrealdinnerbone.trenzalore.lib.RLUtils;
import net.minecraft.resources.ResourceLocation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -13,7 +14,7 @@ public class FeatureTypeRegistry {
public static final Map<ResourceLocation, IFeatureTypeCompact<?>> FEATURES = new HashMap<>();

public static void register(String modId, String id, Supplier<IFeatureTypeCompact<?>> featureTypeCompact) {
register(modId, new ResourceLocation(modId, id), featureTypeCompact);
register(modId, RLUtils.rl(modId, id), featureTypeCompact);
}
public static void register(String modId, ResourceLocation id, Supplier<IFeatureTypeCompact<?>> featureTypeCompact) {
if (Services.PLATFORM.isModLoaded(modId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static List<PlacedFeature> getFeatures(WorldType type) {
JsonElement parse = new JsonParser().parse(jsonString);
DataResult<ConfigCodec> data = ConfigCodec.CODEC.parse(JsonOps.INSTANCE, parse);
if (data.error().isPresent()) {
LOGGER.error("Failed to parse config: {}", data.error().get().message());
LOGGER.error("Failed to parse ConfigCodec json: {}", data.error().get().message());
return Collections.emptyList();
}
Optional<ConfigCodec> result = data.result();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.level.portal.PortalInfo;
import net.minecraft.world.phys.Vec3;

import java.util.Collection;
import java.util.Collections;
import java.util.Optional;

public class TelerportUtils {
Expand All @@ -26,8 +26,7 @@ public static void teleport(Player playerEntity, ResourceKey<Level> toWorldKey,
if (toWorld.getBlockState(portalLocation).isAir()) {
toWorld.setBlockAndUpdate(portalLocation, registrySet.getBlock().get().defaultBlockState());
}
Vec3 portalLocationVec = new Vec3(portalLocation.getX() + 0.5, portalLocation.getY() + 1, portalLocation.getZ() + 0.5);
Services.PLATFORM.teleport(playerEntity, toWorld, new PortalInfo(portalLocationVec, playerEntity.getDeltaMovement(), playerEntity.getYRot(), playerEntity.getXRot()));
playerEntity.teleportTo(toWorld, portalLocation.getX() + 0.5, portalLocation.getY() + 1, portalLocation.getZ() + 0.5, Collections.emptySet(), playerEntity.getYRot(), playerEntity.getXRot());
},
() -> playerEntity.displayClientMessage(Component.translatable(JAMD.MOD_ID + ".invalid.pos"), true));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.unrealdinnerbone.jamd.JAMD;
import com.unrealdinnerbone.jamd.JAMDRegistry;
import com.unrealdinnerbone.trenzalore.lib.RLUtils;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricAdvancementProvider;
import net.minecraft.advancements.Advancement;
Expand All @@ -25,7 +26,7 @@ protected AdvancementProvider(FabricDataOutput output, CompletableFuture<HolderL
@Override
public void generateAdvancement(HolderLookup.Provider lookup, Consumer<AdvancementHolder> consumer) {
consumer.accept(Advancement.Builder.advancement()
.parent(new ResourceLocation("minecraft", "story/mine_diamond"))
.parent(RLUtils.rl("minecraft", "story/mine_diamond"))
.display(
JAMDRegistry.OVERWORLD.getItem().get(),
Component.translatable(JAMDRegistry.OVERWORLD.getAdvancementTitleKey()),
Expand All @@ -37,6 +38,6 @@ public void generateAdvancement(HolderLookup.Provider lookup, Consumer<Advanceme
true
)
.addCriterion("enter_dimension", ChangeDimensionTrigger.TriggerInstance.changedDimensionTo(JAMDRegistry.OVERWORLD.getKey().level()))
.build(new ResourceLocation(JAMD.MOD_ID, "enter_mining_dimension")));
.build(RLUtils.rl(JAMD.MOD_ID, "enter_mining_dimension")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.unrealdinnerbone.jamd.JAMD;
import com.unrealdinnerbone.jamd.JAMDRegistry;
import com.unrealdinnerbone.trenzalore.lib.RLUtils;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider;
import net.minecraft.core.HolderLookup;
Expand Down Expand Up @@ -30,22 +31,22 @@ public void buildRecipes(RecipeOutput exporter) {
.define('O', Blocks.OBSIDIAN)
.define('P', Items.DIAMOND_PICKAXE)
.unlockedBy("has_diamond_pick", has(Items.DIAMOND_PICKAXE))
.save(exporter, new ResourceLocation(JAMD.MOD_ID, "portal_block"));
.save(exporter, RLUtils.rl(JAMD.MOD_ID, "portal_block"));
ShapedRecipeBuilder.shaped(RecipeCategory.TRANSPORTATION, JAMDRegistry.NETHER.getBlock().get())
.pattern("OOO")
.pattern("OPO")
.pattern("OOO")
.define('O', Blocks.NETHER_BRICKS)
.define('P', Items.NETHERITE_PICKAXE)
.unlockedBy("has_diamond_pick", has(Items.DIAMOND_PICKAXE))
.save(exporter, new ResourceLocation(JAMD.MOD_ID, "nether_portal_block"));
.save(exporter, RLUtils.rl(JAMD.MOD_ID, "nether_portal_block"));
ShapedRecipeBuilder.shaped(RecipeCategory.TRANSPORTATION, JAMDRegistry.END.getBlock().get())
.pattern("OOO")
.pattern("OPO")
.pattern("OOO")
.define('O', Blocks.END_STONE)
.define('P', Items.DIAMOND_PICKAXE)
.unlockedBy("has_diamond_pick", has(Items.DIAMOND_PICKAXE))
.save(exporter, new ResourceLocation(JAMD.MOD_ID, "end_portal_block"));
.save(exporter, RLUtils.rl(JAMD.MOD_ID, "end_portal_block"));
}
}
11 changes: 0 additions & 11 deletions forge/build.gradle

This file was deleted.

32 changes: 0 additions & 32 deletions forge/src/main/java/com/unrealdinnerbone/jamd/forge/JAMDForge.java

This file was deleted.

7 changes: 0 additions & 7 deletions forge/src/main/resources/META-INF/accesstransformer.cfg

This file was deleted.

29 changes: 0 additions & 29 deletions forge/src/main/resources/META-INF/mods.toml

This file was deleted.

18 changes: 7 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,19 @@ mod_id=jamd


# Common
minecraft_version=1.20.5
minecraft_version=1.21

# Forge
#forge_version=49.0.30
#forge_version=49.0.13

neo_version=20.5.0-beta
neo_version=21.0.0-beta

fabric_version=0.97.6+1.20.5
fabric_loader_version=0.15.10
fabric_version=0.100.1+1.21
fabric_loader_version=0.15.11

# Other
trenzalore_version=5.0.1
trenzalore_version=6.0.0

# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

#Compact
#mekanism_version=1.20.4-10.5.0.22
#immersive_engineering_version=1.20.4-10.0.1-pre.177
org.gradle.daemon=false
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/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
//public class IECompact implements IFeatureTypeCompact<IEOreFeature.IEOreFeatureConfig> {
//
// public static final ResourceLocation ID = new ResourceLocation("immersiveengineering", "ie_ore");
// public static final ResourceLocation ID = RLUtils.rl("immersiveengineering", "ie_ore");
//
// @Override
// public OresCodec parse(IEOreFeature.IEOreFeatureConfig value, List<PlacementModifier> placementModifiers) {
Expand Down
Loading

0 comments on commit f065668

Please sign in to comment.