Skip to content

Commit

Permalink
Port to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DonovanDMC committed Nov 24, 2023
1 parent 82dbc8f commit 005d20d
Show file tree
Hide file tree
Showing 69 changed files with 602 additions and 345 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '[6.0,6.2)', changing: true
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
}
Expand Down
38 changes: 19 additions & 19 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ org.gradle.jvmargs=-Xmx1G
org.gradle.daemon=false

cfProjectID = 579177
mcVersion = 1.19.2
localVersion = 1.0.10
mcVersion = 1.20.1
localVersion = 1.0.0
mappingsChannel = official
mappingsVersion = 1.19.2
forgeVersion = 43.2.8
# 1.19.2-PE1.0.1
projecteVersion = 3955047
curiosVersion = 1.19.2-5.1.1.0
# 1.19.2-v1.5.1
ncrVersion = 4082456
# 11.4.0.285
jeiVersion = 4068188
# 1.19.2-1.0.1
pipezVersion = 4064952
# 12.9.2
ae2Version = 4293558
# 2.0.0
itankVersion = 3921315
# 8.3.103
clothVersion = 4633416
mappingsVersion = 1.20.1
forgeVersion = 47.2.0
# 1.20.1-PE1.0.0B
projecteVersion = 4860859
curiosVersion = 5.4.2+1.20.1
# 1.20.1-v2.2.2
ncrVersion = 4610474
# 15.2.0.27
jeiVersion = 4712868
# 1.20.1-1.2.2
pipezVersion = 4818852
# 15.0.15
ae2Version = 4857895
# 2.1.0
itankVersion = 4647928
# 11.1.106
clothVersion = 4633444
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
14 changes: 14 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'MinecraftForge'
url = 'https://maven.minecraftforge.net/'
}
}
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0'
}

rootProject.name = 'projectexpansion'
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@
"gui.projectexpansion.config.emc_display.desc": "Displays your current emc and gained emc per second in the top left corner.",
"gui.projectexpansion.config.notify_command_changes": "Notify Command Changes",
"gui.projectexpansion.config.notify_command_changes.desc": "Notify users something is changed about them via /emc.",
"gui.projectexpansion.config.notify_knowledge_book_gains": "Notify Knowledge Book Gains",
"gui.projectexpansion.config.notify_knowledge_book_gains.desc": "Tell users the list of items they gained when using a knowledge book.",
"gui.projectexpansion.config.notify_knowledge_book_changes": "Notify Knowledge Book Changes",
"gui.projectexpansion.config.notify_knowledge_book_changes.desc": "Tell users the list of items they gained when using a knowledge book.",
"gui.projectexpansion.config.limit_emc_link_vendor": "Limit EMC Link Vendor Output",
"gui.projectexpansion.config.limit_emc_link_vendor.desc": "If EMC Link Right-Click functionality should be Limited by Tier or Not.",
"gui.projectexpansion.config.transmutation_interface_item_count": "Transmutation Interface Item Count",
Expand Down Expand Up @@ -243,6 +243,8 @@
"gui.projectexpansion.config.enable_learned_tooltip.desc": "If a tooltip should be shown on items which can be learned, denoting if the item has been learned or not. Note: ProjectE's client.shiftEmcToolTips applies to this.",
"gui.projectexpansion.config.alchemical_collection_sound": "Alchemical Collection Sound",
"gui.projectexpansion.config.alchemical_collection_sound.desc": "If a sound should be played when something is collected with Alchemical Collection.",
"gui.projectexpansion.config.zero_emc_fluids_are_free": "Zero EMC Fluids are Free",
"gui.projectexpansion.config.zero_emc_fluids_are_free.desc": "If fluids with an EMC value of 0 should be free.",
"gui.projectexpansion.advanced_alchemical_chest.title": "Advanced Alchemical Chest",
"gui.projectexpansion.alchemical_book": "Alchemical Chest",
"gui.projectexpansion.alchemical_book.close": "Close",
Expand All @@ -253,6 +255,7 @@
"gui.projectexpansion.alchemical_book.dimension": "Dimension: %s",
"gui.projectexpansion.alchemical_book.cost": "Cost: %s",
"gui.projectexpansion.alchemical_book.no_back_location": "No Back Location",
"gui.projectexpansion.creative_tab": "Project Expansion",
"item.projectexpansion.basic_alchemical_book": "Basic Alchemical Book",
"item.projectexpansion.advanced_alchemical_book": "Advanced Alchemical Book",
"item.projectexpansion.master_alchemical_book": "Master Alchemical Book",
Expand Down Expand Up @@ -379,6 +382,7 @@
"text.projectexpansion.enabled": "Enabled ✓",
"text.projectexpansion.disabled": "Disabled ✗",
"text.projectexpansion.alchemical_collection": "Alchemical Collection: %s",
"text.projectexpansion.pos.outofbounds": "That position is outside the allowed boundaries.",
"sounds.projectexpansion.knowledge_sharing_book.store": "Knowledge Stored",
"sounds.projectexpansion.knowledge_sharing_book.use": "Knowledge Gained",
"sounds.projectexpansion.knowledge_sharing_book.use_none": "No Knowledge Gained",
Expand Down
2 changes: 1 addition & 1 deletion src/main/generation
25 changes: 5 additions & 20 deletions src/main/java/cool/furry/mc/forge/projectexpansion/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package cool.furry.mc.forge.projectexpansion;

