Begin 1.20 port (god this is horrible)
11
Common/src/main/java/su/a71/tardim_ic/Constants.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package su.a71.tardim_ic;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Constants {
|
||||
|
||||
public static final String MOD_ID = "tardim_ic";
|
||||
public static final String MOD_NAME = "TARDIM: In Control";
|
||||
public static final Logger LOG = LoggerFactory.getLogger(MOD_NAME);
|
||||
}
|
8
Common/src/main/java/su/a71/tardim_ic/Registration.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
package su.a71.tardim_ic;
|
||||
|
||||
public class Registration {
|
||||
|
||||
public static void register() {
|
||||
|
||||
}
|
||||
}
|
25
Common/src/main/java/su/a71/tardim_ic/platform/Services.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package su.a71.tardim_ic.platform;
|
||||
|
||||
import com.example.examplemod.Constants;
|
||||
import su.a71.tardim_ic.platform.services.IPlatformHelper;
|
||||
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
public class Services {
|
||||
|
||||
// Platform helper that lets us do stuff for Forge/Fabric while being in Common
|
||||
public static final IPlatformHelper PLATFORM = load(IPlatformHelper.class);
|
||||
|
||||
// This code is used to load a service for the current environment. Your implementation of the service must be defined
|
||||
// manually by including a text file in META-INF/services named with the fully qualified class name of the service.
|
||||
// Inside the file you should write the fully qualified class name of the implementation to load for the platform. For
|
||||
// example our file on Forge points to ForgePlatformHelper while Fabric points to FabricPlatformHelper.
|
||||
public static <T> T load(Class<T> clazz) {
|
||||
|
||||
final T loadedService = ServiceLoader.load(clazz)
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new NullPointerException("Failed to load service for " + clazz.getName()));
|
||||
Constants.LOG.debug("Loaded {} for service {}", loadedService, clazz);
|
||||
return loadedService;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package su.a71.tardim_ic.platform.services;
|
||||
|
||||
public interface IPlatformHelper {
|
||||
|
||||
/**
|
||||
* Gets the name of the current platform
|
||||
*
|
||||
* @return The name of the current platform.
|
||||
*/
|
||||
String getPlatformName();
|
||||
|
||||
/**
|
||||
* Checks if a mod with the given id is loaded.
|
||||
*
|
||||
* @param modId The mod to check if it is loaded.
|
||||
* @return True if the mod is loaded, false otherwise.
|
||||
*/
|
||||
boolean isModLoaded(String modId);
|
||||
|
||||
/**
|
||||
* Check if the game is currently in a development environment.
|
||||
*
|
||||
* @return True if in a development environment, false otherwise.
|
||||
*/
|
||||
boolean isDevelopmentEnvironment();
|
||||
|
||||
/**
|
||||
* Gets the name of the environment type as a string.
|
||||
*
|
||||
* @return The name of the environment type.
|
||||
*/
|
||||
default String getEnvironmentName() {
|
||||
|
||||
return isDevelopmentEnvironment() ? "development" : "production";
|
||||
}
|
||||
|
||||
// TODO: Add registration stuff here?
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package su.a71.tardim_ic.tardim_ic;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Constants {
|
||||
|
||||
public static final String MOD_ID = "tardim_ic";
|
||||
public static final String MOD_NAME = "TARDIM: In Control";
|
||||
public static final Logger LOG;
|
||||
public static final Gson GSON;
|
||||
|
||||
static {
|
||||
LOG = LoggerFactory.getLogger(MOD_NAME);
|
||||
GSON = (new GsonBuilder()).setPrettyPrinting().create();
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package su.a71.tardim_ic.tardim_ic.utils;
|
||||
package su.a71.tardim_ic.utils;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
@ -7,14 +7,18 @@ import net.minecraft.world.level.Level;
|
|||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* This class is used whenever we need a player for a function but cannot get one
|
||||
* (i.g we are on server side and need to execute TARDIM command)
|
||||
*/
|
||||
public class FakePlayer extends Player {
|
||||
|
||||
public FakePlayer(Level lvl, BlockPos blockPos) {
|
||||
super(lvl, blockPos, 0, new GameProfile(UUID.randomUUID(), "FakePlayer_tardimic"), null);
|
||||
super(lvl, blockPos, 0, new GameProfile(UUID.randomUUID(), "FakePlayer_tardimic"));
|
||||
}
|
||||
|
||||
public FakePlayer(Level lvl, BlockPos blockPos, UUID id) {
|
||||
super(lvl, blockPos, 0, new GameProfile(id, "FakePlayer_tardimic"), null);
|
||||
super(lvl, blockPos, 0, new GameProfile(id, "FakePlayer_tardimic"));
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,5 +32,3 @@ public class FakePlayer extends Player {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
@ -3,8 +3,8 @@
|
|||
"parent": "digital_tardim_interface",
|
||||
"texture_size": [64, 64],
|
||||
"textures": {
|
||||
"1": "tardim_ic:blocks/digital_tardim_interface",
|
||||
"particle": "tardim_ic:blocks/digital_tardim_interface"
|
||||
"1": "tardim_ic:block/digital_tardim_interface",
|
||||
"particle": "tardim_ic:block/digital_tardim_interface"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"credit": "Made by karoter2 (Feulim)",
|
||||
"texture_size": [128, 128],
|
||||
"textures": {
|
||||
"0": "tardim_ic:blocks/food_machine",
|
||||
"particle": "tardim_ic:blocks/food_machine"
|
||||
"0": "tardim_ic:block/food_machine",
|
||||
"particle": "tardim_ic:block/food_machine"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"parent": "block/cube_all",
|
||||
"ambientocclusion": false,
|
||||
"textures": {
|
||||
"1": "tardim_ic:blocks/red_contr",
|
||||
"2": "tardim_ic:blocks/red_contr2",
|
||||
"particle": "tardim_ic:blocks/red_contr"
|
||||
"1": "tardim_ic:block/redstone_input",
|
||||
"2": "tardim_ic:block/redstone_input",
|
||||
"particle": "tardim_ic:block/redstone_input"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
"credit": "Made by karoter2 (Feulim)",
|
||||
"texture_size": [64, 64],
|
||||
"textures": {
|
||||
"1": "tardim_ic:blocks/tardim_dock",
|
||||
"particle": "tardim_ic:blocks/tardim_dock"
|
||||
"1": "tardim_ic:block/tardim_dock",
|
||||
"particle": "tardim_ic:block/tardim_dock"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 927 B |
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"animation": {
|
||||
"frametime": 10,
|
||||
"interpolate": true,
|
||||
"frames": [0, 1, 2, 3]
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 923 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 119 KiB |
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"pack": {
|
||||
"description": "TARDIM: In Control resources",
|
||||
"pack_format": 6
|
||||
}
|
||||
}
|
||||
"pack": {
|
||||
"description": "${mod_name}",
|
||||
"pack_format": 8
|
||||
}
|
||||
}
|
20
Common/src/main/resources/tardim_ic.mixins.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"required": true,
|
||||
"minVersion": "0.8",
|
||||
"package": "su.a71.tardim_ic.mixin",
|
||||
"refmap": "${mod_id}.refmap.json",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
"client": [
|
||||
],
|
||||
"server": [
|
||||
"BetterFuelMapMixin",
|
||||
"BetterFuelStorageMixin",
|
||||
"JammerMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
}
|
||||
}
|
||||
|