Update to 1.20.1
This commit is contained in:
parent
0066b86d18
commit
f3b1ccbd3a
20 changed files with 200 additions and 166 deletions
|
@ -8,7 +8,8 @@ import java.util.Iterator;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import dev.zontreck.ariaslib.events.EventBus;
|
||||
import dev.zontreck.ariaslib.util.DelayedExecutorService;
|
||||
import dev.zontreck.eventsbus.Bus;
|
||||
import dev.zontreck.libzontreck.currency.Bank;
|
||||
import dev.zontreck.libzontreck.currency.CurrencyHelper;
|
||||
import dev.zontreck.libzontreck.networking.NetworkEvents;
|
||||
|
@ -16,7 +17,6 @@ import org.slf4j.Logger;
|
|||
|
||||
import com.mojang.logging.LogUtils;
|
||||
|
||||
import dev.zontreck.ariaslib.util.DelayedExecutorService;
|
||||
import dev.zontreck.libzontreck.commands.Commands;
|
||||
import dev.zontreck.libzontreck.events.ForgeEventHandlers;
|
||||
import dev.zontreck.libzontreck.memory.VolatilePlayerStorage;
|
||||
|
@ -80,8 +80,10 @@ public class LibZontreck {
|
|||
MinecraftForge.EVENT_BUS.register(new ForgeEventHandlers());
|
||||
MinecraftForge.EVENT_BUS.register(new Commands());
|
||||
MinecraftForge.EVENT_BUS.register(new NetworkEvents());
|
||||
EventBus.BUS.register(CurrencyHelper.class);
|
||||
EventBus.BUS.register(Bank.class);
|
||||
|
||||
|
||||
Bus.Register(CurrencyHelper.class, null);
|
||||
Bus.Register(Bank.class, null);
|
||||
}
|
||||
|
||||
private void setup(final FMLCommonSetupEvent event)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package dev.zontreck.libzontreck.currency;
|
||||
|
||||
import dev.zontreck.ariaslib.events.EventBus;
|
||||
|
||||
import dev.zontreck.eventsbus.Bus;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.currency.events.TransactionHistoryFlushEvent;
|
||||
import dev.zontreck.libzontreck.profiles.Profile;
|
||||
|
@ -11,6 +12,7 @@ import net.minecraft.nbt.ListTag;
|
|||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.nbt.Tag;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
@ -88,12 +90,17 @@ public class Account
|
|||
* When the TX history grows beyond 20, the history should clear and it should get transferred to the long-term tx history storage. That file is not retained in memory, and only gets loaded when clearing to merge the lists. It is immediately saved and unloaded
|
||||
* @see LongTermTransactionHistoryRecord
|
||||
*/
|
||||
public void flushTxHistory()
|
||||
{
|
||||
public void flushTxHistory() {
|
||||
LongTermTransactionHistoryRecord rec = LongTermTransactionHistoryRecord.of(player_id);
|
||||
rec.addHistory(history);
|
||||
rec.commit();
|
||||
EventBus.BUS.post(new TransactionHistoryFlushEvent(this, rec, history));
|
||||
try {
|
||||
Bus.Post(new TransactionHistoryFlushEvent(this, rec, history));
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
rec = null;
|
||||
history = new ArrayList<>();
|
||||
}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package dev.zontreck.libzontreck.currency;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import dev.zontreck.ariaslib.events.Event;
|
||||
import dev.zontreck.ariaslib.events.EventBus;
|
||||
import dev.zontreck.ariaslib.events.annotations.Subscribe;
|
||||
import dev.zontreck.eventsbus.Bus;
|
||||
import dev.zontreck.eventsbus.Subscribe;
|
||||
import dev.zontreck.libzontreck.LibZontreck;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.chat.ChatColorFactory;
|
||||
|
@ -25,6 +24,7 @@ import net.minecraft.nbt.Tag;
|
|||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -81,11 +81,15 @@ public class Bank
|
|||
accounts.add(new Account((CompoundTag) t));
|
||||
}
|
||||
|
||||
EventBus.BUS.post(new BankReadyEvent());
|
||||
Bus.Post(new BankReadyEvent());
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not use manually, this saves the bank data to disk. This is fired automatically when transactions are posted to accounts.
|
||||
|
@ -128,8 +132,15 @@ public class Bank
|
|||
instance.accounts.add(new Account(ID));
|
||||
|
||||
instance.commit();
|
||||
EventBus.BUS.post(new BankAccountCreatedEvent(getAccount(ID)));
|
||||
}else return;
|
||||
try {
|
||||
Bus.Post(new BankAccountCreatedEvent(getAccount(ID)));
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}else {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,10 +150,10 @@ public class Bank
|
|||
* @param tx The transaction being attempted
|
||||
* @return True if the transaction has been accepted. False if the transaction was rejected, or insufficient funds.
|
||||
*/
|
||||
protected static boolean postTx(Transaction tx) throws InvalidSideException {
|
||||
protected static boolean postTx(Transaction tx) throws InvalidSideException, InvocationTargetException, IllegalAccessException {
|
||||
if(ServerUtilities.isClient())return false;
|
||||
TransactionEvent ev = new TransactionEvent(tx);
|
||||
if(EventBus.BUS.post(ev))
|
||||
if(Bus.Post(ev))
|
||||
{
|
||||
// Send the list of reasons to the user
|
||||
String reasonStr = String.join("\n", ev.reasons);
|
||||
|
@ -207,8 +218,9 @@ public class Bank
|
|||
Profile.unload(fromProf);
|
||||
|
||||
|
||||
EventBus.BUS.post(new WalletUpdatedEvent(from.player_id, fromOld, from.balance, tx));
|
||||
EventBus.BUS.post(new WalletUpdatedEvent(to.player_id, toOld, to.balance, tx));
|
||||
Bus.Post(new WalletUpdatedEvent(from.player_id, fromOld, from.balance, tx));
|
||||
|
||||
Bus.Post(new WalletUpdatedEvent(to.player_id, toOld, to.balance, tx));
|
||||
|
||||
if(from.isValidPlayer() && !ServerUtilities.playerIsOffline(from.player_id))
|
||||
{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package dev.zontreck.libzontreck.currency;
|
||||
|
||||
import dev.zontreck.ariaslib.events.annotations.Subscribe;
|
||||
|
||||
public class CurrencyHelper {
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import dev.zontreck.libzontreck.exceptions.InvalidSideException;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Date;
|
||||
|
||||
public class Transaction
|
||||
|
@ -48,7 +49,7 @@ public class Transaction
|
|||
public boolean submit(){
|
||||
try {
|
||||
return Bank.postTx(this);
|
||||
} catch (InvalidSideException e) {
|
||||
} catch (InvalidSideException | InvocationTargetException | IllegalAccessException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package dev.zontreck.libzontreck.currency.events;
|
||||
|
||||
|
||||
import dev.zontreck.ariaslib.events.Event;
|
||||
import dev.zontreck.eventsbus.Event;
|
||||
import dev.zontreck.libzontreck.currency.Account;
|
||||
|
||||
public class BankAccountCreatedEvent extends Event
|
||||
|
@ -11,9 +11,4 @@ public class BankAccountCreatedEvent extends Event
|
|||
{
|
||||
account=act;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancellable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package dev.zontreck.libzontreck.currency.events;
|
||||
|
||||
import dev.zontreck.ariaslib.events.Event;
|
||||
|
||||
import dev.zontreck.eventsbus.Event;
|
||||
|
||||
/**
|
||||
* Contains no information by itself, it only signals that the Bank is open for business
|
||||
|
@ -10,8 +11,4 @@ import dev.zontreck.ariaslib.events.Event;
|
|||
public class BankReadyEvent extends Event
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean isCancellable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
package dev.zontreck.libzontreck.currency.events;
|
||||
|
||||
import dev.zontreck.ariaslib.events.Event;
|
||||
|
||||
import dev.zontreck.eventsbus.Cancellable;
|
||||
import dev.zontreck.eventsbus.Event;
|
||||
import dev.zontreck.libzontreck.currency.Transaction;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.List;
|
||||
|
||||
@Cancellable
|
||||
public class TransactionEvent extends Event
|
||||
{
|
||||
public Transaction tx;
|
||||
|
@ -18,9 +23,4 @@ public class TransactionEvent extends Event
|
|||
{
|
||||
tx=txNew;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancellable() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package dev.zontreck.libzontreck.currency.events;
|
||||
|
||||
import dev.zontreck.ariaslib.events.Event;
|
||||
|
||||
import dev.zontreck.eventsbus.Event;
|
||||
import dev.zontreck.libzontreck.currency.Account;
|
||||
import dev.zontreck.libzontreck.currency.LongTermTransactionHistoryRecord;
|
||||
import dev.zontreck.libzontreck.currency.Transaction;
|
||||
|
@ -19,9 +20,4 @@ public class TransactionHistoryFlushEvent extends Event
|
|||
this.txHistory=txHistory;
|
||||
this.flushed=flushed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancellable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.zontreck.libzontreck.currency.events;
|
||||
|
||||
import dev.zontreck.ariaslib.events.Event;
|
||||
import dev.zontreck.eventsbus.Event;
|
||||
import dev.zontreck.libzontreck.currency.Transaction;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
|
@ -23,8 +23,4 @@ public class WalletUpdatedEvent extends Event
|
|||
this.newBal = newBal;
|
||||
this.tx=tx;
|
||||
}
|
||||
@Override
|
||||
public boolean isCancellable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package dev.zontreck.libzontreck.events;
|
||||
|
||||
import dev.zontreck.ariaslib.events.EventBus;
|
||||
import dev.zontreck.ariaslib.terminal.Task;
|
||||
import dev.zontreck.ariaslib.util.DelayedExecutorService;
|
||||
import dev.zontreck.libzontreck.LibZontreck;
|
||||
|
@ -25,11 +24,10 @@ public class ForgeEventHandlers {
|
|||
@SubscribeEvent
|
||||
public void onPlayerTick(LivingEvent.LivingTickEvent ev)
|
||||
{
|
||||
if(ev.getEntity().level.isClientSide)return;
|
||||
if(ev.getEntity().level().isClientSide) return;
|
||||
|
||||
if(ev.getEntity() instanceof ServerPlayer)
|
||||
if(ev.getEntity() instanceof ServerPlayer player)
|
||||
{
|
||||
ServerPlayer player = (ServerPlayer)ev.getEntity();
|
||||
PlayerContainer cont = LibZontreck.playerStorage.get(player.getUUID());
|
||||
|
||||
if(cont.player.positionChanged())
|
||||
|
@ -45,11 +43,11 @@ public class ForgeEventHandlers {
|
|||
@SubscribeEvent
|
||||
public void onPlayerJoin(final PlayerEvent.PlayerLoggedInEvent ev)
|
||||
{
|
||||
if(ev.getEntity().level.isClientSide)return;
|
||||
if(ev.getEntity().level().isClientSide)return;
|
||||
|
||||
ServerPlayer player = (ServerPlayer)ev.getEntity();
|
||||
Profile prof = Profile.factory(player);
|
||||
ServerLevel level = player.getLevel();
|
||||
ServerLevel level = player.serverLevel();
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new ProfileLoadedEvent(prof, player, level));
|
||||
|
||||
|
@ -65,7 +63,7 @@ public class ForgeEventHandlers {
|
|||
@SubscribeEvent
|
||||
public void onLeave(final PlayerEvent.PlayerLoggedOutEvent ev)
|
||||
{
|
||||
if(ev.getEntity().level.isClientSide)return;
|
||||
if(ev.getEntity().level().isClientSide)return;
|
||||
// Get player profile, send disconnect alert, then commit profile and remove it from memory
|
||||
Profile px=null;
|
||||
try {
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraftforge.eventbus.api.Event;
|
|||
/**
|
||||
* Used to register your packets with LibZontreck. Packets must extend IPacket and implement PacketSerializable. This is dispatched on both logical sides, and is considered a final event. It is not cancelable
|
||||
* @see IPacket
|
||||
* @see PacketSerializable
|
||||
*/
|
||||
public class RegisterPacketsEvent extends Event
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@ package dev.zontreck.libzontreck.exceptions;
|
|||
|
||||
/**
|
||||
* Thrown when requesting a world position's level on the client when in the wrong dimension.
|
||||
* @see WorldPosition
|
||||
*/
|
||||
public class InvalidSideException extends Exception
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package dev.zontreck.libzontreck.networking.packets;
|
||||
|
||||
import dev.zontreck.ariaslib.events.EventBus;
|
||||
import dev.zontreck.eventsbus.Bus;
|
||||
import dev.zontreck.libzontreck.currency.Transaction;
|
||||
import dev.zontreck.libzontreck.currency.events.WalletUpdatedEvent;
|
||||
import dev.zontreck.libzontreck.util.ServerUtilities;
|
||||
|
@ -10,6 +10,7 @@ import net.minecraftforge.network.NetworkDirection;
|
|||
import net.minecraftforge.network.NetworkEvent;
|
||||
import net.minecraftforge.network.simple.SimpleChannel;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.UUID;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
@ -62,7 +63,13 @@ public class S2CWalletUpdatedPacket implements IPacket
|
|||
return ServerUtilities.handlePacket(supplier, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
EventBus.BUS.post(new WalletUpdatedEvent(ID, oldBal, balance, tx));
|
||||
try {
|
||||
Bus.Post(new WalletUpdatedEvent(ID, oldBal, balance, tx));
|
||||
} catch (InvocationTargetException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -8,20 +8,18 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
public class WorldPosition
|
||||
{
|
||||
|
||||
public class WorldPosition {
|
||||
|
||||
public Vector3 Position;
|
||||
public String Dimension;
|
||||
public String DimSafe;
|
||||
|
||||
public WorldPosition(CompoundTag tag, boolean pretty) throws InvalidDeserialization
|
||||
{
|
||||
if(pretty){
|
||||
public WorldPosition(CompoundTag tag, boolean pretty) throws InvalidDeserialization {
|
||||
if (pretty) {
|
||||
|
||||
Position = new Vector3(tag.getString("Position"));
|
||||
Dimension = tag.getString("Dimension");
|
||||
}else {
|
||||
} else {
|
||||
Position = new Vector3(tag.getCompound("pos"));
|
||||
Dimension = tag.getString("Dimension");
|
||||
}
|
||||
|
@ -30,64 +28,57 @@ public class WorldPosition
|
|||
|
||||
}
|
||||
|
||||
public WorldPosition(Vector3 pos, String dim)
|
||||
{
|
||||
Position=pos;
|
||||
Dimension=dim;
|
||||
public WorldPosition(Vector3 pos, String dim) {
|
||||
Position = pos;
|
||||
Dimension = dim;
|
||||
calcDimSafe();
|
||||
}
|
||||
|
||||
public WorldPosition(ServerPlayer player)
|
||||
{
|
||||
this(new Vector3(player.position()), player.getLevel());
|
||||
public WorldPosition(ServerPlayer player) {
|
||||
this(new Vector3(player.position()), player.serverLevel());
|
||||
}
|
||||
|
||||
public WorldPosition(Vector3 pos, ServerLevel lvl)
|
||||
{
|
||||
Position=pos;
|
||||
Dimension = lvl.dimension().location().getNamespace() + ":"+lvl.dimension().location().getPath();
|
||||
public WorldPosition(Vector3 pos, ServerLevel lvl) {
|
||||
Position = pos;
|
||||
Dimension = lvl.dimension().location().getNamespace() + ":" + lvl.dimension().location().getPath();
|
||||
calcDimSafe();
|
||||
}
|
||||
|
||||
public void calcDimSafe()
|
||||
{
|
||||
public void calcDimSafe() {
|
||||
ServerLevel lvl = getActualDimension();
|
||||
DimSafe = lvl.dimension().location().getNamespace() + "-" + lvl.dimension().location().getPath();
|
||||
}
|
||||
public static String getDimSafe(ServerLevel lvl)
|
||||
{
|
||||
|
||||
public static String getDimSafe(ServerLevel lvl) {
|
||||
return lvl.dimension().location().getNamespace() + "-" + lvl.dimension().location().getPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives you the dimension string modid:dimension
|
||||
*
|
||||
* @param lvl
|
||||
* @return dimension string
|
||||
*/
|
||||
public static String getDim(ServerLevel lvl)
|
||||
{
|
||||
public static String getDim(ServerLevel lvl) {
|
||||
return lvl.dimension().location().getNamespace() + ":" + lvl.dimension().location().getPath();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
public String toString() {
|
||||
return NbtUtils.structureToSnbt(serialize());
|
||||
}
|
||||
|
||||
public CompoundTag serializePretty()
|
||||
{
|
||||
public CompoundTag serializePretty() {
|
||||
CompoundTag tag = new CompoundTag();
|
||||
|
||||
|
||||
tag.putString("Position", Position.toString());
|
||||
tag.putString("Dimension", Dimension);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
public CompoundTag serialize()
|
||||
{
|
||||
public CompoundTag serialize() {
|
||||
CompoundTag tag = new CompoundTag();
|
||||
tag.put("pos", Position.serialize());
|
||||
tag.putString("Dimension", Dimension);
|
||||
|
@ -95,46 +86,40 @@ public class WorldPosition
|
|||
return tag;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ServerLevel getActualDimension()
|
||||
{
|
||||
|
||||
public ServerLevel getActualDimension() {
|
||||
|
||||
String dim = Dimension;
|
||||
String[] dims = dim.split(":");
|
||||
|
||||
ResourceLocation rl = new ResourceLocation(dims[0], dims[1]);
|
||||
ServerLevel dimL = null;
|
||||
ServerLevel dimL = null;
|
||||
for (ServerLevel lServerLevel : LibZontreck.THE_SERVER.getAllLevels()) {
|
||||
ResourceLocation XL = lServerLevel.dimension().location();
|
||||
|
||||
if(XL.getNamespace().equals(rl.getNamespace())){
|
||||
if(XL.getPath().equals(rl.getPath())){
|
||||
if (XL.getNamespace().equals(rl.getNamespace())) {
|
||||
if (XL.getPath().equals(rl.getPath())) {
|
||||
dimL = lServerLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(dimL == null)
|
||||
{
|
||||
LibZontreck.LOGGER.error("DIMENSION COULD NOT BE FOUND : "+Dimension);
|
||||
if (dimL == null) {
|
||||
LibZontreck.LOGGER.error("DIMENSION COULD NOT BE FOUND : " + Dimension);
|
||||
return null;
|
||||
}
|
||||
|
||||
return dimL;
|
||||
}
|
||||
|
||||
|
||||
public boolean same(WorldPosition other)
|
||||
{
|
||||
if(Position.same(other.Position) && Dimension == other.Dimension)return true;
|
||||
else return false;
|
||||
|
||||
public boolean same(WorldPosition other) {
|
||||
return Position.same(other.Position) && Dimension == other.Dimension;
|
||||
}
|
||||
|
||||
public ChunkPos getChunkPos()
|
||||
{
|
||||
public ChunkPos getChunkPos() {
|
||||
net.minecraft.world.level.ChunkPos mcChunk = getActualDimension().getChunkAt(Position.asBlockPos()).getPos();
|
||||
ChunkPos pos = new ChunkPos(new Vector3(mcChunk.getMinBlockX(),-70,mcChunk.getMinBlockZ()), new Vector3(mcChunk.getMaxBlockX(), 400, mcChunk.getMaxBlockZ()), getActualDimension());
|
||||
ChunkPos pos = new ChunkPos(new Vector3(mcChunk.getMinBlockX(), -70, mcChunk.getMinBlockZ()), new Vector3(mcChunk.getMaxBlockX(), 400, mcChunk.getMaxBlockZ()), getActualDimension());
|
||||
pos.centerPoints = new Vector2(mcChunk.getMiddleBlockX(), mcChunk.getMiddleBlockZ());
|
||||
|
||||
return pos;
|
||||
|
|
|
@ -6,22 +6,22 @@
|
|||
# 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="[44,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
|
||||
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="GPLv3"
|
||||
license="${mod_license}"
|
||||
# A URL to refer people to when problems occur with this mod
|
||||
issueTrackerURL="https://github.com/zontreck/LibZontreckMod/issues" #optional
|
||||
# A list of mods - how many allowed here is determined by the individual mod loader
|
||||
[[mods]] #mandatory
|
||||
# The modid of the mod
|
||||
modId="libzontreck" #mandatory
|
||||
modId="${mod_id}" #mandatory
|
||||
# The version number of the mod - there's a few well known ${} variables useable here or just hardcode it
|
||||
# ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata
|
||||
# see the associated build.gradle script for how to populate this completely automatically during a build
|
||||
version="${file.jarVersion}" #mandatory
|
||||
# A display name for the mod
|
||||
displayName="LibZontreck" #mandatory
|
||||
displayName="${mod_name}" #mandatory
|
||||
# A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/
|
||||
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
|
||||
# A URL for the "homepage" for this mod, displayed in the mod UI
|
||||
|
@ -29,9 +29,9 @@ displayName="LibZontreck" #mandatory
|
|||
# A file name (in the root of the mod JAR) containing a logo for display
|
||||
logoFile="library.png" #optional
|
||||
# A text field displayed in the mod UI
|
||||
credits="Zontreck" #optional
|
||||
#credits="Zontreck" #optional
|
||||
# A text field displayed in the mod UI
|
||||
authors="Zontreck" #optional
|
||||
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.
|
||||
|
@ -52,7 +52,7 @@ This mod provides common code to all of zontreck's mods.
|
|||
# Does this dependency have to exist - if not, ordering below must be specified
|
||||
mandatory=true #mandatory
|
||||
# The version range of the dependency
|
||||
versionRange="[44,)" #mandatory
|
||||
versionRange="${loader_version_range}" #mandatory
|
||||
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
|
||||
ordering="NONE"
|
||||
# Side this dependency is applied on - BOTH, CLIENT or SERVER
|
||||
|
@ -62,6 +62,6 @@ This mod provides common code to all of zontreck's mods.
|
|||
modId="minecraft"
|
||||
mandatory=true
|
||||
# This version range declares a minimum of the current minecraft version up to but not including the next major version
|
||||
versionRange="[1.19.3,1.20)"
|
||||
versionRange="${minecraft_range}"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
|
Reference in a new issue