Compare commits

..

No commits in common. "a35dda60d3bea36d195b4a633a1e007821018436" and "6bec816f4cb2652f1bc0b539b70c163d44369b8c" have entirely different histories.

52 changed files with 492 additions and 399 deletions

View File

@ -1 +1 @@
vmodextras vmodaddon

View File

@ -1,7 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
</code_scheme>
</component>

View File

@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -9,7 +9,7 @@
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.5/6d1c8bf4c28e697f472a83bd6add76ec4951734/mixin-0.8.5-processor.jar" /> <entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.8.5/6d1c8bf4c28e697f472a83bd6add76ec4951734/mixin-0.8.5-processor.jar" />
<entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.20/18bcea7d5df4d49227b4a0743a536208ce4825bb/lombok-1.18.20.jar" /> <entry name="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.projectlombok/lombok/1.18.20/18bcea7d5df4d49227b4a0743a536208ce4825bb/lombok-1.18.20.jar" />
</processorPath> </processorPath>
<module name="vmodextras.main" /> <module name="vmodaddon.main" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel target="17" /> <bytecodeTargetLevel target="17" />

View File

@ -2,8 +2,8 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/.idea/modules/vmodextras.main.iml" filepath="$PROJECT_DIR$/.idea/modules/vmodextras.main.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/modules/vmodaddon.main.iml" filepath="$PROJECT_DIR$/.idea/modules/vmodaddon.main.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/vmodextras.test.iml" filepath="$PROJECT_DIR$/.idea/modules/vmodextras.test.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/modules/vmodaddon.test.iml" filepath="$PROJECT_DIR$/.idea/modules/vmodaddon.test.iml" />
</modules> </modules>
</component> </component>
</project> </project>

View File

@ -11,12 +11,17 @@
<autoDetectTypes> <autoDetectTypes>
<platformType>FORGE</platformType> <platformType>FORGE</platformType>
<platformType>MIXIN</platformType> <platformType>MIXIN</platformType>
<platformType>MCP</platformType>
</autoDetectTypes> </autoDetectTypes>
<projectReimportVersion>1</projectReimportVersion> <projectReimportVersion>1</projectReimportVersion>
</configuration> </configuration>
</facet> </facet>
</component> </component>
<component name="McpModuleSettings"> <component name="McpModuleSettings">
<option name="srgType" value="SRG" /> <option name="mappingFile" value="$MODULE_DIR$/../../build/createMcpToSrg/output.tsrg" />
<option name="mcpVersion" value="official_1.20.1" />
<option name="minecraftVersion" value="1.20.1" />
<option name="platformVersion" value="47.4.1" />
<option name="srgType" value="TSRG" />
</component> </component>
</module> </module>

View File

@ -6,12 +6,17 @@
<autoDetectTypes> <autoDetectTypes>
<platformType>FORGE</platformType> <platformType>FORGE</platformType>
<platformType>MIXIN</platformType> <platformType>MIXIN</platformType>
<platformType>MCP</platformType>
</autoDetectTypes> </autoDetectTypes>
<projectReimportVersion>1</projectReimportVersion> <projectReimportVersion>1</projectReimportVersion>
</configuration> </configuration>
</facet> </facet>
</component> </component>
<component name="McpModuleSettings"> <component name="McpModuleSettings">
<option name="srgType" value="SRG" /> <option name="mappingFile" value="$MODULE_DIR$/../../build/createMcpToSrg/output.tsrg" />
<option name="mcpVersion" value="official_1.20.1" />
<option name="minecraftVersion" value="1.20.1" />
<option name="platformVersion" value="47.4.1" />
<option name="srgType" value="TSRG" />
</component> </component>
</module> </module>

View File

