Skip to content

Commit 19350a0

Browse files
authored
Add files via upload
1 parent 07a55e2 commit 19350a0

13 files changed

+303
-0
lines changed

build.gradle

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
plugins {
2+
id 'fabric-loom' version '1.1-SNAPSHOT'
3+
id 'maven-publish'
4+
}
5+
6+
sourceCompatibility = JavaVersion.VERSION_17
7+
targetCompatibility = JavaVersion.VERSION_17
8+
9+
archivesBaseName = project.archives_base_name
10+
version = project.mod_version
11+
group = project.maven_group
12+
13+
repositories {
14+
// Add repositories to retrieve artifacts from in here.
15+
// You should only use this when depending on other mods because
16+
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
17+
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
18+
// for more information about repositories.
19+
maven { url 'https://maven.wispforest.io' }
20+
maven { url "https://maven.terraformersmc.com/" }
21+
maven { url 'https://masa.dy.fi/maven' }
22+
maven { url = "https://www.cursemaven.com" }
23+
mavenCentral()
24+
}
25+
26+
dependencies {
27+
// To change the versions see the gradle.properties file
28+
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
29+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
30+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
31+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
32+
modImplementation "blue.endless:jankson:1.1.0"
33+
modImplementation "fi.dy.masa.malilib:malilib-fabric-${project.malilib_version}"
34+
modImplementation "curse.maven:litematica-${project.litematica_projectid}:${project.litematica_fileid}"
35+
36+
// Fabric API. This is technically optional, but you probably want it anyway.
37+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
38+
39+
annotationProcessor modImplementation("io.wispforest:owo-lib:${project.owo_version}")
40+
41+
// Uncomment the following line to enable the deprecated Fabric API modules.
42+
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.
43+
44+
// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
45+
}
46+
47+
processResources {
48+
inputs.property "version", project.version
49+
50+
filesMatching("fabric.mod.json") {
51+
expand "version": project.version
52+
}
53+
}
54+
55+
tasks.withType(JavaCompile).configureEach {
56+
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
57+
it.options.release = 17
58+
}
59+
60+
java {
61+
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
62+
// if it is present.
63+
// If you remove this line, sources will not be generated.
64+
withSourcesJar()
65+
}
66+
67+
jar {
68+
from("LICENSE") {
69+
rename { "${it}_${project.archivesBaseName}"}
70+
}
71+
}
72+
73+
// configure the maven publication
74+
publishing {
75+
publications {
76+
mavenJava(MavenPublication) {
77+
from components.java
78+
}
79+
}
80+
81+
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
82+
repositories {
83+
// Add repositories to publish to here.
84+
// Notice: This block does NOT have the same function as the block in the top level.
85+
// The repositories here will be used for publishing your artifact, not for
86+
// retrieving dependencies.
87+
}
88+
}

gradle.properties

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx1G
3+
org.gradle.parallel=true
4+
5+
# Fabric Properties
6+
# check these on https://fabricmc.net/develop
7+
minecraft_version=1.19.3
8+
yarn_mappings=1.19.3+build.5
9+
loader_version=0.14.14
10+
11+
# Mod Properties
12+
mod_version = 2.2
13+
maven_group = furnygo.arttp
14+
archives_base_name = arttp
15+
16+
# Dependencies
17+
fabric_version=0.74.0+1.19.3
18+
19+
# https://maven.wispforest.io/io/wispforest/owo-lib/
20+
owo_version=0.10.2+1.19.3
21+
22+
# https://www.curseforge.com/minecraft/mc-mods/modmenu/files
23+
modmenu_version=5.1.0-beta.4
24+
25+
# https://masa.dy.fi/maven/fi/dy/masa/malilib/
26+
malilib_version=1.19.3:0.14.0
27+
# https://www.curseforge.com/minecraft/mc-mods/litematica/files
28+
litematica_fileid=4162847
29+
litematica_projectid=308892

gradle/wrapper/gradle-wrapper.jar

60.2 KB
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
4+
networkTimeout=10000
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