import cool.furry.mc.forge.projectexpansion.capability.IAlchemialBookLocationsProvider;
import cool.furry.mc.forge.projectexpansion.capability.IAlchemicalBookLocationsProvider;
import cool.furry.mc.forge.projectexpansion.config.Config;
import cool.furry.mc.forge.projectexpansion.net.PacketHandler;
import cool.furry.mc.forge.projectexpansion.registries.*;
Expand All @@ -10,8 +10,6 @@
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
import net.minecraftforge.event.TickEvent;
Expand All @@ -21,35 +19,26 @@
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.server.ServerLifecycleHooks;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;

import javax.annotation.Nonnull;
import java.util.Objects;

@Mod(Main.MOD_ID)
public class Main {
public static final String MOD_ID = "projectexpansion";
public static CreativeModeTab tab;
public static CreativeModeTab tab = CreativeModeTab.builder().displayItems((params, output) -> new ItemStack(Objects.requireNonNull(Matter.FADING.getMatter()))).build();
@SuppressWarnings("unused")
public static final org.apache.logging.log4j.Logger Logger = LogManager.getLogger();

public Main() {
tab = new CreativeModeTab(MOD_ID) {

@Override
@Nonnull
@OnlyIn(Dist.CLIENT)
public ItemStack makeIcon() {
return new ItemStack(Matter.FADING.getMatter());
}
};
PacketHandler.register();
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
BlockEntityTypes.Registry.register(bus);
Blocks.Registry.register(bus);
Enchantments.Registry.register(bus);
Items.Registry.register(bus);
SoundEvents.Registry.register(bus);
CreativeTabs.Registry.register(bus);
MinecraftForge.EVENT_BUS.addListener(this::serverTick);
bus.addListener(this::registerCapabilities);
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.Spec, "project-expansion.toml");
Expand All @@ -61,7 +50,7 @@ public ItemStack makeIcon() {
}

private void registerCapabilities(RegisterCapabilitiesEvent event) {
event.register(IAlchemialBookLocationsProvider.class);
event.register(IAlchemicalBookLocationsProvider.class);
}

private void serverTick(TickEvent.ServerTickEvent event) {
Expand All @@ -84,8 +73,4 @@ private void serverTick(TickEvent.ServerTickEvent event) {
public static ResourceLocation rl(String path) {
return new ResourceLocation(MOD_ID, path);
}

public static void templog(String text) {
Logger.printf(Level.INFO, text, Thread.currentThread().getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.pathfinder.PathComputationType;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
Expand All @@ -66,7 +65,7 @@ public class BlockAdvancedAlchemicalChest extends HorizontalDirectionalBlock imp
private final DyeColor color;

public BlockAdvancedAlchemicalChest(DyeColor color) {
super(Block.Properties.of(Material.STONE).requiresCorrectToolForDrops().strength(10, 3_600_000).lightLevel((state) -> 10));
super(Block.Properties.of().requiresCorrectToolForDrops().strength(10, 3_600_000).lightLevel((state) -> 10).mapColor(color));
this.registerDefaultState(this.stateDefinition.any().setValue(FACING, Direction.NORTH).setValue(WATERLOGGED, Boolean.FALSE));
this.color = color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
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.minecraft.world.level.material.PushReaction;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.math.BigInteger;
import java.util.List;

@SuppressWarnings("deprecation")
public class BlockCollector extends Block implements IHasMatter, EntityBlock {
private final Matter matter;

public BlockCollector(Matter matter) {
super(Block.Properties.of(Material.STONE).strength(0.3F, 0.9F).requiresCorrectToolForDrops().lightLevel((state) -> Math.min(matter.ordinal(), 15)));
super(Block.Properties.of().strength(0.3F, 0.9F).requiresCorrectToolForDrops().lightLevel((state) -> Math.min(matter.ordinal(), 15)));
this.matter = matter;
}

Expand All @@ -44,7 +44,7 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) {

@Nonnull
@Override
public Matter getMatter() {
public @NotNull Matter getMatter() {
return matter;
}

Expand All @@ -71,4 +71,10 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, Block
public PushReaction getPistonPushReaction(BlockState state) {
return PushReaction.BLOCK;
}

@Override
public MapColor getMapColor(BlockState state, BlockGetter level, BlockPos pos, MapColor defaultColor) {
MapColor color = matter.mapColor == null ? null : matter.mapColor.get();
return color != null ? color : super.getMapColor(state, level, pos, defaultColor);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.StateDefinition;
import net.minecraft.world.level.material.Material;
import net.minecraft.world.level.material.MapColor;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
Expand All @@ -40,7 +41,7 @@ public class BlockEMCLink extends Block implements IHasMatter, EntityBlock {
private final Matter matter;

public BlockEMCLink(Matter matter) {
super(Block.Properties.of(Material.STONE).strength(1.5F, 30).requiresCorrectToolForDrops().lightLevel((state) -> Math.min(matter.ordinal(), 15)));
super(Block.Properties.of().strength(1.5F, 30).requiresCorrectToolForDrops().lightLevel((state) -> Math.min(matter.ordinal(), 15)));
this.matter = matter;
this.registerDefaultState(this.stateDefinition.any().setValue(BlockEntityNBTFilterable.FILTER, true));
}
Expand Down Expand Up @@ -79,7 +80,7 @@ public void setPlacedBy(Level level, BlockPos pos, BlockState state, @Nullable L

@Nonnull
@Override
public Matter getMatter() {
public @NotNull Matter getMatter() {
return matter;
}

Expand All @@ -100,4 +101,10 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, Block
public PushReaction getPistonPushReaction(BlockState state) {
return PushReaction.BLOCK;
}

@Override
public MapColor getMapColor(BlockState state, BlockGetter level, BlockPos pos, MapColor defaultColor) {
MapColor color = matter.mapColor == null ? null : matter.mapColor.get();
return color != null ? color : super.getMapColor(state, level, pos, defaultColor);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cool.furry.mc.forge.projectexpansion.block;

import cool.furry.mc.forge.projectexpansion.util.IHasMatter;
import cool.furry.mc.forge.projectexpansion.util.Matter;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.MapColor;
import org.jetbrains.annotations.NotNull;

public class BlockMatter extends Block implements IHasMatter {
private final Matter matter;

public BlockMatter(Matter matter) {
super(Block.Properties.of().strength(2_000_000, 6_000_000).requiresCorrectToolForDrops().lightLevel((state) -> Math.min(matter.ordinal(), 15)));
this.matter = matter;
}

@Override
public @NotNull Matter getMatter() {
return matter;
}

@Override
public MapColor getMapColor(BlockState state, BlockGetter level, BlockPos pos, MapColor defaultColor) {
MapColor color = matter.mapColor == null ? null : matter.mapColor.get();
return color != null ? color : super.getMapColor(state, level, pos, defaultColor);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
Expand Down Expand Up @@ -50,13 +50,13 @@ public class BlockPowerFlower extends Block implements IHasMatter, EntityBlock {
private final Matter matter;

public BlockPowerFlower(Matter matter) {
super(Block.Properties.of(Material.STONE).strength(1.5F, 30).lightLevel((state) -> Math.min(matter.ordinal(), 15)));
super(Block.Properties.of().strength(1.5F, 30).lightLevel((state) -> Math.min(matter.ordinal(), 15)));
this.matter = matter;
}

@Nonnull
@Override
public Matter getMatter() {
public @NotNull Matter getMatter() {
return matter;
}

Expand Down Expand Up @@ -110,4 +110,10 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level level, Block
public PushReaction getPistonPushReaction(BlockState state) {
return PushReaction.BLOCK;
}

@Override
public MapColor getMapColor(BlockState state, BlockGetter level, BlockPos pos, MapColor defaultColor) {
MapColor color = matter.mapColor == null ? null : matter.mapColor.get();
return color != null ? color : super.getMapColor(state, level, pos, defaultColor);
}
}
Loading

0 comments on commit 005d20d

Please sign in to comment.