@ -180,8 +180,6 @@ dependencies {
implementation(fg.deobf(files("./libs/trackwork-1.20.1-1.1.1b.jar"))) implementation(fg.deobf(files("./libs/trackwork-1.20.1-1.1.1b.jar")))
implementation(fg.deobf("org.valkyrienskies:valkyrienskies-120:2.3.0-beta.7")) implementation(fg.deobf("org.valkyrienskies:valkyrienskies-120:2.3.0-beta.7"))
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.14.0'
implementation 'net.minecraftforge:modlauncher:10.1.1' implementation 'net.minecraftforge:modlauncher:10.1.1'
implementation 'net.minecraftforge:forgespi:7.1.0' implementation 'net.minecraftforge:forgespi:7.1.0'

View File

@ -5,10 +5,24 @@ minecraft_version_range=[1.20.1,1.21)
forge_version=47.4.1 forge_version=47.4.1
forge_version_range=[47,) forge_version_range=[47,)
loader_version_range=[47,) loader_version_range=[47,)
# The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
#
# | Channel | Version | |
# |-----------|----------------------|--------------------------------------------------------------------------------|
# | official | MCVersion | Official field/method names from Mojang mapping files |
# | parchment | YYYY.MM.DD-MCVersion | Open community-sourced parameter names and javadocs layered on top of official |
#
# You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
# See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
#
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
mapping_channel=official mapping_channel=official
mapping_version=1.20.1 mapping_version=1.20.1
mod_id=vmodextras mod_id=vmodaddon
mod_name=VModExtras mod_name=VModAddon
mod_license=MIT mod_license=MIT
mod_version=1.0-SNAPSHOT mod_version=1.0-SNAPSHOT
mod_group_id=space.eptaproject mod_group_id=space.eptaproject

View File

@ -12,4 +12,4 @@ plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
} }
rootProject.name = 'vmodextras' rootProject.name = 'vmodaddon'

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras; package space.eptaproject.vmodaddon;
import it.unimi.dsi.fastutil.objects.ObjectArrayList; import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import it.unimi.dsi.fastutil.objects.ObjectImmutableList; import it.unimi.dsi.fastutil.objects.ObjectImmutableList;
@ -16,7 +16,6 @@ public class Config {
public static final ForgeConfigSpec.ConfigValue<String> RESOURCE_LOCATION; public static final ForgeConfigSpec.ConfigValue<String> RESOURCE_LOCATION;
public static final ForgeConfigSpec.ConfigValue<Integer> Suspension_Stiffness_LIMIT; public static final ForgeConfigSpec.ConfigValue<Integer> Suspension_Stiffness_LIMIT;
public static final ForgeConfigSpec.ConfigValue<Double> Suspension_Stiffness_delta;
public static List<ResourceLocation> parsedList = new ObjectArrayList<>(); public static List<ResourceLocation> parsedList = new ObjectArrayList<>();
private static List<Map.Entry<Integer, ResourceLocation>> ITEM = new ObjectImmutableList<>(new ArrayList<>()); private static List<Map.Entry<Integer, ResourceLocation>> ITEM = new ObjectImmutableList<>(new ArrayList<>());
@ -63,11 +62,6 @@ public class Config {
.comment("track suspension stiffness") .comment("track suspension stiffness")
.defineInRange("SuspensionStiffness", 4, 1, 20); .defineInRange("SuspensionStiffness", 4, 1, 20);
Suspension_Stiffness_delta = builder
.comment("track suspension stiffness delta")
.defineInRange("suspension_stiffness_delta", 1d, 0.10d, 1d);
builder.pop(); builder.pop();
COMMON_CONFIG = builder.build(); COMMON_CONFIG = builder.build();
} }

View File

@ -0,0 +1,8 @@
package space.eptaproject.vmodaddon;
import space.eptaproject.vmodaddon.mixins.PhysicsTrackControllerAccessor;
public interface IPhysicsTrackController extends PhysicsTrackControllerAccessor {
void SetRawDamperCoefficient(float delta);
float GetRawDamperCoefficient();
}

View File