settings.gradle

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pluginManagement {
2+
repositories {
3+
maven {
4+
name = 'Fabric'
5+
url = 'https://maven.fabricmc.net/'
6+
}
7+
mavenCentral()
8+
gradlePluginPortal()
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package furnygo.arttp;
2+
3+
import io.wispforest.owo.config.annotation.Config;
4+
import io.wispforest.owo.config.annotation.Modmenu;
5+
6+
@Modmenu(modId = "arttp")
7+
@Config(name = "arttp-config", wrapperName = "ArtTpConfig")
8+
public class ArtTpConfigModel {
9+
public boolean isActive = false;
10+
public boolean clientSideTeleports = true;
11+
public boolean useTp = false;
12+
public int cLimX = 99999;
13+
public int cCrdX = 99999;
14+
public int cCrdY = 99999;
15+
public int cYaw = -90;
16+
public int cPitch = 75;
17+
public int cStep = 1;
18+
public int checkTimer = 200;
19+
public int inaccuracy = 10;
20+
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package furnygo.arttp;
2+
3+
import net.fabricmc.api.ModInitializer;
4+
import org.slf4j.Logger;
5+
import org.slf4j.LoggerFactory;
6+
7+
public class ArtTpMain implements ModInitializer {
8+
public static final furnygo.arttp.ArtTpConfig CONFIG = furnygo.arttp.ArtTpConfig.createAndLoad();
9+
public static final Logger LOGGER = LoggerFactory.getLogger("arttp");
10+
@Override
11+
public void onInitialize() {
12+
LOGGER.info("ArtTeleport Started!");
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package furnygo.arttp.mixin;
2+
3+
import net.minecraft.client.MinecraftClient;
4+
import net.minecraft.network.packet.c2s.login.LoginHelloC2SPacket;
5+
import org.spongepowered.asm.mixin.Mixin;
6+
import org.spongepowered.asm.mixin.injection.At;
7+
import org.spongepowered.asm.mixin.injection.Inject;
8+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9+
10+
import static furnygo.arttp.ArtTpMain.CONFIG;
11+
12+
@Mixin(LoginHelloC2SPacket.class)
13+
public class CheckerStartMixin {
14+
@Inject(at = @At("HEAD"), method = "write")
15+
private void init(CallbackInfo info) {
16+
(new Thread(() -> {
17+
try {
18+
Thread.sleep(10000);
19+
while (CONFIG.isActive()) {
20+
assert MinecraftClient.getInstance().player != null;
21+
int crdX = (int) MinecraftClient.getInstance().player.getX();
22+
if (!CONFIG.clientSideTeleports()) {
23+
if (crdX >= CONFIG.cLimX() && crdX <= CONFIG.cLimX() + CONFIG.inaccuracy()) {
24+
if (CONFIG.useTp()) {
25+
String nick = MinecraftClient.getInstance().player.getEntityName();
26+
MinecraftClient.getInstance().player.networkHandler.sendChatCommand("tp " + nick + " " + CONFIG.cCrdX() + " " + CONFIG.cCrdY() + " ~" + CONFIG.cStep() + " " + CONFIG.cYaw() + " " + CONFIG.cPitch());
27+
} else
28+
MinecraftClient.getInstance().player.networkHandler.sendChatCommand("tppos " + CONFIG.cCrdX() + " " + CONFIG.cCrdY() + " ~" + CONFIG.cStep() + " " + CONFIG.cYaw() + " " + CONFIG.cPitch());
29+
}
30+
Thread.sleep(CONFIG.checkTimer());
31+
}
32+
else {
33+
if (crdX >= CONFIG.cLimX() && crdX <= CONFIG.cLimX() + CONFIG.inaccuracy()) {
34+
MinecraftClient.getInstance().player.updatePositionAndAngles(MinecraftClient.getInstance().player.getX(), MinecraftClient.getInstance().player.getY(), MinecraftClient.getInstance().player.getZ()+CONFIG.cStep(), CONFIG.cYaw(), CONFIG.cPitch());
35+
}
36+
else if (crdX <= CONFIG.cCrdX() && crdX >= CONFIG.cCrdX() - CONFIG.inaccuracy()) {
37+
MinecraftClient.getInstance().player.updatePositionAndAngles(MinecraftClient.getInstance().player.getX(), MinecraftClient.getInstance().player.getY(), MinecraftClient.getInstance().player.getZ()+CONFIG.cStep(), CONFIG.cYaw()+180, CONFIG.cPitch());
38+
}
39+
Thread.sleep(CONFIG.checkTimer());
40+
}
41+
}
42+
} catch (Exception ex) {
43+
ex.printStackTrace();
44+
}
45+
46+
})).start();
47+
}
48+
}

src/main/resources/arttp.mixins.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"required": true,
3+
"minVersion": "0.8",
4+
"package": "furnygo.arttp.mixin",
5+
"compatibilityLevel": "JAVA_17",
6+
"mixins": [
7+
],
8+
"client": [
9+
"CheckerStartMixin"
10+
],
11+
"injectors": {
12+
"defaultRequire": 1
13+
}
14+
}
18 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"text.config.arttp-config.title": "ArtTeleport 2 Settings",
3+
"text.config.arttp-config.option.isActive": "Activation of the mod (you need to rejoin to the server)",
4+
"text.config.arttp-config.option.clientSideTeleports": "Use client side teleports (if you don't have rights for /tp and /tppos)",
5+
"text.config.arttp-config.option.useTp": "Use /tp instead of /tppos",
6+
"text.config.arttp-config.option.cCrdX": "X coordinate for teleporting back",
7+
"text.config.arttp-config.option.cCrdY": "Y coordinate for teleporting back",
8+
"text.config.arttp-config.option.cLimX": "X coordinate where you will be warm (Limiter)",
9+
"text.config.arttp-config.option.cYaw": "Horizontal angle of rotation of the camera during teleportation",
10+
"text.config.arttp-config.option.cPitch": "Vertical angle of rotation of the camera during teleportation",
11+
"text.config.arttp-config.option.cStep": "Number of lines to which you will be teleported next",
12+
"text.config.arttp-config.option.checkTimer": "Speed of coordinate checker (ms)",
13+
"text.config.arttp-config.option.inaccuracy": "Additional coord range for teleports (during lags)",
14+
15+
"modmenu.summaryTranslation.arttp": "Teleportation by mapart line by line",
16+
"modmenu.descriptionTranslation.arttp": "With this mod, you can build mapart automatically"
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"text.config.arttp-config.title": "Настройки ArtTeleport 2",
3+
"text.config.arttp-config.option.isActive": "Активация мода (нужно переподключиться к серверу)",
4+
"text.config.arttp-config.option.clientSideTeleports": "Использовать телепортацию на стороне клиента (если у вас нет прав на /tp и /tppos)",
5+
"text.config.arttp-config.option.useTp": "Использовать /tp вместо /tppos",
6+
"text.config.arttp-config.option.cCrdX": "Координата X для телепорта обратно",
7+
"text.config.arttp-config.option.cCrdY": "Координата Y для телепорта обратно",
8+
"text.config.arttp-config.option.cLimX": "Координата X, на которой вас тепнет (Лимитер)",
9+
"text.config.arttp-config.option.cYaw": "Горизонтальный угол поворота камеры при телепортации",
10+
"text.config.arttp-config.option.cPitch": "Вертикальный угол поворота камеры при телепортации",
11+
"text.config.arttp-config.option.cStep": "Кол-во строк, на которое вас тепнет дальше",
12+
"text.config.arttp-config.option.checkTimer": "Скорость проверки координат (мс)",
13+
"text.config.arttp-config.option.inaccuracy": "Доп. диапазон координат для телепорта (во время лагов)",
14+
15+
"modmenu.summaryTranslation.arttp": "Телепортация по арту построчно",
16+
"modmenu.descriptionTranslation.arttp": "С помощью этого мода можно строить арты автоматически"
17+
}

src/main/resources/fabric.mod.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"schemaVersion": 1,
3+
"id": "arttp",
4+
"version": "${version}",
5+
6+
"name": "ArtTeleport 2",
7+
"description": "New version of mod that allows you to build maparts automatically",
8+
"authors": [
9+
"FurnyGo"
10+
],
11+
"contact": {
12+
"sources": "https://github.com/FurnyGo/ArtTeleport"
13+
},
14+
15+
"license": "MIT",
16+
"icon": "assets/arttp/icon.png",
17+
18+
"environment": "*",
19+
"entrypoints": {
20+
"main": [
21+
"furnygo.arttp.ArtTpMain"
22+
]
23+
},
24+
"mixins": [
25+
"arttp.mixins.json"
26+
],
27+
28+
"depends": {
29+
"fabricloader": "*",
30+
"fabric-api": "*",
31+
"minecraft": ">=1.19",
32+
"owo": "*",
33+
"java": ">=17",
34+
"malilib": "*",
35+
"litematica": "*"
36+
},
37+
"suggests": {
38+
"modmenu": "*"
39+
}
40+
}

0 commit comments

Comments
 (0)