Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tags #13

Merged
merged 5 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 89 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,55 @@ autoUpdateBuildScript = false
minecraftVersion = 1.7.10
forgeVersion = 10.13.4.1614

# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task.
channel = stable
mappingsVersion = 12

# Define other MCP mappings for dependency deobfuscation
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/

# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
developmentEnvironmentUserName = Developer

# Define a source file of your project with:
# Enables using modern java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true

# Enables injecting missing generics into the decompiled source code for a better coding experience
# Turns most publicly visible List, Map, etc. into proper List<Type>, Map<K, V> types
enableGenericInjection = true

# Generate a class with String fields for the mod id, name, version and group name named with the fields below
generateGradleTokenClass = mcp.mobius.Tags
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion = VERSION
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-seperated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = modOpis.java,CoreContainer.java
gradleTokenModId = GRADLETOKEN_MODID
gradleTokenModName = GRADLETOKEN_MODNAME
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName = GRADLETOKEN_GROUPNAME
replaceGradleTokenInFile =

# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
apiPackage = opis.api

# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile = mobius_at.cfg

# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Adds some debug arguments like verbose output and export
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
Expand All @@ -55,6 +76,9 @@ coreModClass = mobiuscore.asm.CoreDescription
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false

# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false

# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
usesShadowedDependencies = true
Expand All @@ -64,9 +88,65 @@ minimizeShadowedDependencies = false
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true

# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories
includeWellKnownRepositories = true

# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USERNAME and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# mavenPublishUrl = http://jenkins.usrv.eu:8081/nexus/content/repositories/releases

# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.

# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish on Modrinth.
modrinthProjectId =

# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =


# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.

# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =

# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
curseForgeRelations =


# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# projects. New projects should not use this parameter.
#customArchiveBaseName =
# customArchiveBaseName =

# Optional parameter to prevent the source code from being published
# noPublishedSources =
# noPublishedSources =

# Uncomment this to disable spotless checks
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
# disableSpotless = true

# Uncomment this to disable checkstyle checks (currently wildcard import check).
# disableCheckstyle = true

# Override the IDEA build type. Valid value is "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be always native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
3 changes: 2 additions & 1 deletion src/main/java/mcp/mobius/mobiuscore/asm/CoreContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.LoadController;
import cpw.mods.fml.common.ModMetadata;
import mcp.mobius.Tags;

