generated from Polyfrost/OneConfigExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
257 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
# gradle.properties file -- CHANGE THE VALUES STARTING WITH `mod_*` AND REMOVE THIS COMMENT. | ||
|
||
# Sets the name of your mod. | ||
mod_name=ExampleMod | ||
mod_name=PolyNametag | ||
# Sets the id of your mod that mod loaders use to recognize it. | ||
mod_id=examplemod | ||
mod_id=polynametag | ||
# Sets the version of your mod. Make sure to update this when you make changes according to semver. | ||
mod_version=1.0.0 | ||
# Sets the name of the jar file that you put in your 'mods' folder. | ||
mod_archives_name=ExampleMod | ||
mod_archives_name=PolyNametag | ||
|
||
# Gradle Configuration -- DO NOT TOUCH THESE VALUES. | ||
polyfrost.defaults.loom=1 | ||
org.gradle.daemon=true | ||
org.gradle.parallel=true | ||
org.gradle.configureoncommand=true | ||
org.gradle.parallel.threads=4 | ||
org.gradle.jvmargs=-Xmx2G | ||
org.gradle.jvmargs=-Xmx4G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/main/java/org/polyfrost/example/command/ExampleCommand.java
This file was deleted.
Oops, something went wrong.
48 changes: 0 additions & 48 deletions
48
src/main/java/org/polyfrost/example/config/TestConfig.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
src/main/java/org/polyfrost/example/mixin/MinecraftMixin.java
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
src/main/java/org/polyfrost/polynametag/mixin/RenderAccessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.polyfrost.polynametag.mixin; | ||
|
||
import net.minecraft.client.renderer.entity.Render; | ||
import net.minecraft.entity.Entity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Invoker; | ||
|
||
@Mixin(Render.class) | ||
public interface RenderAccessor { | ||
@Invoker | ||
boolean invokeCanRenderName(Entity entity); | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/polyfrost/polynametag/mixin/RenderMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.polyfrost.polynametag.mixin; | ||
|
||
import net.minecraft.client.renderer.entity.Render; | ||
import net.minecraft.entity.Entity; | ||
import org.polyfrost.polynametag.hooks.HooksKt; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(Render.class) | ||
public class RenderMixin { | ||
@Inject(method = "renderName(Lnet/minecraft/entity/Entity;DDD)V", at = @At("HEAD")) | ||
private void polyNametag$renderName(Entity entity, double x, double y, double z, CallbackInfo callbackInfo) { | ||
HooksKt.callback((RenderAccessor) this, entity, x, y, z, callbackInfo); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/polyfrost/polynametag/mixin/RendererLivingEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.polyfrost.polynametag.mixin; | ||
|
||
import net.minecraft.client.renderer.entity.RendererLivingEntity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import org.polyfrost.polynametag.hooks.HooksKt; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(RendererLivingEntity.class) | ||
public class RendererLivingEntityMixin { | ||
@Inject(method = "renderName(Lnet/minecraft/entity/EntityLivingBase;DDD)V", at = @At("HEAD")) | ||
private void polyNametag$renderName(EntityLivingBase entity, double x, double y, double z, CallbackInfo callbackInfo) { | ||
HooksKt.callback((RenderAccessor) this, entity, x, y, z, callbackInfo); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.polyfrost.polynametag | ||
|
||
import net.minecraftforge.fml.common.Mod | ||
import net.minecraftforge.fml.common.event.FMLInitializationEvent | ||
import org.polyfrost.polynametag.config.ModConfig | ||
|
||
@Mod(modid = PolyNametag.MODID, name = PolyNametag.NAME, version = PolyNametag.VERSION, modLanguageAdapter = "cc.polyfrost.oneconfig.utils.KotlinLanguageAdapter") | ||
object PolyNametag { | ||
const val MODID = "@ID@" | ||
const val NAME = "@NAME@" | ||
const val VERSION = "@VER@" | ||
|
||
@Mod.EventHandler | ||
fun onInit(e: FMLInitializationEvent) { | ||
ModConfig | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/kotlin/org/polyfrost/polynametag/config/ModConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.polyfrost.polynametag.config | ||
|
||
import cc.polyfrost.oneconfig.config.Config | ||
import cc.polyfrost.oneconfig.config.annotations.* | ||
import cc.polyfrost.oneconfig.config.core.OneColor | ||
import cc.polyfrost.oneconfig.config.data.InfoType | ||
import cc.polyfrost.oneconfig.config.data.Mod | ||
import cc.polyfrost.oneconfig.config.data.ModType | ||
import org.polyfrost.polynametag.PolyNametag | ||
|
||
object ModConfig : Config(Mod(PolyNametag.NAME, ModType.UTIL_QOL), "${PolyNametag.MODID}.json") { | ||
|
||
@Info( | ||
text = "Some features may have conflict with Patcher", | ||
type = InfoType.WARNING, | ||
size = 2 | ||
) | ||
private var warning = false | ||
|
||
@Slider(name = "Height offset", min = -0.5f, max = 0.5f) | ||
var heightOffset = 0f | ||
|
||
@Slider(name = "Scale", min = 0.5f, max = 2f) | ||
var scale = 1f | ||
|
||
@Switch(name = "Text shadow") | ||
var textShadow = false | ||
|
||
@Switch(name = "Show self nametag") | ||
var showSelfNametag = true | ||
|
||
@Switch(name = "Background") | ||
var background = true | ||
|
||
@Color(name = "Background color") | ||
var backgroundColor = OneColor(0f, 0f, 0f, 0.25f) | ||
|
||
init { | ||
initialize() | ||
addDependency("backgroundColor", "background") | ||
} | ||
} |
Oops, something went wrong.