-
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
1 parent
737ab59
commit 521df27
Showing
123 changed files
with
3,865 additions
and
3,803 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,31 +1,19 @@ | ||
# exclude all | ||
/* | ||
build/ | ||
*.ipr | ||
run/ | ||
*.iws | ||
out/ | ||
*.iml | ||
.gradle/ | ||
output/ | ||
bin/ | ||
libs/ | ||
|
||
# need gradle | ||
!gradle/ | ||
!gradlew | ||
!gradlew.bat | ||
!build.gradle | ||
!gradle.properties | ||
|
||
# include markdowns | ||
!README.md | ||
!LICENSE | ||
|
||
# include source code | ||
!src/ | ||
!libs/ | ||
!img/ | ||
!RedstoneFlux-API | ||
|
||
# include git important files | ||
!.gitmodules | ||
!.gitignore | ||
|
||
# other important files | ||
!.editorconfig | ||
!.travis.yml | ||
!deploy_key.enc | ||
!scripts/ | ||
!docs/ | ||
!logo.png | ||
.classpath | ||
.project | ||
.idea/ | ||
classes/ | ||
.metadata | ||
.vscode | ||
.settings | ||
*.launch |
This file was deleted.
Oops, something went wrong.
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,59 +1,38 @@ | ||
# BetterP2P | ||
|
||
![](https://cf.way2muchnoise.eu/versions/538092.svg) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) | ||
![](https://cf.way2muchnoise.eu/versions/538092.svg) ![](https://cf.way2muchnoise.eu/full_538092_downloads.svg) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) | ||
|
||
![logo](logo.png) | ||
|
||
Better P2P and memory card for Applied Energistics 2, requires [Forgelin](https://www.curseforge.com/minecraft/mc-mods/shadowfacts-forgelin). | ||
An advanced tool for AE2, to manage P2P networks. | ||
|
||
Documentation is now available to read: <https://lasmgratel.github.io/BetterP2P-Manual/> | ||
|
||
## Features | ||
|
||
Obtain a Better Memory Card. | ||
|
||
![](img/showcase0.png) | ||
|
||
Right-click on a P2P device or any ME attached device to inspect all P2P devices in your ME Network. | ||
|
||
![](img/showcase1.png) | ||
Supports both **1.20.1 Fabric and Forge!** | ||
|
||
Select one of the P2P devices and pair it with other P2P, you can choose the binding mode. Once you have P2P devices paired, devices with same frequency will be highlighted in aqua color. | ||
**Fabric**: Requires [Architectury API (fabric)](https://modrinth.com/mod/architectury-api/versions?g=1.20.1&l=fabric), [Fabric Language Kotlin](https://modrinth.com/mod/fabric-language-kotlin/versions?g=1.20.1) | ||
|
||
![](img/showcase2.png) | ||
**Forge**: Requires [Architectury API (forge)](https://modrinth.com/mod/architectury-api/versions?g=1.20.1&l=forge), [Kotlin for Forge](https://modrinth.com/mod/kotlin-for-forge/versions?l=forge&g=1.20.1) | ||
|
||
Input P2P will always be on the top. | ||
**Please choose the corrent corresponding dependencies for your mod loader!** | ||
|
||
![](img/showcase3.png) | ||
|
||
A wrong setup (usually P2P devices without input) will be in red color, and devices with no channel will be in yellow. | ||
|
||
![](img/showcase4.png) | ||
|
||
Version 1.1 update: | ||
|
||
P2P location is shown. | ||
Documentation is now available to read: <https://lasmgratel.github.io/BetterP2P-Manual/> | ||
|
||
![](img/showcase5.png) | ||
## Older Versions | ||
|
||
When you select one of the P2P device, outlines will render at other devices with same frequency. | ||
1.7.10 Currently Maintained by GTNH Team: <https://github.com/GTNewHorizons/BetterP2P> | ||
|
||
You can Shift-click better memory card to clean this outline. | ||
1.12.2 Currently Maintained by AE2UEL: <https://www.curseforge.com/minecraft/mc-mods/betterer-p2p> | ||
|
||
![](img/showcase6.png) | ||
**All new features and ideas in 1.20 are based on Betterer P2P, thanks AE2UEL Team!** | ||
|
||
## TODOs | ||
|
||
- [ ] Documentation | ||
- [ ] Sort modes | ||
- [ ] Better predicate to reduce crashes | ||
- [X] A border show in the world to identify the selected P2P device | ||
- [ ] Optimize cache | ||
- [ ] A minimap shows all P2P devices | ||
- [ ] Config | ||
- [ ] Stability Checks | ||
|
||
## Credits | ||
|
||
- Cyclic for its block outline code | ||
- PnC for its block outline code | ||
- LasmGratel for the first BetterP2P | ||
- GlodBlock for the first 1.7.10 port | ||
- firenoo for the big revamps <3 | ||
- AE2UEL Team for Betterer P2P |
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,103 +1,82 @@ | ||
buildscript { | ||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = "forge" | ||
url = "https://files.minecraftforge.net/maven" | ||
} | ||
maven { | ||
name = "sonatype" | ||
url = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
} | ||
maven { | ||
name = "gradle" | ||
url = "https://plugins.gradle.org/m2/" | ||
} | ||
} | ||
dependencies { | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50" | ||
classpath("com.anatawa12.forge:ForgeGradle:2.3-1.0.+") { | ||
changing = true | ||
} | ||
} | ||
plugins { | ||
id "org.jetbrains.kotlin.jvm" version "1.8.22" | ||
id "architectury-plugin" version "3.4-SNAPSHOT" | ||
id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false | ||
} | ||
|
||
apply plugin: "net.minecraftforge.gradle.forge" | ||
apply plugin: 'kotlin' | ||
|
||
compileJava.options.encoding = "UTF-8" | ||
compileTestJava.options.encoding = "UTF-8" | ||
|
||
sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly. | ||
compileJava { | ||
sourceCompatibility = targetCompatibility = "1.8" | ||
architectury { | ||
minecraft = rootProject.minecraft_version | ||
} | ||
|
||
version = minecraft_version + "-" + mod_version | ||
group= mod_group // http://maven.apache.org/guides/mini/guide-naming-conventions.html | ||
archivesBaseName = mod_id | ||
subprojects { | ||
apply plugin: "dev.architectury.loom" | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
url "https://maven.shadowfacts.net/" | ||
} | ||
maven { | ||
url "https://cursemaven.com" | ||
content { | ||
includeGroup "curse.maven" | ||
} | ||
} | ||
maven { | ||
name = "Progwml6 maven" | ||
url = "https://dvs1.progwml6.com/files/maven" | ||
loom { | ||
silentMojangMappingsLicense() | ||
} | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions { | ||
jvmTarget = 1.8 | ||
repositories { | ||
maven { url = "https://maven.parchmentmc.org" } // Parchment mappings | ||
maven { url = "https://maven.quiltmc.org/repository/release" } // Quilt Mappings | ||
} | ||
} | ||
|
||
minecraft { | ||
version = minecraft_version + "-" + forge_version | ||
runDir = "run" | ||
|
||
replace "@version@", mod_version | ||
|
||
mappings = mcp_mapping_version | ||
dependencies { | ||
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" | ||
// The following line declares the mojmap mappings, you may use other mappings as well | ||
mappings loom.layered() { | ||
officialMojangMappings() { nameSyntheticMembers = false } | ||
parchment("org.parchmentmc.data:parchment-1.20.1:2023.09.03@zip") | ||
} | ||
// The following line declares the yarn mappings you may select this one as well. | ||
// mappings "net.fabricmc:yarn:1.20.1+build.10:v2" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "curse.maven:ae2-extended-life-570458:4851091" | ||
implementation "net.shadowfacts:Forgelin:1.8.4" | ||
allprojects { | ||
apply plugin: "java" | ||
apply plugin: "kotlin" | ||
apply plugin: "architectury-plugin" | ||
apply plugin: "maven-publish" | ||
|
||
runtime "mezz.jei:jei_1.12.2:4.16.1.302" | ||
} | ||
base { | ||
archivesName = rootProject.archives_base_name | ||
} | ||
|
||
sourceJar { | ||
duplicatesStrategy = DuplicatesStrategy.WARN | ||
} | ||
version = rootProject.mod_version | ||
group = rootProject.maven_group | ||
|
||
processResources | ||
{ | ||
duplicatesStrategy = DuplicatesStrategy.WARN | ||
repositories { | ||
exclusiveContent { | ||
forRepository { | ||
maven { | ||
name 'Modrinth' | ||
url 'https://api.modrinth.com/maven' | ||
} | ||
} | ||
filter { | ||
includeGroup 'maven.modrinth' | ||
} | ||
} | ||
maven { | ||
name 'ModMaven' | ||
url 'https://modmaven.dev' | ||
} | ||
} | ||
|
||
// this will ensure that this task is redone when the versions change. | ||
inputs.property "version", project.version | ||
inputs.property "mcversion", project.minecraft.version | ||
dependencies { | ||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib" | ||
} | ||
|
||
// replace stuff in mcmod.info, nothing else | ||
from(sourceSets.main.resources.srcDirs) { | ||
include 'mcmod.info' | ||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
options.release = 17 | ||
} | ||
|
||
// replace version and mcversion | ||
expand 'version':project.version, 'mcversion':project.minecraft.version | ||
kotlin.target.compilations.all { | ||
kotlinOptions.jvmTarget = "17" | ||
} | ||
|
||
// copy everything else, thats not the mcmod.info | ||
from(sourceSets.main.resources.srcDirs) { | ||
exclude 'mcmod.info' | ||
java { | ||
withSourcesJar() | ||
} | ||
} |
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,32 @@ | ||
architectury { | ||
common(rootProject.enabled_platforms.split(",")) | ||
} | ||
|
||
loom { | ||
accessWidenerPath = file("src/main/resources/examplemod.accesswidener") | ||
} | ||
|
||
dependencies { | ||
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies | ||
// Do NOT use other classes from fabric loader | ||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" | ||
// Remove the next line if you don't want to depend on the API | ||
modApi "dev.architectury:architectury:${rootProject.architectury_version}" | ||
|
||
// AE2 doesn't use architectury, but we do, so link some common code here | ||
modApi "appeng:appliedenergistics2-forge:${rootProject.ae2_version}" | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenCommon(MavenPublication) { | ||
artifactId = rootProject.archives_base_name | ||
from components.java | ||
} | ||
} | ||
|
||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. | ||
repositories { | ||
// Add repositories to publish to here. | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
common/src/main/java/dev/lasm/betterp2p/mixin/MixinAEParts.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,25 @@ | ||
package dev.lasm.betterp2p.mixin; | ||
|
||
import appeng.core.definitions.AEParts; | ||
import dev.lasm.betterp2p.BetterP2P; | ||
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(value = AEParts.class, remap = false) | ||
public class MixinAEParts { | ||
@Inject(method = "<clinit>", at = @At("RETURN")) | ||
private static void onInit(CallbackInfo ci) { | ||
// https://fabricmc.net/wiki/documentation:entrypoint#a_note_about_load_order_and_phases_or_a_lack_thereof | ||
// Fabric thinks load ordering is a bad practice and shouldn't be guaranteed in the first place. | ||
// But you cannot ensure every modder init their objects properly. | ||
// In this particular case, AE2 inits their object statically. You can't just use them in setup event. | ||
|
||
// Fabric try to force every developer accept their "philosophies" (if could be so called). | ||
// Well, we have seen what happened to Rust nowadays. | ||
BetterP2P.INSTANCE.getLogger().info("Tunnels init"); | ||
BetterP2P.INSTANCE.getProxy().initTunnels(); | ||
} | ||
} |
Oops, something went wrong.