Skip to content

Commit

Permalink
Update to MC 1.20.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnuecke committed Aug 17, 2023
1 parent 923b345 commit 68efbcc
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

// Just for in-dev convenience. Mod doesn't use any JEI APIs.
runtimeOnly fg.deobf("curse.maven:jei-238222:4592504")
runtimeOnly fg.deobf("curse.maven:jei-238222:4581323")
}

minecraft {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

minecraft_version=1.19.4
minecraft_version=1.20

archives_base_name=bedrockores
maven_group=li.cil.bedrockores

forge_version=45.1.0
forge_version=46.0.14

# Set by build pipeline.
semver=0.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static void onWorldRender(final RenderLevelStageEvent event) {
return;
}

final var level = player.level;
final var level = player.level();

if (Settings.uiOnlyWhenSneaking.get() && !player.isCrouching()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
import net.minecraft.world.level.block.entity.BlockEntityTicker;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MapColor;
import net.minecraftforge.common.capabilities.ForgeCapabilities;

import javax.annotation.Nullable;
import java.util.List;

public final class BedrockMinerBlock extends BaseEntityBlock {
public BedrockMinerBlock() {
super(Properties
.of(Material.METAL)
super(Properties.of()
.mapColor(MapColor.METAL)
.strength(5, 10)
.sound(SoundType.METAL));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MaterialColor;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.phys.HitResult;

import javax.annotation.Nullable;
Expand All @@ -38,8 +37,8 @@
*/
public final class BedrockOreBlock extends BaseEntityBlock {
public BedrockOreBlock() {
super(Properties
.of(Material.STONE)
super(Properties.of()
.mapColor(MapColor.STONE)
.strength(-1F, 3600000)
.noLootTable()
.isValidSpawn((state, reader, pos, entity) -> false));
Expand Down Expand Up @@ -213,7 +212,7 @@ public boolean canStickTo(final BlockState state, final BlockState other) {
}

@Override
public MaterialColor getMapColor(final BlockState state, final BlockGetter level, final BlockPos pos, final MaterialColor defaultColor) {
public MapColor getMapColor(final BlockState state, final BlockGetter level, final BlockPos pos, final MapColor defaultColor) {
final var ore = getOreBlockState(level.getBlockEntity(pos));
if (ore != null) {
return ore.getMapColor(level, pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import li.cil.bedrockores.common.config.Constants;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.event.CreativeModeTabEvent;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD, modid = Constants.MOD_ID)
public final class ModCreativeModTabs {
@SubscribeEvent
public static void handleCreativeTabEvent(final CreativeModeTabEvent.BuildContents event) {
if (event.getTab() == CreativeModeTabs.FUNCTIONAL_BLOCKS) {
public static void handleCreativeTabEvent(final BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.FUNCTIONAL_BLOCKS) {
event.accept(Items.BEDROCK_MINER.get());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected static Level getLevel(final NetworkEvent.Context context) {
@Nullable
private static Level getServerLevel(final NetworkEvent.Context context) {
final var sender = context.getSender();
return sender != null ? sender.getLevel() : null;
return sender != null ? sender.level() : null;
}

@OnlyIn(Dist.CLIENT)
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modLoader = "javafml"
loaderVersion = "[45,)"
loaderVersion = "[46,)"
issueTrackerURL = "https://github.com/MightyPirates/BedrockOres/issues"
license = "MIT"

Expand All @@ -16,12 +16,12 @@ Large ore deposits embedded in the bedrock.
[[dependencies.bedrockores]]
modId = "forge"
mandatory = true
versionRange = "[45.1.0,)"
versionRange = "[46.0.14,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.bedrockores]]
modId = "minecraft"
mandatory = true
versionRange = "[1.19.4,)"
versionRange = "[1.20,)"
ordering = "NONE"
side = "BOTH"

0 comments on commit 68efbcc

Please sign in to comment.