Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 09451ec

Browse files
Added support for Pam's HarvestCraft 2 Core, Crops, Trees, and Extended (#192)
* Added support for Pam's HarvestCraft 2 Core, Crops, Trees, and Extended There is an existing error in phc2foodextended with minecraft:honey_bottle tags * Alphabetized * Added support for Pam's HarvestCraft 2 Core, Crops, Trees, and Extended Moved accesswidener to patchwork-extensions-entity There is an existing error in phc2foodextended with minecraft:honey_bottle tag * Apply suggestions from code review Co-authored-by: Glitch <glitchieproductionsofficial@gmail.com>
1 parent dee1357 commit 09451ec

7 files changed

Lines changed: 46 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
archivesBaseName = "patchwork-extensions-entity"
2+
version = getSubprojectVersion(project, "0.1.0")
3+
4+
dependencies {
5+
implementation project(path: ':patchwork-api-base', configuration: 'dev')
6+
}
7+
8+
loom {
9+
accessWidener "src/main/resources/patchwork-MobEntity.accesswidener"
10+
}
22.2 KB
Loading
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"schemaVersion": 1,
3+
"id": "patchwork-extensions-entity",
4+
"name": "Patchwork Extensions Entity",
5+
"version": "${version}",
6+
"license": "LGPL-2.1-only",
7+
"icon": "assets/patchwork-extensions-entity/icon.png",
8+
"contact": {
9+
"issues": "https://github.com/PatchworkMC/patchwork-api/issues",
10+
"sources": "https://github.com/PatchworkMC/patchwork-api"
11+
},
12+
"authors": [
13+
"PatchworkMC"
14+
],
15+
"accessWidener": "patchwork-MobEntity.accesswidener",
16+
"depends": {
17+
"patchwork-api-base": "*"
18+
},
19+
"description": "Various extensions and APIs related to entities.",
20+
"custom": {
21+
"modmenu:api": true,
22+
"modmenu:parent": "patchwork"
23+
}
24+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
accessWidener v1 named
2+
3+
accessible field net/minecraft/entity/mob/MobEntity goalSelector Lnet/minecraft/entity/ai/goal/GoalSelector;

patchwork-fml/src/main/java/net/minecraftforge/fml/ModContainer.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.util.IdentityHashMap;
2424
import java.util.Map;
2525
import java.util.Optional;
26+
import java.util.function.Consumer;
2627
import java.util.function.Supplier;
2728

2829
import org.apache.logging.log4j.LogManager;
@@ -38,6 +39,7 @@ public abstract class ModContainer {
3839
protected final Map<ExtensionPoint, Supplier<?>> extensionPoints = new IdentityHashMap<>();
3940
protected final EnumMap<ModConfig.Type, ModConfig> configs;
4041
private net.fabricmc.loader.api.ModContainer fabricModContainer;
42+
protected Optional<Consumer<ModConfig.ModConfigEvent>> configHandler = Optional.empty();
4143

4244
public ModContainer(String modId) {
4345
this.modId = modId;
@@ -73,6 +75,10 @@ public void addConfig(final ModConfig modConfig) {
7375
configs.put(modConfig.getType(), modConfig);
7476
}
7577

78+
public void dispatchConfigEvent(ModConfig.ModConfigEvent event) {
79+
configHandler.ifPresent(configHandler -> configHandler.accept(event));
80+
}
81+
7682
public final void setParent(net.fabricmc.loader.api.ModContainer fabricModContainer) {
7783
this.fabricModContainer = fabricModContainer;
7884
}

patchwork-fml/src/main/java/net/minecraftforge/fml/config/ModConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ void setConfigData(final CommentedConfig configData) {
8686
}
8787

8888
void fireEvent(final ModConfigEvent configEvent) {
89-
// TODO this.container.dispatchConfigEvent(configEvent);
89+
this.container.dispatchConfigEvent(configEvent);
9090

91-
throw new UnsupportedOperationException();
91+
//throw new UnsupportedOperationException();
9292
}
9393

9494
public void save() {

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ include 'patchwork-events-world'
2626
include 'patchwork-extensions'
2727
include 'patchwork-extensions-block'
2828
include 'patchwork-extensions-blockentity'
29+
include 'patchwork-extensions-entity'
2930
include 'patchwork-extensions-item'
3031
include 'patchwork-extensions-shearing'
3132
include 'patchwork-fake-players'

0 commit comments

Comments
 (0)