Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from rettichlp/develop
Browse files Browse the repository at this point in the history
v1.0.0-beta
  • Loading branch information
rettichlp authored Jun 14, 2022
2 parents 514b2db + e87c89d commit 3a644de
Show file tree
Hide file tree
Showing 33 changed files with 1,086 additions and 299 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-oder-fehler.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug oder Fehler
about: Melde hier einen Bug oder Fehler für das Projekt
title: UCAB - Füge hier eine kurze Beschreibung ein
labels: bug
assignees: ''

---

**Beschreibe den Bug oder Fehler**
Eine klare und präzise Beschreibung des Fehlers.

**Wie kann der Bug oder Fehler reproduziert werden?**
Schritte zum Reproduzieren des Verhaltens:
1. Gehen zu "..."
2. Klicke auf "..."
3. Scrolle nach unten zu "..."
4. Dort ist der Fehler

**Erwartetes Verhalten**
Eine klare und präzise Beschreibung dessen, was erwartet wurde.

**Screenshots**
Füge gegebenenfalls Screenshots hinzu, um das Problem zu erläutern.

**Weitere Informationen (bitte ausfüllen):**
Minecraft Version: `1.16.5`
Addon Version: `x.y.z`
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature
about: Stelle hier eine Idee oder Erweiterung für das Projekt vor
title: UCAF - Füge hier eine kurze Beschreibung ein
labels: enhancement
assignees: ''

---

**Aus welchem Grund ist die Idee oder Erweiterung hilfreich?**
Eine klare und präzise Beschreibung der Idee oder Erweiterung.

**Was soll passieren, wie soll die Idee oder Erweiterung umgesetzt werden?**
Eine klare und präzise Beschreibung dessen, was passieren soll.
- [ ] ...
- [ ] ...

**Sonstiges**
Füge hier jeglichen anderen Kontext oder Screenshots zur Funktionsanfrage hinzu.
9 changes: 1 addition & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ name: Gradle build
on:
push:
branches:
- master
- main
- develop
pull_request:
branches:
- master
- main
- develop

Expand All @@ -26,9 +24,4 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew downloadAPI build
- name: Upload jar
uses: actions/upload-artifact@v1
with:
name: Artifacts
path: build/libs/
run: ./gradlew downloadAPI build
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Gradle release

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew downloadAPI shadowJar
- name: Upload jar
uses: actions/upload-artifact@v1
with:
name: Artifacts
path: build/libs/
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildscript {
dependencies {
classpath group: 'com.github.ImpactDevelopment', name: 'ForgeGradle', version: '3.0.115'
classpath group: 'com.github.ImpactDevelopment', name: 'MixinGradle', version: '0.6.2'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}

Expand All @@ -22,6 +23,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'com.github.johnrengelman.shadow'

version = '1.0.0'
group = 'com.rettichlp.UnicacityAddon' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down Expand Up @@ -78,24 +80,24 @@ repositories {
mavenLocal()
}


dependencies {
annotationProcessor("org.spongepowered:mixin:0.8.2:processor")

minecraft 'com.github.ImpactDevelopment:Vanilla:1.16.5'
compile(files('libs/lm_api_mc1.16.5.jar'))
// compile(files('libs/reflections-0.10.2.jar'))

compile('org.ow2.asm:asm-analysis:9.3') { transitive = false }
compile('org.ow2.asm:asm-util:9.3') { transitive = false }
compile('org.ow2.asm:asm-commons:9.3') { transitive = false }
compile("org.spongepowered:mixin:0.8.2") { transitive = false }
compile("net.minecraft:launchwrapper:1.12") { transitive = false }

implementation 'org.jetbrains:annotations:23.0.0'
implementation 'org.reflections:reflections:0.10.2'
}

jar {
// Excludes the start file
exclude("**/launch")
}

Expand All @@ -110,5 +112,7 @@ task downloadAPI(type: Download) {

src "https://dl.labymod.net/latest/api/files/lm_api_mc1.16.5.jar"
dest 'libs/'
}

// src "https://github.com/ronmamo/reflections/releases/download/0.10.2/reflections-0.10.2.jar"
// dest 'libs/'
}
118 changes: 19 additions & 99 deletions src/main/java/com/rettichlp/UnicacityAddon/UnicacityAddon.java
Original file line number Diff line number Diff line change
@@ -1,122 +1,42 @@
package com.rettichlp.UnicacityAddon;

import com.google.gson.JsonObject;
import com.rettichlp.UnicacityAddon.base.abstraction.AbstractionLayer;
import com.rettichlp.UnicacityAddon.base.command.CommandHandler;
import com.rettichlp.UnicacityAddon.base.text.ColorCode;
import com.rettichlp.UnicacityAddon.base.text.Message;
import com.rettichlp.UnicacityAddon.base.config.ConfigSettings;
import com.rettichlp.UnicacityAddon.base.event.UCEventHandler;
import com.rettichlp.UnicacityAddon.base.faction.FactionHandler;
import com.rettichlp.UnicacityAddon.base.module.UCModuleHandler;
import net.labymod.api.LabyModAddon;
import net.labymod.main.LabyMod;
import net.labymod.settings.elements.HeaderElement;
import net.labymod.ingamegui.ModuleCategoryRegistry;
import net.labymod.settings.elements.SettingsElement;
import net.minecraft.client.Minecraft;

