-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from MisterJulsen/1.20.1-dev
1.20.1 dev
- Loading branch information
Showing
144 changed files
with
8,025 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ bin | |
.metadata | ||
.classpath | ||
.project | ||
.vscode | ||
|
||
# idea | ||
out | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "automatic", | ||
"java.compile.nullAnalysis.mode": "disabled" | ||
"java.compile.nullAnalysis.mode": "disabled", | ||
"commentTranslate.hover.enabled": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,80 @@ | ||
package de.mrjulsen.crn; | ||
|
||
import com.mojang.logging.LogUtils; | ||
import com.simibubi.create.foundation.data.CreateRegistrate; | ||
import com.simibubi.create.foundation.item.ItemDescription; | ||
import com.simibubi.create.foundation.item.KineticStats; | ||
import com.simibubi.create.foundation.item.TooltipHelper; | ||
import com.simibubi.create.foundation.item.TooltipModifier; | ||
|
||
import de.mrjulsen.crn.block.AdvancedDisplayBlock; | ||
import de.mrjulsen.crn.config.ModClientConfig; | ||
import de.mrjulsen.crn.config.ModCommonConfig; | ||
import de.mrjulsen.crn.item.ModItems; | ||
import de.mrjulsen.crn.item.creativemodetab.ModCreativeModeTab; | ||
import de.mrjulsen.crn.network.NetworkManager; | ||
import de.mrjulsen.crn.proxy.ClientInitWrapper; | ||
import de.mrjulsen.crn.proxy.ServerInit; | ||
import de.mrjulsen.crn.registry.ModBlockEntities; | ||
import de.mrjulsen.crn.registry.ModBlocks; | ||
import de.mrjulsen.crn.registry.ModCreativeModeTab; | ||
import de.mrjulsen.crn.registry.ModExtras; | ||
import de.mrjulsen.crn.registry.ModItems; | ||
import net.minecraft.world.item.BlockItem; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraftforge.common.MinecraftForge; | ||
import net.minecraftforge.eventbus.api.IEventBus; | ||
import net.minecraftforge.fml.ModLoadingContext; | ||
import net.minecraftforge.fml.common.Mod; | ||
import net.minecraftforge.fml.config.ModConfig; | ||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import org.slf4j.Logger; | ||
|
||
@Mod(ModMain.MOD_ID) | ||
public final class ModMain { | ||
|
||
// The value here should match an entry in the META-INF/mods.toml file | ||
public static final String MOD_ID = "createrailwaysnavigator"; | ||
|
||
// Directly reference a slf4j logger | ||
public static final Logger LOGGER = LogUtils.getLogger(); | ||
|
||
public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(MOD_ID); | ||
|
||
@Nullable | ||
public static KineticStats create(Item item) { | ||
if (item instanceof BlockItem blockItem) { | ||
Block block = blockItem.getBlock(); | ||
if (block instanceof AdvancedDisplayBlock) { | ||
return new KineticStats(block); | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
static { | ||
ModMain.REGISTRATE.setTooltipModifierFactory(item -> | ||
new ItemDescription.Modifier(item, TooltipHelper.Palette.STANDARD_CREATE) | ||
.andThen(TooltipModifier.mapNull(ModMain.create(item))) | ||
); | ||
} | ||
|
||
public ModMain() { | ||
IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus(); | ||
eventBus.addListener(ServerInit::setup); | ||
eventBus.addListener(ClientInitWrapper::setup); | ||
|
||
ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, ModClientConfig.SPEC, MOD_ID + "-client.toml"); | ||
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, ModCommonConfig.SPEC, MOD_ID + "-common.toml"); | ||
|
||
ModItems.register(eventBus); | ||
eventBus.addListener(ServerInit::setup); | ||
eventBus.addListener(ClientInitWrapper::setup); | ||
|
||
REGISTRATE.registerEventListeners(eventBus); | ||
|
||
ModBlocks.register(); | ||
ModItems.register(); | ||
ModBlockEntities.register(); | ||
ModCreativeModeTab.register(eventBus); | ||
NetworkManager.create(); | ||
ModExtras.register(); | ||
MinecraftForge.EVENT_BUS.register(this); | ||
} | ||
} |
Oops, something went wrong.