Skip to content

Commit

Permalink
Update to 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
UnRealDinnerbone committed Apr 24, 2024
1 parent 6140f54 commit 4c90bfc
Show file tree
Hide file tree
Showing 38 changed files with 137 additions and 133 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
### 4.2.2
### 5.0.0

- Add Place Feature blacklist tag
- Changed the nether portal recipe to diamond pick instead of nettherite
- Updated to 1.20.5
17 changes: 13 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
plugins {
id("dev.nanite.mlp") version("0.1.2")
id("dev.nanite.mlp") version("0.1.8")
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'

}


java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

multiLoader.root() {
minecraftVersion.set(project.property("minecraft_version"))
Expand All @@ -25,9 +27,16 @@ allprojects {
setArchivesBaseName("${mod_name}-${project.name}".toLowerCase())
group = "com.unrealdinnerbone"


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


subprojects {


Expand All @@ -38,7 +47,7 @@ subprojects {

sourceSets.main.resources.srcDir project.file('src/generated/resources')

java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)


base {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"parent": "minecraft:story/mine_diamond",
"criteria": {
"enter_dimension": {
"conditions": {
Expand All @@ -13,7 +14,8 @@
},
"hidden": true,
"icon": {
"item": "jamd:portal_block"
"count": 1,
"id": "jamd:portal_block"
},
"title": {
"translate": "advancements.jamd.mining.title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"conditions": {
"items": [
{
"items": [
"minecraft:diamond_pickaxe"
]
"items": "minecraft:diamond_pickaxe"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"conditions": {
"items": [
{
"items": [
"minecraft:diamond_pickaxe"
]
"items": "minecraft:diamond_pickaxe"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"conditions": {
"items": [
{
"items": [
"minecraft:diamond_pickaxe"
]
"items": "minecraft:diamond_pickaxe"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
"monster_spawn_block_light_limit": 0,
"monster_spawn_light_level": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 7,
"min_inclusive": 0
}
"max_inclusive": 7,
"min_inclusive": 0
},
"natural": false,
"piglin_safe": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
"monster_spawn_block_light_limit": 0,
"monster_spawn_light_level": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 7,
"min_inclusive": 0
}
"max_inclusive": 7,
"min_inclusive": 0
},
"natural": true,
"piglin_safe": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
"monster_spawn_block_light_limit": 0,
"monster_spawn_light_level": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 7,
"min_inclusive": 0
}
"max_inclusive": 7,
"min_inclusive": 0
},
"natural": false,
"piglin_safe": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"OOO"
],
"result": {
"item": "jamd:end_portal"
"count": 1,
"id": "jamd:end_portal"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"OOO"
],
"result": {
"item": "jamd:nether_portal"
"count": 1,
"id": "jamd:nether_portal"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"OOO"
],
"result": {
"item": "jamd:portal_block"
"count": 1,
"id": "jamd:portal_block"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"replace": false,
"values": [
"minecraft:ore_infested"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"replace": false,
"values": [
"jamd:portal_block",
"jamd:nether_portal",
Expand Down

This file was deleted.

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

import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.serialization.Codec;
import com.mojang.serialization.MapCodec;
import com.unrealdinnerbone.jamd.block.*;
import com.unrealdinnerbone.jamd.block.base.PortalTileEntity;
import com.unrealdinnerbone.jamd.world.CustomFlatLevelSource;
Expand Down Expand Up @@ -34,9 +35,9 @@ public class JAMDRegistry implements IRegistry {
private static final RegistryObjects<Block> BLOCKS = Regeneration.create(Registries.BLOCK);
private static final RegistryObjects<Item> ITEMS = Regeneration.create(Registries.ITEM);
private static final RegistryObjects<BlockEntityType<?>> TILES = Regeneration.create(Registries.BLOCK_ENTITY_TYPE);
private static final RegistryObjects<Codec<? extends ChunkGenerator>> CHUNK_GENERATORS = Regeneration.create(Registries.CHUNK_GENERATOR);
private static final RegistryObjects<MapCodec<? extends ChunkGenerator>> CHUNK_GENERATORS = Regeneration.create(Registries.CHUNK_GENERATOR);

public static final RegistryEntry<Codec<? extends ChunkGenerator>> CUSTOM_FLAT_LEVEL_SOURCE = CHUNK_GENERATORS.register("mining", () -> CustomFlatLevelSource.CODEC);
public static final RegistryEntry<MapCodec<? extends ChunkGenerator>> CUSTOM_FLAT_LEVEL_SOURCE = CHUNK_GENERATORS.register("mining", () -> CustomFlatLevelSource.CODEC);

public static final WorldType OVERWORLD = of("mining", "portal_block", "portal", OverworldPortalBlock::new, OverworldBlockEntity::new, BiomeTags.IS_OVERWORLD);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public abstract class PortalBlock extends Block implements EntityBlock {
private final WorldType type;

public PortalBlock(WorldType type) {
super(Properties.of().requiresCorrectToolForDrops().strength(5.0F, 6.0F).sound(SoundType.STONE).mapColor(MapColor.COLOR_BLUE));
super(Properties.of().strength(5.0F, 6.0F).sound(SoundType.STONE).mapColor(MapColor.COLOR_BLUE));
this.type = type;
}

Expand All @@ -37,9 +37,8 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {
return type.getBlockEntity().get().create(pos, state);
}


@Override
public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
protected InteractionResult useWithoutItem(BlockState state, Level level, BlockPos pos, Player player, BlockHitResult hand) {
if (!level.isClientSide()) {
if (level.dimension().equals(type.getKey().level())) {
TelerportUtils.teleport(player, OVERWORLD, pos, type);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.unrealdinnerbone.jamd.world;

import com.mojang.serialization.Codec;
import com.mojang.serialization.MapCodec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.FlatLevelSource;
Expand All @@ -10,7 +11,7 @@ public class CustomFlatLevelSource extends FlatLevelSource {

private final CustomFlatLevelGeneratorSettings mySettings;

public static final Codec<CustomFlatLevelSource> CODEC = RecordCodecBuilder.create((instance) ->
public static final MapCodec<CustomFlatLevelSource> CODEC = RecordCodecBuilder.mapCodec((instance) ->
instance.group(CustomFlatLevelGeneratorSettings.CODEC
.fieldOf("settings")
.forGetter(CustomFlatLevelSource::settings))
Expand All @@ -28,7 +29,7 @@ public CustomFlatLevelGeneratorSettings settings() {
}

@Override
protected Codec<? extends ChunkGenerator> codec() {
protected MapCodec<? extends ChunkGenerator> codec() {
return CODEC;
}

Expand Down
3 changes: 2 additions & 1 deletion common/src/main/resources/jamd.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ accessible method net/minecraft/world/level/levelgen/feature/configurations/OreC
accessible field net/minecraft/world/level/levelgen/placement/HeightRangePlacement height Lnet/minecraft/world/level/levelgen/heightproviders/HeightProvider;
accessible field net/minecraft/world/level/levelgen/placement/CountPlacement count Lnet/minecraft/util/valueproviders/IntProvider;
accessible field net/minecraft/world/level/levelgen/heightproviders/ConstantHeight value Lnet/minecraft/world/level/levelgen/VerticalAnchor;
accessible field net/minecraft/world/level/biome/BiomeGenerationSettings featureSet Ljava/util/function/Supplier;
accessible field net/minecraft/world/level/biome/BiomeGenerationSettings featureSet Ljava/util/function/Supplier;
accessible method net/minecraft/data/worldgen/biome/OverworldBiomes calculateSkyColor (F)I
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@
import net.minecraft.advancements.AdvancementHolder;
import net.minecraft.advancements.AdvancementType;
import net.minecraft.advancements.critereon.ChangeDimensionTrigger;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.advancements.packs.VanillaStoryAdvancements;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;

import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;

public class AdvancementProvider extends FabricAdvancementProvider {

protected AdvancementProvider(FabricDataOutput output) {
super(output);
protected AdvancementProvider(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> registryLookup) {
super(output, registryLookup);
}

@Override
public void generateAdvancement(Consumer<AdvancementHolder> consumer) {
public void generateAdvancement(HolderLookup.Provider lookup, Consumer<AdvancementHolder> consumer) {
consumer.accept(Advancement.Builder.advancement()
.parent(new ResourceLocation("minecraft", "story/mine_diamond"))
.display(
JAMDRegistry.OVERWORLD.getItem().get(),
Component.translatable(JAMDRegistry.OVERWORLD.getAdvancementTitleKey()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,5 @@ protected void addTags(HolderLookup.Provider arg) {
.add(JAMDRegistry.OVERWORLD.getBlock().get())
.add(JAMDRegistry.NETHER.getBlock().get())
.add(JAMDRegistry.END.getBlock().get());
getOrCreateTagBuilder(BlockTags.NEEDS_DIAMOND_TOOL)
.add(JAMDRegistry.OVERWORLD.getBlock().get())
.add(JAMDRegistry.NETHER.getBlock().get())
.add(JAMDRegistry.END.getBlock().get());

}
}
4 changes: 3 additions & 1 deletion fabric/src/main/java/com/unrealdinnerbone/jamd/data/DRP.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries;
import org.jetbrains.annotations.NotNull;

import java.util.concurrent.CompletableFuture;

@SuppressWarnings("UnstableApiUsage")
public class DRP extends FabricDynamicRegistryProvider {

public DRP(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> registriesFuture) {
super(output, registriesFuture);
}
Expand All @@ -20,6 +21,7 @@ protected void configure(HolderLookup.Provider registries, Entries entries) {
}

@Override
@NotNull
public String getName() {
return "JAMD World Data";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.concurrent.CompletableFuture;

public class FeatureTagProvider extends FabricTagProvider<ConfiguredFeature<?, ?>> {

public FeatureTagProvider(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> registriesFuture) {
super(output, Registries.CONFIGURED_FEATURE, registriesFuture);
}
Expand Down
Loading

0 comments on commit 4c90bfc

Please sign in to comment.