public class CoreContainer extends DummyModContainer {

Expand All @@ -16,7 +17,7 @@ public CoreContainer() {
ModMetadata md = getMetadata();
md.modId = "MobiusCore";
md.name = "MobiusCore";
md.version = "GRADLETOKEN_VERSION";
md.version = Tags.VERSION;
md.credits = "ProfMobius";
md.authorList = Arrays.asList("ProfMobius");
md.description = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

public class MonitoredEntityList<E> extends MonitoredList<E> {

private static final long serialVersionUID = 9184692038032137709L;
private Map<String, Integer> count = new HashMap<String, Integer>();

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

public abstract class MonitoredList<E> extends ArrayList<E> {

private static final long serialVersionUID = 8542841497500505801L;

abstract void addCount(E e);

abstract void removeCount(int index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

public class MonitoredTileList<E> extends MonitoredList<E> {

private static final long serialVersionUID = -2243048028307261560L;
// private Map<String, Integer> count = new HashMap<String, Integer>();
private Table<Block, Integer, Integer> count = HashBasedTable.create();
private Map<Object, BlockData> blockdata = new WeakHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public String getCommandUsage(ICommandSender icommandsender) {
}

@Override
@SuppressWarnings("unchecked")
public void processCommand(ICommandSender icommandsender, String[] astring) {
modOpis.log.log(Level.INFO, "== CHUNK DUMP ==");

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/mcp/mobius/opis/data/holders/DataType.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ public enum DataType {
CONNECTIONPROPERTIES(ConnectionProperties.class),
CHATMSG(ChatMsg.class);

private Class clazz;
private static HashBiMap<DataType, Class> bimap = HashBiMap.create(50);
private Class<?> clazz;
private static HashBiMap<DataType, Class<?>> bimap = HashBiMap.create(50);

static {
for (DataType type : DataType.values()) bimap.put(type, type.clazz);
}

private DataType(Class clazz) {
private DataType(Class<?> clazz) {
this.clazz = clazz;
}

public static DataType getForClass(Class clazz) {
public static DataType getForClass(Class<?> clazz) {
DataType type = bimap.inverse().get(clazz);
if (type == null) {
modOpis.log.warn(String.format("Class %s was not registered with the DataType enum", clazz));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void writeToSteam(DataOutputStream stream) throws IOException {
}
}

public static SerialNumeral readFromStream(DataInputStream stream) throws IOException {
public static SerialNumeral<? extends Number> readFromStream(DataInputStream stream) throws IOException {
Type datatype = Type.values()[stream.readByte()];
switch (datatype) {
case DOUBLE: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ public final class TicketData implements ISerializable {
public final Ticket ticket;

public TicketData(Ticket ticket) {
ImmutableSet requestedChunks = ticket.getChunkList();
ImmutableSet<ChunkCoordIntPair> requestedChunks = ticket.getChunkList();
int maxChunkX = -999999, minChunkX = 9999999, maxChunkZ = -999999, minChunkZ = 9999999;

for (Object obj : requestedChunks) {
ChunkCoordIntPair chunk = (ChunkCoordIntPair) obj;
for (ChunkCoordIntPair chunk : requestedChunks) {
maxChunkX = Math.max(maxChunkX, chunk.chunkXPos);
minChunkX = Math.min(minChunkX, chunk.chunkXPos);
maxChunkZ = Math.max(maxChunkZ, chunk.chunkZPos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import mcp.mobius.opis.data.holders.newtypes.DataTiming;

public class DataRenderEvent implements Comparable {
public class DataRenderEvent implements Comparable<DataRenderEvent> {

public String event;
public String handler;
Expand All @@ -15,7 +15,7 @@ public class DataRenderEvent implements Comparable {
public long nCalls;
public DataTiming update;

public DataRenderEvent fill(Cell<Class, String, DescriptiveStatistics> cellData, String modName) {
public DataRenderEvent fill(Cell<Class<?>, String, DescriptiveStatistics> cellData, String modName) {
/*
* String handlerName = cell.getColumnKey().getSimpleName(); try { String[] splitHandler =
* handlerName.split("_"); handlerName = splitHandler[2] + "." + splitHandler[3]; } catch (Exception e){}
Expand All @@ -39,7 +39,7 @@ public DataRenderEvent fill(Cell<Class, String, DescriptiveStatistics> cellData,
}

@Override
public int compareTo(Object o) {
return this.update.compareTo(((DataRenderEvent) o).update);
public int compareTo(DataRenderEvent o) {
return this.update.compareTo(o.update);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import mcp.mobius.opis.data.managers.StringCache;
import mcp.mobius.opis.helpers.Helpers;

public class CachedString implements Comparable, ISerializable {
public class CachedString implements Comparable<CachedString>, ISerializable {

public String str;
public int index;
Expand All @@ -33,8 +33,8 @@ public CachedString(String str) {
}

@Override
public int compareTo(Object o) {
return ((CachedString) o).str.compareTo(this.str); // Reverse order ! Put higher values FIRST
public int compareTo(CachedString o) {
return o.str.compareTo(this.str); // Reverse order ! Put higher values FIRST
}

public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import mcp.mobius.opis.data.holders.ISerializable;

public class DataAmountRate implements Comparable, ISerializable {
public class DataAmountRate implements Comparable<DataAmountRate>, ISerializable {

public Long size; // Size is stored in byte
public int interval;
Expand All @@ -17,8 +17,8 @@ public DataAmountRate(long size, int interval) {
}

@Override
public int compareTo(Object o) {
return ((DataAmountRate) o).size.compareTo(this.size); // Reverse order ! Put higher values FIRST
public int compareTo(DataAmountRate o) {
return o.size.compareTo(this.size); // Reverse order ! Put higher values FIRST
}

public void reset() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import mcp.mobius.opis.data.holders.ISerializable;
import mcp.mobius.opis.helpers.ModIdentification;

public class DataBlockTileEntityPerClass implements ISerializable, Comparable {
public class DataBlockTileEntityPerClass implements ISerializable, Comparable<DataBlockTileEntityPerClass> {

public int id;
public int meta;
Expand Down Expand Up @@ -67,7 +67,7 @@ public static DataBlockTileEntityPerClass readFromStream(ByteArrayDataInput stre
}

@Override
public int compareTo(Object o) {
return this.update.compareTo(((DataBlockTileEntityPerClass) o).update);
public int compareTo(DataBlockTileEntityPerClass o) {
return this.update.compareTo(o.update);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import mcp.mobius.opis.data.holders.ISerializable;

public class DataByteRate implements Comparable, ISerializable {
public class DataByteRate implements Comparable<DataByteRate>, ISerializable {

public Long size; // Size is stored in byte
public int interval;
Expand All @@ -17,8 +17,8 @@ public DataByteRate(long size, int interval) {
}

@Override
public int compareTo(Object o) {
return ((DataByteRate) o).size.compareTo(this.size); // Reverse order ! Put higher values FIRST
public int compareTo(DataByteRate o) {
return o.size.compareTo(this.size); // Reverse order ! Put higher values FIRST
}

public void reset() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import mcp.mobius.opis.data.holders.ISerializable;

public class DataByteSize implements Comparable, ISerializable {
public class DataByteSize implements Comparable<DataByteSize>, ISerializable {

public Long size; // Size is stored in byte

Expand All @@ -18,8 +18,8 @@ public DataByteSize(long size) {
}

@Override
public int compareTo(Object o) {
return ((DataByteSize) o).size.compareTo(this.size); // Reverse order ! Put higher values FIRST
public int compareTo(DataByteSize o) {
return o.size.compareTo(this.size); // Reverse order ! Put higher values FIRST
}

public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import mcp.mobius.opis.data.managers.EntityManager;
import mcp.mobius.opis.data.managers.TileEntityManager;

public class DataChunk implements ISerializable, Comparable {
public class DataChunk implements ISerializable, Comparable<DataChunk> {

int nentities;
int ntileents;
Expand Down Expand Up @@ -51,7 +51,7 @@ public static DataChunk readFromStream(ByteArrayDataInput stream) {
}

@Override
public int compareTo(Object o) {
return this.update.compareTo(((DataEntity) o).update);
public int compareTo(DataChunk o) {
return this.update.compareTo(o.update);
}
}
Loading