@ -0,0 +1,6 @@
package space.eptaproject.vmodaddon;
import space.eptaproject.vmodaddon.mixins.SimpleWheelControllerAccessor;
public interface ISimpleWheelController extends SimpleWheelControllerAccessor {
}

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras; package space.eptaproject.vmodaddon;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras; package space.eptaproject.vmodaddon;
import lombok.ToString; import lombok.ToString;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@ToString @ToString
public class Validator implements IValidator { public class Validator implements IValidator {
public static final Logger LOGGER = LoggerFactory.getLogger("Validator"); public static final Logger LOGGER = LoggerFactory.getLogger("Validator");
public static ResourceLocation RB = ResourceLocation.fromNamespaceAndPath(VmodExtras.MODID, "example_block"); public static ResourceLocation RB = ResourceLocation.fromNamespaceAndPath(Vmodaddon.MODID, "example_block");
public Validator() { public Validator() {

View File

@ -1,10 +1,6 @@
package space.eptaproject.vmodextras; package space.eptaproject.vmodaddon;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.*; import net.minecraft.world.item.*;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
@ -20,21 +16,18 @@ import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.config.ModConfigEvent; import net.minecraftforge.fml.event.config.ModConfigEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.*; import net.minecraftforge.registries.RegistryObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import space.eptaproject.vmodextras.block.CompactBackupBlock; import space.eptaproject.vmodaddon.block.CompactBackupBlock;
import space.eptaproject.vmodextras.block.CompactBackupBlockEntity; import space.eptaproject.vmodaddon.block.CompactBackupBlockEntity;
import space.eptaproject.vmodextras.block.TrackBackupBlock; import space.eptaproject.vmodaddon.block.TrackBackupBlock;
import space.eptaproject.vmodextras.block.TrackBackupBlockEntity; import space.eptaproject.vmodaddon.block.TrackBackupBlockEntity;
import space.eptaproject.vmodextras.util.ModRegistry; import space.eptaproject.vmodaddon.util.ModRegistry;
import java.io.InputStream; @Mod(Vmodaddon.MODID)
import java.io.InputStreamReader; public class Vmodaddon {
import java.util.Map;
@Mod(VmodExtras.MODID) public static final String MODID = "vmodaddon";
public class VmodExtras {
public static final String MODID = "vmodextras";
private static final Logger LOGGER = LogUtils.getLogger(); private static final Logger LOGGER = LogUtils.getLogger();
@ -58,7 +51,7 @@ public class VmodExtras {
static { static {
REGISTRY = new ModRegistry(MODID); REGISTRY = new ModRegistry(MODID);
TRAK_BUK = REGISTRY.BLOCKS.register("track_backup", () -> new TrackBackupBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE))); TRAK_BUK = REGISTRY.BLOCKS.register("track_b", () -> new TrackBackupBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE)));
SHIP_VOID_BLOCK = REGISTRY.BLOCKS.register("ship_void", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.STONE))); SHIP_VOID_BLOCK = REGISTRY.BLOCKS.register("ship_void", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.STONE)));
COMPACT_BACKUP = REGISTRY.BLOCKS.register("compact_backup", () -> new CompactBackupBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE))); COMPACT_BACKUP = REGISTRY.BLOCKS.register("compact_backup", () -> new CompactBackupBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE)));
@ -67,14 +60,14 @@ public class VmodExtras {
EXAMPLE_TAB = REGISTRY.TabBuilder() EXAMPLE_TAB = REGISTRY.TabBuilder()
.push((registry) -> { .push((registry) -> {
MY_BLOCK_ITEM = registry.register("track_backup", () -> new BlockItem(TRAK_BUK.get(), new Item.Properties())); MY_BLOCK_ITEM = registry.register("track_b", () -> new BlockItem(TRAK_BUK.get(), new Item.Properties()));
SHIP_VOID_ITEM = registry.register("ship_void", () -> new BlockItem(SHIP_VOID_BLOCK.get(), new Item.Properties())); SHIP_VOID_ITEM = registry.register("ship_void", () -> new BlockItem(SHIP_VOID_BLOCK.get(), new Item.Properties()));
COMPACT_BACKUP_ITEM = registry.register("compact_backup", () -> new BlockItem(COMPACT_BACKUP.get(), new Item.Properties())); COMPACT_BACKUP_ITEM = registry.register("compact_backup", () -> new BlockItem(COMPACT_BACKUP.get(), new Item.Properties()));
}) })
.build("vmodetras", Items.BEDROCK.getDefaultInstance()); .build("vmodaddon", Items.BEDROCK.getDefaultInstance());
} }
public VmodExtras() { public Vmodaddon() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
modEventBus.addListener(this::commonSetup); modEventBus.addListener(this::commonSetup);

View File

@ -1,9 +1,9 @@
package space.eptaproject.vmodextras.block; package space.eptaproject.vmodaddon.block;
import com.simibubi.create.foundation.block.IBE; import com.simibubi.create.foundation.block.IBE;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import space.eptaproject.vmodextras.VmodExtras; import space.eptaproject.vmodaddon.Vmodaddon;
public class CompactBackupBlock extends Block implements IBE<CompactBackupBlockEntity> { public class CompactBackupBlock extends Block implements IBE<CompactBackupBlockEntity> {
@ -13,7 +13,7 @@ public class CompactBackupBlock extends Block implements IBE<CompactBackupBlockE
@Override @Override
public BlockEntityType<? extends CompactBackupBlockEntity> getBlockEntityType() { public BlockEntityType<? extends CompactBackupBlockEntity> getBlockEntityType() {
return VmodExtras.COMPACT_BACKUP_BLOCK_ENTITY.get(); return Vmodaddon.COMPACT_BACKUP_BLOCK_ENTITY.get();
} }
@Override @Override

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras.block; package space.eptaproject.vmodaddon.block;
import edn.stratodonut.drivebywire.wire.ShipWireNetworkManager; import edn.stratodonut.drivebywire.wire.ShipWireNetworkManager;
import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController; import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController;
@ -13,16 +13,16 @@ import org.joml.Vector3d;
import org.joml.Vector3dc; import org.joml.Vector3dc;
import org.valkyrienskies.core.api.ships.ServerShip; import org.valkyrienskies.core.api.ships.ServerShip;
import org.valkyrienskies.mod.common.VSGameUtilsKt; import org.valkyrienskies.mod.common.VSGameUtilsKt;
import space.eptaproject.vmodextras.trackwork.IPhysicsTrackController; import space.eptaproject.vmodaddon.IPhysicsTrackController;
import space.eptaproject.vmodextras.trackwork.ISimpleWheelController; import space.eptaproject.vmodaddon.ISimpleWheelController;
import space.eptaproject.vmodextras.VmodExtras; import space.eptaproject.vmodaddon.Vmodaddon;
public class CompactBackupBlockEntity extends BlockEntity { public class CompactBackupBlockEntity extends BlockEntity {
private CompoundTag pendingBackupData; private CompoundTag pendingBackupData;
public CompactBackupBlockEntity(BlockPos p_155229_, BlockState p_155230_) { public CompactBackupBlockEntity(BlockPos p_155229_, BlockState p_155230_) {
super(VmodExtras.COMPACT_BACKUP_BLOCK_ENTITY.get(), p_155229_, p_155230_); super(Vmodaddon.COMPACT_BACKUP_BLOCK_ENTITY.get(), p_155229_, p_155230_);
} }
@Override @Override

View File

@ -1,9 +1,9 @@
package space.eptaproject.vmodextras.block; package space.eptaproject.vmodaddon.block;
import com.simibubi.create.foundation.block.IBE; import com.simibubi.create.foundation.block.IBE;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.BlockEntityType;
import space.eptaproject.vmodextras.VmodExtras; import space.eptaproject.vmodaddon.Vmodaddon;
public class TrackBackupBlock extends Block implements IBE<TrackBackupBlockEntity> { public class TrackBackupBlock extends Block implements IBE<TrackBackupBlockEntity> {
@ -13,7 +13,7 @@ public class TrackBackupBlock extends Block implements IBE<TrackBackupBlockEntit
@Override @Override
public BlockEntityType<? extends TrackBackupBlockEntity> getBlockEntityType() { public BlockEntityType<? extends TrackBackupBlockEntity> getBlockEntityType() {
return VmodExtras.MY_BLOCK_ENTITY.get(); return Vmodaddon.MY_BLOCK_ENTITY.get();
} }
@Override @Override

View File

@ -0,0 +1,108 @@
package space.eptaproject.vmodaddon.block;
import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController;
import edn.stratodonut.trackwork.tracks.forces.SimpleWheelController;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import org.joml.Vector3d;
import org.joml.Vector3dc;
import org.valkyrienskies.core.api.ships.ServerShip;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import space.eptaproject.vmodaddon.IPhysicsTrackController;
import space.eptaproject.vmodaddon.ISimpleWheelController;
import space.eptaproject.vmodaddon.Vmodaddon;
public class TrackBackupBlockEntity extends BlockEntity {
public TrackBackupBlockEntity(BlockPos p_155229_, BlockState p_155230_) {
super(Vmodaddon.MY_BLOCK_ENTITY.get(), p_155229_, p_155230_);
}
@Override
protected void saveAdditional(CompoundTag tag) {
super.saveAdditional(tag);
ServerShip ship = (ServerShip) VSGameUtilsKt.getShipObjectManagingPos(this.level, getBlockPos());
if (ship != null) {
{
PhysicsTrackController physicsTrackController = ship.getAttachment(PhysicsTrackController.class);
IPhysicsTrackController controller = (IPhysicsTrackController) physicsTrackController;
if (physicsTrackController != null) {
CompoundTag PhysicsTrackControllerTag = new CompoundTag();
PhysicsTrackControllerTag.putFloat("SuspensionStiffness", controller.getSuspensionStiffness());
{
CompoundTag suspensionAdjust = new CompoundTag();
Vector3dc vec = controller.getSuspensionAdjust();
suspensionAdjust.putDouble("x", vec.x());
suspensionAdjust.putDouble("y", vec.y());
suspensionAdjust.putDouble("z", vec.z());
PhysicsTrackControllerTag.put("suspensionAdjust", suspensionAdjust);
}
tag.put("PhysicsTrackController", PhysicsTrackControllerTag);
}
}
{
SimpleWheelController simpleWheelController = ship.getAttachment(SimpleWheelController.class);
ISimpleWheelController controller = (ISimpleWheelController) simpleWheelController;
if (simpleWheelController != null) {
CompoundTag SimpleWheelControllerTag = new CompoundTag();
SimpleWheelControllerTag.putFloat("SuspensionStiffness", controller.getSuspensionStiffness());
{
CompoundTag suspensionAdjust = new CompoundTag();
Vector3dc vec = controller.getSuspensionAdjust();
suspensionAdjust.putDouble("x", vec.x());
suspensionAdjust.putDouble("y", vec.y());
suspensionAdjust.putDouble("z", vec.z());
SimpleWheelControllerTag.put("suspensionAdjust", suspensionAdjust);
}
tag.put("SimpleWheelController", SimpleWheelControllerTag);
}
}
}
}
@Override
public void load(CompoundTag tag) {
super.load(tag);
ServerShip ship = (ServerShip) VSGameUtilsKt.getShipObjectManagingPos(this.level, getBlockPos());
if (ship != null) {
if (tag.contains("SimpleWheelController")) {
CompoundTag L = tag.getCompound("SimpleWheelController");
SimpleWheelController controller2 = SimpleWheelController.getOrCreate(ship);
if (L.contains("SuspensionStiffness")) {
((ISimpleWheelController) controller2).setSuspensionStiffness(L.getFloat("SuspensionStiffness"));
}
if (L.contains("suspensionAdjust")) {
CompoundTag suspensionAdjust = L.getCompound("suspensionAdjust");
((ISimpleWheelController) controller2).setSuspensionAdjust(new Vector3d(new Vector3d(suspensionAdjust.getDouble("x"), suspensionAdjust.getDouble("y"), suspensionAdjust.getDouble("z"))));
}
}
if (tag.contains("PhysicsTrackController")) {
CompoundTag L = tag.getCompound("PhysicsTrackController");
PhysicsTrackController controller = PhysicsTrackController.getOrCreate(ship);
if (L.contains("SuspensionStiffness")) {
((IPhysicsTrackController) controller).setSuspensionStiffness(L.getFloat("SuspensionStiffness"));
}
if (L.contains("suspensionAdjust")) {
CompoundTag suspensionAdjust = L.getCompound("suspensionAdjust");
((IPhysicsTrackController) controller).setSuspensionAdjust(new Vector3d(suspensionAdjust.getDouble("x"), suspensionAdjust.getDouble("y"), suspensionAdjust.getDouble("z")));
}
}
}
}
}

View File

@ -0,0 +1,12 @@
package space.eptaproject.vmodaddon.mixin;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface A {
String[] value();
}

View File

@ -0,0 +1,8 @@
package space.eptaproject.vmodaddon.mixin;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
public interface ITransformer {
void transform(String targetClassName, ClassNode classNode, String mixinClassName, IMixinInfo mixinInfo);
}

View File

@ -0,0 +1,35 @@
package space.eptaproject.vmodaddon.mixin;
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap;
import java.util.Map;
public class InstanceHolder<T> {
private final Map<Class<? extends T>, T> instances = new Object2ObjectArrayMap<>();
public InstanceHolder() {
}
public T get(String cls) {
try {
return get((Class<? extends T>) Class.forName(cls));
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public T get(Class<? extends T> cls) {
if (instances.containsKey(cls)) {
return instances.get(cls);
}
try {
T instance = cls.getDeclaredConstructor().newInstance();
instances.put(cls, instance);
return instance;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}

View File

@ -0,0 +1,36 @@
package space.eptaproject.vmodaddon.mixin;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.*;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
import java.util.ListIterator;
public class KotlinOptimizationTransformer implements ITransformer {
@Override
public void transform(String targetClassName, ClassNode classNode, String mixinClassName, IMixinInfo mixinInfo) {
for (MethodNode method : classNode.methods) {
ListIterator<AbstractInsnNode> it = method.instructions.iterator();
while (it.hasNext()) {
AbstractInsnNode insn = it.next();
if (insn.getOpcode() == Opcodes.INVOKESTATIC &&
insn instanceof MethodInsnNode methodInsn &&
methodInsn.owner.equals("kotlin/jvm/internal/Intrinsics") &&
(methodInsn.name.equals("checkParameterIsNotNull") || methodInsn.name.equals("checkNotNullParameter") || methodInsn.name.equals("checkNotNullExpressionValue")) &&
methodInsn.desc.equals("(Ljava/lang/Object;Ljava/lang/String;)V")) {
AbstractInsnNode arg2Insn = methodInsn.getPrevious();
AbstractInsnNode arg1Insn = arg2Insn != null ? arg2Insn.getPrevious() : null;
method.instructions.remove(arg1Insn);
method.instructions.remove(arg2Insn);
method.instructions.remove(insn);
}
}
}
}
}

View File

@ -0,0 +1,93 @@
package space.eptaproject.vmodaddon.mixin;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Type;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
import org.objectweb.asm.tree.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
public class MixinPlugin implements IMixinConfigPlugin {
public InstanceHolder<ITransformer> transformerInstanceHolder = new InstanceHolder<>();
@Override
public void onLoad(String mixinPackage) {
}
@Override
public String getRefMapperConfig() {
return null;
}
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return true;
}
@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
}
@Override
public List<String> getMixins() {
return List.of(
"BlockPaletteHashMapV1Mixin",
"PhysicsTrackControllerAccessor",
"PhysicsTrackControllerMixin",
"SimpleWheelControllerAccessor",
"SimpleWheelControllerMixin"
);
}
@Override
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
}
@Override
public void postApply(String targetClassName, ClassNode classNode, String mixinClassName, IMixinInfo mixinInfo) {
String annotationDesc = "Lspace/eptaproject/vmodaddon/mixin/A;";
if (classNode.visibleAnnotations == null) {
classNode.visibleAnnotations = new ArrayList<>();
}
AnnotationNode existing = null;
for (AnnotationNode ann : classNode.visibleAnnotations) {
if (Objects.equals(ann.desc, annotationDesc)) {
existing = ann;
break;
}
}
if (existing != null) {
List<Object> values = existing.values;
for (int i = 0; i < values.size(); i += 2) {
String key = (String) values.get(i);
if (key.equals("value")) {
List<String> list = (List<String>) values.get(i + 1);
if (!list.contains(mixinClassName)) {
list.add(mixinClassName);
}
return;
}
}
values.add("value");
values.add(new ArrayList<>(List.of(mixinClassName)));
} else {
AnnotationNode newAnnotation = new AnnotationNode(annotationDesc);
newAnnotation.values = new ArrayList<>();
newAnnotation.values.add("value");
newAnnotation.values.add(new ArrayList<>(List.of(mixinClassName)));
classNode.visibleAnnotations.add(newAnnotation);
}
//transformerInstanceHolder.get(KotlinOptimizationTransformer.class).transform(targetClassName, classNode, mixinClassName, mixinInfo);
}
}

View File

@ -0,0 +1,12 @@
package space.eptaproject.vmodaddon.mixin;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Transformers {
Class<? extends ITransformer>[] transformers();
}

View File

@ -1,4 +1,4 @@
@ApiStatus.Experimental @ApiStatus.Experimental
package space.eptaproject.vmodextras.mixin; package space.eptaproject.vmodaddon.mixin;
import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.ApiStatus;

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras.mixins; package space.eptaproject.vmodaddon.mixins;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.CrudeIncrementalIntIdentityHashBiMap; import net.minecraft.util.CrudeIncrementalIntIdentityHashBiMap;
@ -13,10 +13,13 @@ import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import space.eptaproject.vmodextras.IValidator; import space.eptaproject.vmodaddon.IValidator;
import space.eptaproject.vmodextras.Validator; import space.eptaproject.vmodaddon.Validator;
import space.eptaproject.vmodaddon.mixin.KotlinOptimizationTransformer;
import space.eptaproject.vmodaddon.mixin.Transformers;
@Mixin(BlockPaletteHashMapV1.class) @Mixin(BlockPaletteHashMapV1.class)
@Transformers(transformers = {KotlinOptimizationTransformer.class})
public class BlockPaletteHashMapV1Mixin { public class BlockPaletteHashMapV1Mixin {
@Unique @Unique
public final IValidator validator = new Validator(); public final IValidator validator = new Validator();

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras.mixins; package space.eptaproject.vmodaddon.mixins;
import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController; import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController;
import org.joml.Vector3dc; import org.joml.Vector3dc;

View File

@ -1,19 +1,31 @@
package space.eptaproject.vmodextras.mixins; package space.eptaproject.vmodaddon.mixins;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController; import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController;
import org.joml.Math; import org.joml.Math;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import space.eptaproject.vmodextras.Config; import org.spongepowered.asm.mixin.Unique;
import space.eptaproject.vmodextras.trackwork.IPhysicsTrackController; import space.eptaproject.vmodaddon.Config;
import space.eptaproject.vmodaddon.IPhysicsTrackController;
@Mixin(PhysicsTrackController.class) @Mixin(PhysicsTrackController.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class PhysicsTrackControllerMixin implements IPhysicsTrackController { public abstract class PhysicsTrackControllerMixin implements IPhysicsTrackController {
@Shadow private volatile float suspensionStiffness; @Shadow private volatile float suspensionStiffness;
@Unique
private volatile float damperCoefficient = 0;
@Override
public void SetRawDamperCoefficient(float delta) {
this.damperCoefficient = delta;
}
@Override
public float GetRawDamperCoefficient() {
return damperCoefficient;
}
/** /**
* @author * @author
* @reason * @reason

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras.mixins; package space.eptaproject.vmodaddon.mixins;
import edn.stratodonut.trackwork.tracks.forces.SimpleWheelController; import edn.stratodonut.trackwork.tracks.forces.SimpleWheelController;
import org.joml.Vector3dc; import org.joml.Vector3dc;

View File

@ -1,23 +1,17 @@
package space.eptaproject.vmodextras.mixins; package space.eptaproject.vmodaddon.mixins;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import edn.stratodonut.trackwork.tracks.forces.SimpleWheelController; import edn.stratodonut.trackwork.tracks.forces.SimpleWheelController;
import org.joml.Math; import org.joml.Math;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import space.eptaproject.vmodextras.Config; import space.eptaproject.vmodaddon.Config;
import space.eptaproject.vmodextras.trackwork.ISimpleWheelController; import space.eptaproject.vmodaddon.ISimpleWheelController;
@Mixin(SimpleWheelController.class) @Mixin(SimpleWheelController.class)
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class SimpleWheelControllerMixin implements ISimpleWheelController { public abstract class SimpleWheelControllerMixin implements ISimpleWheelController {
@Shadow private volatile float suspensionStiffness; @Shadow private volatile float suspensionStiffness;
/**
* @author
* @reason
*/
@Overwrite(remap = false) @Overwrite(remap = false)
public final float setDamperCoefficient(float delta) { public final float setDamperCoefficient(float delta) {
this.suspensionStiffness = Math.clamp(1, Config.Suspension_Stiffness_LIMIT.get(), this.suspensionStiffness + delta); this.suspensionStiffness = Math.clamp(1, Config.Suspension_Stiffness_LIMIT.get(), this.suspensionStiffness + delta);

View File

@ -1,4 +1,4 @@
package space.eptaproject.vmodextras.util; package space.eptaproject.vmodaddon.util;
import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap; import it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap;
import lombok.Getter; import lombok.Getter;

View File

@ -1,115 +0,0 @@
package space.eptaproject.vmodextras.block;
import edn.stratodonut.trackwork.tracks.forces.PhysicsTrackController;
import edn.stratodonut.trackwork.tracks.forces.SimpleWheelController;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import org.valkyrienskies.core.api.ships.ServerShip;
import org.valkyrienskies.mod.common.VSGameUtilsKt;
import space.eptaproject.vmodextras.trackwork.IPhysicsTrackController;
import space.eptaproject.vmodextras.trackwork.ISimpleWheelController;
import space.eptaproject.vmodextras.VmodExtras;
import space.eptaproject.vmodextras.util.IBlockEntityClear;
public class TrackBackupBlockEntity extends BlockEntity implements IBlockEntityClear {
public TrackBackupBlockEntity(BlockPos p_155229_, BlockState p_155230_) {
super(VmodExtras.MY_BLOCK_ENTITY.get(), p_155229_, p_155230_);
}
public CompoundTag tag = new CompoundTag();
@Override
public boolean clear() {
try {
CompoundTag local = tag.copy();
if (local.contains("SimpleWheelController")) {
CompoundTag SimpleWheelControllerTag = new CompoundTag();
SimpleWheelControllerTag.putFloat("SuspensionStiffness", 1);
{
CompoundTag suspensionAdjust = new CompoundTag();
suspensionAdjust.putDouble("x", 0);
suspensionAdjust.putDouble("y", 1);
suspensionAdjust.putDouble("z", 0);
SimpleWheelControllerTag.put("suspensionAdjust", suspensionAdjust);
}
tag.put("SimpleWheelController", SimpleWheelControllerTag);
}
if (local.contains("PhysicsTrackController")) {
CompoundTag PhysicsTrackControllerTag = new CompoundTag();
PhysicsTrackControllerTag.putFloat("SuspensionStiffness", 1);
{
CompoundTag suspensionAdjust = new CompoundTag();
suspensionAdjust.putDouble("x", 0);
suspensionAdjust.putDouble("y", 1);
suspensionAdjust.putDouble("z", 0);
PhysicsTrackControllerTag.put("suspensionAdjust", suspensionAdjust);
}
tag.put("PhysicsTrackController", PhysicsTrackControllerTag);
}
return true;
} catch (Exception e) {
return false;
}
}
@Override
protected void saveAdditional(CompoundTag tag) {
this.tag = tag;
super.saveAdditional(tag);
ServerShip ship = (ServerShip) VSGameUtilsKt.getShipObjectManagingPos(this.level, getBlockPos());
if (ship != null) {
{
PhysicsTrackController physicsTrackController = ship.getAttachment(PhysicsTrackController.class);
if (physicsTrackController != null) {
IPhysicsTrackController controller = (IPhysicsTrackController) physicsTrackController;
CompoundTag local = new CompoundTag();
controller.encode(local);
tag.put("PhysicsTrackController", local);
}
}
{
SimpleWheelController simpleWheelController = ship.getAttachment(SimpleWheelController.class);
if (simpleWheelController != null) {
ISimpleWheelController controller = (ISimpleWheelController) simpleWheelController;
CompoundTag local = new CompoundTag();
controller.encode(local);
tag.put("SimpleWheelController", local);
}
}
}
}
@Override
public void load(CompoundTag tag) {
this.tag = tag;
super.load(tag);
ServerShip ship = (ServerShip) VSGameUtilsKt.getShipObjectManagingPos(this.level, getBlockPos());
if (ship != null) {
if (tag.contains("SimpleWheelController", Tag.TAG_COMPOUND)) {
((ISimpleWheelController) SimpleWheelController.getOrCreate(ship)).decode(tag.getCompound("SimpleWheelController"));
}
if (tag.contains("PhysicsTrackController", Tag.TAG_COMPOUND)) {
((IPhysicsTrackController) PhysicsTrackController.getOrCreate(ship)).decode(tag.getCompound("PhysicsTrackController"));
}
}
}
}

View File

@ -1,50 +0,0 @@
package space.eptaproject.vmodextras.mixin;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
import org.objectweb.asm.tree.*;
import java.util.List;
import java.util.Set;
public class MixinPlugin implements IMixinConfigPlugin {
@Override
public void onLoad(String mixinPackage) {
}
@Override
public String getRefMapperConfig() {
return null;
}
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
return true;
}
@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
}
@Override
public List<String> getMixins() {
return List.of(
"BlockPaletteHashMapV1Mixin",
"PhysicsTrackControllerAccessor",
"PhysicsTrackControllerMixin",
"SimpleWheelControllerAccessor",
"SimpleWheelControllerMixin"
);
}
@Override
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
}
@Override
public void postApply(String targetClassName, ClassNode classNode, String mixinClassName, IMixinInfo mixinInfo) {
}
}

View File

@ -1,9 +0,0 @@
package space.eptaproject.vmodextras.mixins;
import edn.stratodonut.trackwork.items.TrackToolkit;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(TrackToolkit.class)
public class TrackToolkitMixin {
}

View File

@ -1,39 +0,0 @@
package space.eptaproject.vmodextras.trackwork;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;
import org.joml.Vector3d;
import org.joml.Vector3dc;
public interface IController {
float getSuspensionStiffness();
void setSuspensionStiffness(float val);
Vector3dc getSuspensionAdjust();
void setSuspensionAdjust(Vector3dc vector3d);
default void encode(CompoundTag root) {
root.putFloat("SuspensionStiffness", this.getSuspensionStiffness());
{
CompoundTag suspensionAdjust = new CompoundTag();
Vector3dc vec = this.getSuspensionAdjust();
suspensionAdjust.putDouble("x", vec.x());
suspensionAdjust.putDouble("y", vec.y());
suspensionAdjust.putDouble("z", vec.z());
root.put("suspensionAdjust", suspensionAdjust);
}
}
default void decode(CompoundTag root) {
if (root.contains("SuspensionStiffness", Tag.TAG_FLOAT)) {
this.setSuspensionStiffness(root.getFloat("SuspensionStiffness"));
}
if (root.contains("suspensionAdjust", Tag.TAG_COMPOUND)) {
CompoundTag sus = root.getCompound("suspensionAdjust");
this.setSuspensionAdjust(new Vector3d(sus.getDouble("x"), sus.getDouble("y"), sus.getDouble("z")));
}
}
}

View File

@ -1,7 +0,0 @@
package space.eptaproject.vmodextras.trackwork;
import space.eptaproject.vmodextras.mixins.PhysicsTrackControllerAccessor;
public interface IPhysicsTrackController extends PhysicsTrackControllerAccessor, IController {
}

View File

@ -1,6 +0,0 @@
package space.eptaproject.vmodextras.trackwork;
import space.eptaproject.vmodextras.mixins.SimpleWheelControllerAccessor;
public interface ISimpleWheelController extends SimpleWheelControllerAccessor, IController {
}

View File

@ -1,34 +0,0 @@
package space.eptaproject.vmodextras.trackwork.item;
import net.minecraft.core.BlockPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.Level;
public class ToolKit extends Item {
public ToolKit(Item.Properties properties) {
super(properties);
}
@Override
public InteractionResult onItemUseFirst(ItemStack stack, UseOnContext context) {
Player player = context.getPlayer();
if (player != null && player.mayBuild()) {
Level level = context.getLevel();
BlockPos pos = context.getClickedPos();
CompoundTag nbt = stack.getTag();
return InteractionResult.PASS;
} else {
return InteractionResult.PASS;
}
}
public enum Mode {
CLEAR
}
}

View File

@ -1,8 +0,0 @@
package space.eptaproject.vmodextras.util;
public interface IBlockEntityClear {
boolean clear();
default boolean reset() {
return clear();
}
}

View File

@ -1,21 +1,63 @@
modLoader = "javafml" # This is an example mods.toml file. It contains the data relating to the loading mods.
loaderVersion = "${loader_version_range}" # There are several mandatory fields (#mandatory), and many more that are optional (#optional).
# The overall format is standard TOML format, v0.5.0.
# Note that there are a couple of TOML lists in this file.
# Find more information on toml format here: https://github.com/toml-lang/toml
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader = "javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion = "${loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license = "${mod_license}" license = "${mod_license}"
[[mods]] # A URL to refer people to when problems occur with this mod
modId = "${mod_id}" #issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional
version = "${mod_version}" # A list of mods - how many allowed here is determined by the individual mod loader
displayName = "${mod_name}" [[mods]] #mandatory
authors = "${mod_authors}" # The modid of the mod
modId = "${mod_id}" #mandatory
# The version number of the mod
version = "${mod_version}" #mandatory
# A display name for the mod
displayName = "${mod_name}" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
#logoFile="vmodaddon.png" #optional
# A text field displayed in the mod UI
#credits="Thanks for this example mod goes to Java" #optional
# A text field displayed in the mod UI
authors = "${mod_authors}" #optional
# Display Test controls the display for your mod in the server connection screen
# MATCH_VERSION means that your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod.
# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod.
# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component.
# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value.
# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED SERVER) your mod loads on. Your mod should load (and maybe do nothing!) whereever it finds itself.
#displayTest="MATCH_VERSION" # MATCH_VERSION is the default if nothing is specified (#optional)
# The description text for the mod (multi line!) (#mandatory)
description = '''${mod_description}''' description = '''${mod_description}'''
[[dependencies."${mod_id}"]] # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional.
modId = "forge" [[dependencies."${mod_id}"]] #optional
mandatory = true # the modid of the dependency
versionRange = "${forge_version_range}" modId = "forge" #mandatory
# Does this dependency have to exist - if not, ordering below must be specified
mandatory = true #mandatory
# The version range of the dependency
versionRange = "${forge_version_range}" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory
# BEFORE - This mod is loaded BEFORE the dependency
# AFTER - This mod is loaded AFTER the dependency
ordering = "NONE" ordering = "NONE"
side = "SERVER" # Side this dependency is applied on - BOTH, CLIENT, or SERVER
side = "SERVER"# Here's another dependency
[[dependencies."${mod_id}"]] [[dependencies."${mod_id}"]]
modId = "minecraft" modId = "minecraft"
mandatory = true mandatory = true
# This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange = "${minecraft_version_range}" versionRange = "${minecraft_version_range}"
ordering = "NONE" ordering = "NONE"
side = "BOTH" side = "BOTH"

View File

@ -0,0 +1,5 @@
{
"variants": {
"": { "model": "vmodaddon:block/track_b" }
}
}

View File

@ -0,0 +1,4 @@
{
"block.vmodaddon.track_b": "Track Backup",
"block.vmodaddon.ship_void": "Ship Void"
}

View File

@ -2,8 +2,8 @@
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"texture_size": [64, 64], "texture_size": [64, 64],
"textures": { "textures": {
"1": "vmodextras:block/track_backup", "1": "vmodaddon:block/track_b",
"particle": "vmodextras:block/track_backup" "particle": "vmodaddon:block/track_b"
}, },
"elements": [ "elements": [
{ {

View File

@ -2,8 +2,8 @@
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"texture_size": [64, 64], "texture_size": [64, 64],
"textures": { "textures": {
"1": "vmodextras:block/track_backup", "1": "vmodaddon:block/track_b",
"particle": "vmodextras:block/track_backup" "particle": "vmodaddon:block/track_b"
}, },
"elements": [ "elements": [
{ {

View File

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 434 B

View File

@ -1,5 +0,0 @@
{
"variants": {
"": { "model": "vmodextras:block/track_backup" }
}
}

View File

@ -1,4 +0,0 @@
{
"block.vmodextras.track_backup": "Track Backup",
"block.vmodextras.ship_void": "Ship Void"
}

View File

@ -0,0 +1,12 @@
[
{
"block": "vmodaddon:ship_void",
"mass": 0.0,
"friction": 0.0
},
{
"block": "vmodaddon:track_b",
"mass": 40.0,
"friction": 0.0
}
]

View File

@ -1,17 +0,0 @@
[
{
"block": "vmodextras:ship_void",
"mass": 0.0,
"friction": 0.0
},
{
"block": "vmodextras:track_backup",
"mass": 120.0,
"friction": 0.0
},
{
"block": "vmodextras:compact_backup",
"mass": 120.0,
"friction": 0.0
}
]

View File

@ -1,9 +1,9 @@
{ {
"required": true, "required": true,
"minVersion": "0.8", "minVersion": "0.8",
"package": "space.eptaproject.vmodextras.mixins", "package": "space.eptaproject.vmodaddon.mixins",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_8",
"refmap": "vmodextras.refmap.json", "refmap": "vmodaddon.refmap.json",
"mixins": [ "mixins": [
], ],
"client": [ "client": [
@ -11,5 +11,5 @@
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1
}, },
"plugin": "space.eptaproject.vmodextras.mixin.MixinPlugin" "plugin": "space.eptaproject.vmodaddon.mixin.MixinPlugin"
} }