Skip to content

Commit

Permalink
Merge branch 'master' into 1.21.3-neoforge
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Nov 14, 2024
2 parents 627d345 + 883d7ad commit 1f63f1d
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 74 deletions.
150 changes: 114 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,36 @@

This mod highlights nearby chests so you can see them through walls. It's based on a Wurst Client feature of the same name.

![A screenshot showing all of the different containers that ChestESP supports](https://github.com/Wurst-Imperium/ChestESP/assets/10100202/5b77efdd-4a6b-49ea-8fed-1b1c18d13d7a)
![A screenshot showing all of the different containers that ChestESP supports](https://github.com/user-attachments/assets/70fcc9df-0693-4fc3-933d-121fe853dc00)

## Downloads

## Downloads (for users)
[![Download ChestESP](https://wurst.wiki/_media/icon/chestesp/download_chestesp_326x80.png)](https://www.wimods.net/chestesp/download/?utm_source=GitHub&utm_medium=ChestESP&utm_campaign=README.md&utm_content=Download+ChestESP)

## Setup (for developers)
(This assumes that you are using Windows with [Eclipse](https://www.eclipse.org/downloads/) and [Java Development Kit 21](https://adoptium.net/?variant=openjdk21&jvmVariant=hotspot) already installed.)
## Installation

1. Run this command in PowerShell:
> [!IMPORTANT]
> Always make sure that your modloader and all of your mods are made for the same Minecraft version. Your game will crash if you mix different versions.
```pwsh
./gradlew.bat eclipse --no-daemon
```
### Installation using Fabric

2. In Eclipse, go to `Import...` > `Existing Projects into Workspace` and select this project.
1. Install [Fabric Loader](https://fabricmc.net/use/installer/).
2. Add [Fabric API](https://modrinth.com/mod/fabric-api) to your mods folder.
3. Add ChestESP to your mods folder.

## Features
- Highlights different types of chests and other containers with colored boxes, colored lines, or both
- See highlighted chests even when they are hidden behind other blocks
- Useful for finding hidden dungeons, buried treasure, and secret player bases
- Highly customizable with Cloth Config integration, allowing you to modify colors, styles, and which container types to show
- Supports a wide variety of container types, including chests, trapped chests, ender chests, chest minecarts, barrels, shulker boxes, hoppers, hopper minecarts, droppers, dispensers, furnaces, blast furnaces, and smokers
- Quickly toggle the entire mod with a keybind or through the settings menu
- Lightweight and optimized for performance
> [!NOTE]
> Older ChestESP versions also required that you add [Cloth Config](https://modrinth.com/mod/cloth-config) and [ModMenu](https://modrinth.com/mod/modmenu) to your mods folder. As of ChestESP 1.2, you no longer need to do this.
## Required Dependencies
ChestESP only works if the following other mods are also installed:
- [Fabric API](https://modrinth.com/mod/fabric-api)
- [ModMenu](https://modrinth.com/mod/modmenu)
- [Cloth Config](https://modrinth.com/mod/cloth-config)
### Installation using NeoForge

1. Install [NeoForge](https://neoforged.net/).
2. Add ChestESP to your mods folder.

## Usage

## How to Use
Once installed, ChestESP will automatically highlight any nearby chests.

The mod also comes with an in-game settings menu that can be accessed through ModMenu.
The mod also comes with an in-game settings menu that can be accessed through ModMenu in Fabric or the built-in mod list in NeoForge.

![A screenshot showing ChestESP's settings menu, powered by Cloth Config](https://github.com/Wurst-Imperium/ChestESP/assets/10100202/3bb121ed-eb5d-49b1-ad62-3bcec3d6d488)

Expand All @@ -46,15 +41,98 @@ In the settings menu, you can:
- Toggle on/off specific container types.
- Enable/disable the entire mod.

Additionally, there's a "Toggle ChestESP" entry in the Options > Controls > Key Binds menu that allows you to quickly enable/disable the mod at the press of a button. This feature is not bound to any key by default.

## Supported Versions
- 1.21 Fabric ([early access](https://ko-fi.com/Post/Early-Access-ChestESP-Mod-for-Minecraft-1-21-X8X1ZOM62))
- 1.20.6 Fabric
- 1.20.5 Fabric
- 1.20.4 Fabric
- 1.20.3 Fabric
- 1.20.2 Fabric
- 1.20.1 Fabric
- 1.20 Fabric
- 1.19.4 Fabric
There is also a "Toggle ChestESP" entry in the Options > Controls > Key Binds menu that allows you to quickly enable/disable the mod at the press of a button. This feature is not bound to any key by default.

## Supported containers

ChestESP supports the following container types:
- Chests
- Trapped chests
- Ender chests
- Barrels
- Shulker boxes
- Decorated pots
- Chest minecarts
- Chest boats
- Hopper minecarts
- Hoppers
- Droppers
- Dispensers
- Furnaces
- Blast furnaces
- Smokers

Not all of these containers are enabled by default to prevent cluttering your screen. Be sure to check the settings menu and enable all the ones you want.

## Supported languages

Only English for now.

## Development Setup

> [!IMPORTANT]
> Make sure you have [Java Development Kit 21](https://adoptium.net/?variant=openjdk21&jvmVariant=hotspot) installed. It won't work with other versions.
### Development using Eclipse

1. Clone the repository:

```pwsh
git clone https://github.com/Wurst-Imperium/ChestESP.git
cd ChestESP
```

2. Generate the sources:

In Fabric versions:
```pwsh
./gradlew genSources eclipse
```

In NeoForge versions:
```pwsh
./gradlew eclipse
```

3. In Eclipse, go to `Import...` > `Existing Projects into Workspace` and select this project.

4. **Optional:** Right-click on the project and select `Properties` > `Java Code Style`. Then under `Clean Up`, `Code Templates`, `Formatter`, import the respective files in the `codestyle` folder.

### Development using VSCode / Cursor

> [!TIP]
> You'll probably want to install the [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) to make development easier.
1. Clone the repository:

```pwsh
git clone https://github.com/Wurst-Imperium/ChestESP.git
cd ChestESP
```

2. Generate the sources:

In Fabric versions:
```pwsh
./gradlew genSources vscode
```

In NeoForge versions:
```pwsh
./gradlew eclipse
```
(That's not a typo. NeoForge doesn't have `vscode`, but `eclipse` works fine.)

3. Open the `ChestESP` folder in VSCode / Cursor.

4. **Optional:** In the VSCode settings, set `java.format.settings.url` to `https://raw.githubusercontent.com/Wurst-Imperium/ChestESP/master/codestyle/formatter.xml` and `java.format.settings.profile` to `Wurst-Imperium`.

### Development using IntelliJ IDEA

I don't use or recommend IntelliJ, but the commands to run would be:

```pwsh
git clone https://github.com/Wurst-Imperium/ChestESP.git
cd ChestESP
./gradlew genSources idea
```
63 changes: 25 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
buildscript {
dependencies {
classpath "org.kohsuke:github-api:1.326"
classpath "com.squareup.okhttp3:okhttp:4.12.0"
}
}

Expand Down Expand Up @@ -276,7 +275,7 @@ publishMods {
jarFiles[0]
}
def versionString = project.version as String
def ghVersion = "v" + versionString.substring(0, versionString.indexOf("-"))
def ghVersion = "v" + versionString.substring(0, versionString.indexOf("-MC"))
def changelogUrl = "https://www.wimods.net/chestesp/chestesp-1-2/"
def archivesName = project.base.archivesName.get() as String
additionalFiles.from(
Expand Down Expand Up @@ -315,7 +314,7 @@ task github {
doLast {
def github = GitHub.connectUsingOAuth(ENV.GITHUB_TOKEN as String)
def repository = github.getRepository("Wurst-Imperium-MCX/ChestESP")
def ghVersion = "v" + version.substring(0, version.indexOf("-"))
def ghVersion = "v" + version.substring(0, version.indexOf("-MC"))

def ghRelease = repository.getReleaseByTagName(ghVersion as String);
if(ghRelease == null) {
Expand Down Expand Up @@ -359,12 +358,6 @@ task closeMilestone {
}
}

import okhttp3.MediaType
import okhttp3.MultipartBody
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody

task uploadBackups {
dependsOn build

Expand All @@ -373,38 +366,32 @@ task uploadBackups {
}

doLast {
def shortVersion = version.substring(0, version.indexOf("-"))
def shortVersion = version.substring(0, version.indexOf("-MC"))
def backupUrl = "https://api.wurstclient.net/artifact-backups/ChestESP/${shortVersion}"

def client = new OkHttpClient()
def multipartBuilder = new MultipartBody.Builder()
.setType(MultipartBody.FORM)

// Add main JAR
def mainJar = remapJar.archiveFile.get().asFile
multipartBuilder.addFormDataPart(
"files",
mainJar.name,
RequestBody.create(MediaType.parse("application/java-archive"), mainJar)
)
def connection = new URL(backupUrl).openConnection() as HttpURLConnection
def boundary = UUID.randomUUID().toString()
connection.setRequestMethod("POST")
connection.setRequestProperty("X-API-Key", ENV.WI_BACKUPS_API_KEY)
connection.setRequestProperty("Accept", "application/json")
connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=$boundary")
connection.doOutput = true

// Add sources JAR
def sourcesJar = remapSourcesJar.archiveFile.get().asFile
multipartBuilder.addFormDataPart(
"files",
sourcesJar.name,
RequestBody.create(MediaType.parse("application/java-archive"), sourcesJar)
)

def request = new Request.Builder()
.url(backupUrl)
.header("X-API-Key", ENV.WI_BACKUPS_API_KEY)
.post(multipartBuilder.build())
.build()

def response = client.newCall(request).execute()
if (!response.successful) {
throw new GradleException("Failed to upload backups: ${response.code} ${response.body?.string()}")
def output = connection.outputStream
[remapJar, remapSourcesJar].each { jarTask ->
def file = jarTask.archiveFile.get().asFile
output << "--${boundary}\r\n"
output << "Content-Disposition: form-data; name=\"files\"; filename=\"${file.name}\"\r\n"
output << "Content-Type: application/java-archive\r\n\r\n"
file.withInputStream { input ->
output << input
}
output << "\r\n"
}
output << "--${boundary}--\r\n"
output.flush()

if(connection.responseCode != 200)
throw new GradleException("Failed to upload backups: ${connection.responseCode} ${connection.responseMessage}")
}
}

0 comments on commit 1f63f1d

Please sign in to comment.