import java.util.List;
import java.util.logging.Logger;

/**
* @author RettichLP
*/
public class UnicacityAddon extends LabyModAddon {

public static final String VERSION = "1.0.0";
public static Logger LOGGER = Logger.getLogger("UnicacityAddon");
public static JsonObject CONFIG;
public static final LabyMod LABYMOD = LabyMod.getInstance();
public static final Minecraft MINECRAFT = Minecraft.getInstance();
public static final String VERSION = "1.0.0-beta";
public static UnicacityAddon ADDON;

@Override
public void onEnable() {
// CommandHandler
AbstractionLayer.getLabymod().getEventService().registerListener(new CommandHandler());
ADDON = this;

// Events
UCEventHandler.registerEvents();
UCModuleHandler.registerModules();

FactionHandler.getPlayerFactionMap();
FactionHandler.getPlayerRankMap();

ModuleCategoryRegistry.loadCategory(UCModuleHandler.UNICACITY);
}

@Override public void loadConfig() {
CONFIG = getConfig();
@Override
public void loadConfig() {
}

@Override
protected void fillSettings(List<SettingsElement> list) {

list.add(new HeaderElement(Message.getBuilder()
.of("U").color(ColorCode.RED).bold().advance()
.of("nica").color(ColorCode.BLUE).bold().advance()
.of("C").color(ColorCode.RED).bold().advance()
.of("ity").color(ColorCode.BLUE).bold().advance()
.of("A").color(ColorCode.RED).bold().advance()
.of("ddon").color(ColorCode.BLUE).bold().advance()
.space()
.of("v" + VERSION).color(ColorCode.BLUE).bold().advance()
.space()
.of("-").color(ColorCode.GRAY).bold().advance()
.space()
.of("by RettichLP").color(ColorCode.GOLD).advance()
.create()));

/*
// jobs
list.add(new HeaderElement(Message.getBuilder()
.of("Jobs").color(ColorCode.WHITE).bold().advance()
.create()));
list.add(new BooleanElement("Auto /dropammo",
this,
new ControlElement.IconData(Material.ARROW),
"command.jobs.dropammo",
AbstractionLayer.getConfig().getCommandJobsDropammo()));
list.add(new BooleanElement("Automatisch /droptransport",
this,
new ControlElement.IconData(Material.CHEST),
"command.jobs.droptransport",
AbstractionLayer.getConfig().getCommandJobsDroptransport()));
list.add(new BooleanElement("Auto /dropwaste",
this,
new ControlElement.IconData(Material.CAULDRON),
"command.jobs.dropwaste",
AbstractionLayer.getConfig().getCommandJobsDropwaste()));
// factions
list.add(new HeaderElement(Message.getBuilder()
.of("Fraktionen").color(ColorCode.WHITE).bold().advance()
.create()));
list.add(new BooleanElement("Toggle1",
this,
new ControlElement.IconData(Material.CAULDRON),
"config.factions.toggle1",
UnicacityAddonConfig.factions_toggle1));
// any
list.add(new HeaderElement(Message.getBuilder()
.of("").color(ColorCode.WHITE).bold().advance()
.create()));
list.add(new BooleanElement("Tankwarnung",
this,
new ControlElement.IconData(Material.BUCKET),
"config.car.tankWarning",
AbstractionLayer.getConfig().getEventCarTankWarning()));
BooleanElement jobs = new BooleanElement("Jobs",
this,
new ControlElement.IconData(Material.FISHING_ROD),
"config.job",
true);
jobs.setSubSettings(jobSettings);
list.add(jobs);
BooleanElement faction = new BooleanElement("Fraktion",
this,
new ControlElement.IconData(Material.FISHING_ROD),
"config.faction",
true);
faction.setSubSettings(factionSettings);
list.add(faction);
*/
ConfigSettings.createConfig(this, list);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.rettichlp.UnicacityAddon.base.abstraction;

import com.rettichlp.UnicacityAddon.base.exceptions.ConfigClassCannotBeInstantiated;
import com.rettichlp.UnicacityAddon.base.exceptions.LabymodClassCannotBeInstantiated;
import com.rettichlp.UnicacityAddon.base.exceptions.UPlayerClassCannotBeInstantiated;

Expand All @@ -12,18 +11,9 @@
*/
public class AbstractionLayer {

private static final Class<? extends Config> configClass = ConfigImpl.class;
private static final Class<? extends Labymod> labymodClass = LabymodImpl.class;
private static final Class<? extends UPlayer> uplayerClass = UPlayerImpl.class;

public static Config getConfig() {
try {
return configClass.getDeclaredConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
throw new ConfigClassCannotBeInstantiated("Class " + configClass + " cannot be instantiated.", e);
}
}

public static Labymod getLabymod() {
try {
return labymodClass.getDeclaredConstructor().newInstance();
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 3a644de

Please sign in to comment.