Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
80b0d6d
Initial 1.21 port
Dqu1J Nov 11, 2025
7bd29ba
fix: rope inf recursion crash
Dqu1J Nov 11, 2025
d65185f
fix: data directory names
Dqu1J Nov 11, 2025
7deabd4
change: decrement patina level by 1, not 2
Dqu1J Nov 11, 2025
c5f5155
port: music discs
Dqu1J Nov 11, 2025
9b1211f
fix: github action
Dqu1J Nov 11, 2025
24ccf9d
fix: datapack
Dqu1J Nov 11, 2025
da6de41
change: watering can model displays
Dqu1J Nov 11, 2025
4f57218
1.21.1
Dqu1J Nov 11, 2025
aeb7f5f
fix: spyglass crossbow zoom
Dqu1J Nov 12, 2025
a2569df
port: rose gold
Dqu1J Nov 12, 2025
3253c75
fix: Items are added to creative tabs in reverse order #144
Dqu1J Nov 12, 2025
7a5646d
fix: rose gold tool attributes
Dqu1J Nov 13, 2025
da626ee
fix: trim not shown on item model for rose gold armor #145
Dqu1J Nov 13, 2025
50650fa
add: new rose gold crafting recipe, rose gold ingot
Dqu1J Nov 13, 2025
03b6c7d
add: rose gold block
Dqu1J Nov 13, 2025
1e9ac87
begin custom enchant glint colors
Dqu1J Nov 14, 2025
aa86020
refactor glint rendering
Dqu1J Nov 15, 2025
28d8b46
glint: fiddle the colors
Dqu1J Nov 15, 2025
a2ce4de
glint: implement for worn armor
Dqu1J Nov 15, 2025
367f0ea
glint: implement the rest of the rendertypes
Dqu1J Nov 15, 2025
13c97b1
glint: remove ThrownTridentRendererMixin
Dqu1J Nov 15, 2025
debd03b
add: suspicious dyes
Dqu1J Nov 16, 2025
0134804
refactor: AdditionalItems
Dqu1J Nov 16, 2025
3172848
whoops
Dqu1J Nov 16, 2025
1fae5aa
fix: add rose gold item tags
Dqu1J Nov 16, 2025
b7ffeef
add: glint color tooltip
Dqu1J Nov 16, 2025
426ea1a
refactor
Dqu1J Nov 16, 2025
28cdf28
remove: haste potions
Dqu1J Nov 16, 2025
2c44d3a
new config system
Dqu1J Nov 17, 2025
d336b3d
sync config from server
Dqu1J Nov 17, 2025
7b7d48c
fix: durability syncing with server
Dqu1J Nov 18, 2025
4ba4ffe
begin moving to architectury
Dqu1J Nov 18, 2025
c4cecd6
refactor: registry system; architectury: impl stuff on neoforge
Dqu1J Nov 19, 2025
aa229a7
refactor: make ConfigProperty not abstract
Dqu1J Nov 19, 2025
e02aa4a
ci: fix to publish both fabric and neoforge artifacts
Dqu1J Nov 21, 2025
133129f
update mod metadata
Dqu1J Nov 21, 2025
fe2b6f4
add glint override to suspicious dyes
Dqu1J Nov 21, 2025
959e968
update glint color tooltip
Dqu1J Nov 21, 2025
519d190
fix: glint dyeing recipe not working
Dqu1J Nov 21, 2025
61a0d99
fix: defer item.properties creation in item builder for neoforge compat
Dqu1J Nov 21, 2025
08f82fd
fix: neoforge armor glint
Dqu1J Nov 21, 2025
b528059
add: rope arrows
Dqu1J Nov 22, 2025
71446cd
make ropes not instabreak
Dqu1J Nov 22, 2025
a80ebea
make ropes waterloggable
Dqu1J Nov 22, 2025
1f53581
remove depth meter hud elevation display
Dqu1J Nov 22, 2025
2478ef6
pocket jukebox: display now playing in gui when playing
Dqu1J Nov 22, 2025
ff3501a
rename depth meter to barometer
Dqu1J Nov 22, 2025
4adf5bc
update copper patina texture
Dqu1J Nov 22, 2025
e86aafb
fix: rope arrow not dropping ropes when can't survive
Dqu1J Nov 22, 2025
b6b2497
add: albums
Dqu1J Nov 22, 2025
855202c
update creative tab ordering for items
Dqu1J Nov 22, 2025
f0103ce
album: implement for pocket jukebox + bug fixes
Dqu1J Nov 23, 2025
63f06b0
fix: sound lagging behind when moving at high speeds
Dqu1J Nov 23, 2025
c84f601
album: improve tooltip
Dqu1J Nov 23, 2025
9c9bb38
fix: dupe with rope arrows on multishot crossbow
Dqu1J Nov 23, 2025
7485126
fix: rope arrows dont drop ropes when entity is hit
Dqu1J Nov 23, 2025
4a975e4
fix: pocket jukebox sound offset from player
Dqu1J Nov 23, 2025
17d2e15
refactor: rewrite copper patina
Dqu1J Nov 23, 2025
e916023
add: mod compatibility warning system
Dqu1J Nov 23, 2025
4f94a71
album: highlight current track for pocket jukebox
Dqu1J Nov 23, 2025
cf8e0eb
test: begin adding gametests
Dqu1J Nov 24, 2025
b6b7902
test: add rope arrow tests
Dqu1J Nov 25, 2025
2396d82
test: add more copper patina tests
Dqu1J Nov 25, 2025
7a74cea
refactor: config file structure, food properties
Dqu1J Nov 25, 2025
e99afef
refactor: renames
Dqu1J Nov 25, 2025
d430f9f
test: fix package references in fabric.mod.json
Dqu1J Nov 25, 2025
f8f078b
test: add CopperPatinaWithCopperBlockTest
Dqu1J Nov 25, 2025
fa3e647
fix: amethyst lamp poi registration
Dqu1J Nov 25, 2025
f32b17c
fix: rename barometer config file; change default value
Dqu1J Nov 25, 2025
c65c708
fix: handle JsonSyntaxException in ConfigLoader
Dqu1J Nov 25, 2025
1435f61
remove: mysterious bundle
Dqu1J Nov 25, 2025
ba2dfc9
config: begin DFU impl
Dqu1J Nov 26, 2025
f7b47fe
config: clean up ConfigLoader
Dqu1J Nov 26, 2025
9bfb87c
config: fix FoodUnitConfig
Dqu1J Nov 26, 2025
28f4f97
config: fix CME
Dqu1J Nov 26, 2025
10c08a7
config: add file relocator & refactor
Dqu1J Nov 26, 2025
7e1c76f
config: disconnect client from server on version mismatch
Dqu1J Nov 26, 2025
5108755
fix: accesswidener
Dqu1J Nov 26, 2025
6bfd9ea
fix: accesswidener, again
Dqu1J Nov 26, 2025
1a05767
annotate RopeArrowRenderer with @Environment
Dqu1J Nov 27, 2025
f3ba49d
make PlayerMixin not always modify return value
Dqu1J Nov 27, 2025
2227854
change: add wrench blacklisted block tag, fix piston rotation
Dqu1J Dec 12, 2025
5bb4017
fix: copper patina softpowering redstone wire and vice versa
Dqu1J Dec 12, 2025
6ba32ef
fix: copper patina oxidizing
Dqu1J Dec 12, 2025
a776bd6
refactor: watering can
Dqu1J Dec 18, 2025
e2f1813
add: colored albums
Dqu1J Dec 18, 2025
9c93556
add: album dye recipe
Dqu1J Dec 20, 2025
c6a8215
fix: highlight album track in tooltip only for active pocket jukebox
Dqu1J Dec 20, 2025
11f287e
refactor: add common client initializer
Dqu1J Dec 20, 2025
7a77af6
add: crafting recipe for album
Dqu1J Dec 20, 2025
8732e5f
compat: JEI
Dqu1J Dec 20, 2025
fbb3fb2
compat: REI (partial)
Dqu1J Dec 20, 2025
2353317
refactor: config recipe removals
Dqu1J Dec 20, 2025
b4ee1b1
refactor: clean up mysterious_bundle stuff
Dqu1J Dec 20, 2025
d7d51f9
change: rename Amethyst Lamp to Tinted Redstone Lamp
Dqu1J Dec 20, 2025
caaf754
change: make tinted lamp match vanilla behavior
Dqu1J Dec 20, 2025
0efaa09
add: Rose Gold Horse Armor
Dqu1J Dec 22, 2025
60ff092
fix: use synthetic ids in jei compat
Dqu1J Dec 22, 2025
e5024ff
fix: watering can fluid pickup sound
Dqu1J Dec 22, 2025
7cbbd38
fix: jeicompat remove suspicious dye recipe if emi is present
Dqu1J Dec 22, 2025
467b0d5
fix: make barometer work outside player inventory
Dqu1J Dec 23, 2025
0f77c05
config: add rose gold configs
Dqu1J Dec 23, 2025
b778e2a
fix: add tag translation keys
Dqu1J Dec 23, 2025
edc96b6
fix: add new config types to v1 schema
Dqu1J Dec 23, 2025
99fab67
refactor: remove getAllConfigProperties from Config class
Dqu1J Dec 24, 2025
0a52917
refactor: remove ConfigurableToolItem class
Dqu1J Dec 24, 2025
64d6cd6
fix: add rose gold axe to combat creative tab
Dqu1J Dec 24, 2025
c2e0543
fix: inserting too many items into chest loot
Dqu1J Dec 26, 2025
eb4cf15
change: update crossbow with spyglass model
Dqu1J Dec 30, 2025
0deba95
fix: crossbow with spyglass not enchantable
Dqu1J Dec 30, 2025
a7c5ef1
config: use json5 for files, add field comments
Dqu1J Dec 31, 2025
1e1b4e2
change: make album capacity configurable
Dqu1J Jan 1, 2026
a7822e2
change: for watering can make configurable level volume and fertilize…
Dqu1J Jan 1, 2026
678767e
fix: check if bonemeal target is valid in watering can
Dqu1J Jan 1, 2026
df3ce99
config: fix dfu schema; rename a field in barometer config
Dqu1J Jan 1, 2026
4d8276b
change: improve tooltip display for large album contents
Dqu1J Jan 1, 2026
984fd62
fix: attack speed serialization in config
Dqu1J Jan 1, 2026
06285a4
i18n: finalize translation entries
Dqu1J Jan 2, 2026
93fb589
i18n: update ro_ro
Dqu1J Jan 2, 2026
d62a481
i18n: update ru_ru
Dqu1J Jan 2, 2026
46ed59d
i18n: fix ro_ro translation for barometer elevation
Dqu1J Jan 2, 2026
26759b3
i18n: update en_us
Dqu1J Jan 2, 2026
bce4ee2
i18n: update ru_ru
Dqu1J Jan 2, 2026
299ea7e
i18n: add missing keys
Dqu1J Jan 2, 2026
afae6ea
i18n: update ro_ro
Dqu1J Jan 3, 2026
91a7d7b
i18n: add fr_fr
Dqu1J Jan 3, 2026
c77f5f6
i18n: add da_dk
Dqu1J Jan 3, 2026
1d42a52
i18n: update uk_ua
Dqu1J Jan 3, 2026
e064b23
i18n: fix typo in uk_ua
Dqu1J Jan 3, 2026
243b3ed
i18n: fix typos in ru_ru
Dqu1J Jan 3, 2026
e54702f
update mod logo
Dqu1J Jan 3, 2026
be8af10
refactor: move FluidHelper class to util package
Dqu1J Jan 4, 2026
eff498e
advancement: add play_pocket_jukebox
Dqu1J Jan 4, 2026
3d0721b
advancement: remove old advancements
Dqu1J Jan 4, 2026
a77f611
advancement: add obtain_chicken_nugget
Dqu1J Jan 4, 2026
a539ce0
advancement: add obtain_rose_gold
Dqu1J Jan 4, 2026
c5bd4ab
advancement: add use_watering_can
Dqu1J Jan 4, 2026
a9eacf9
advancement: add play_album
Dqu1J Jan 4, 2026
31e8281
advancement: add fill_album_same_disc
Dqu1J Jan 4, 2026
876bd42
refactor: advancement triggers
Dqu1J Jan 4, 2026
36e9c06
advancement: add use_tinted_redstone_lamp
Dqu1J Jan 4, 2026
0df67f2
advancement: add obtain_suspicious_dye
Dqu1J Jan 4, 2026
51dc5cd
change: make only enchantable items dyeable by suspicious dye
Dqu1J Jan 5, 2026
93dcd91
advancement: add use_all_suspicious_dyes
Dqu1J Jan 5, 2026
9743a02
add: begin 11 new sniffer flowers
Dqu1J Jan 5, 2026
067aa69
plants: fix models
Dqu1J Jan 6, 2026
56b489a
plants: fix seeds & FlowerCropBlock
Dqu1J Jan 6, 2026
95df669
plants: add growth stage textures
Dqu1J Jan 6, 2026
6ce3478
plants: update shapes for crops
Dqu1J Jan 6, 2026
9974095
plants: add block loot tables
Dqu1J Jan 6, 2026
8e5299c
plants: add seed textures, some renames
Dqu1J Jan 7, 2026
d0eeecf
plants: fix crop loot table entries
Dqu1J Jan 7, 2026
2fbb708
plants: implement lotus lily
Dqu1J Jan 7, 2026
b00d96f
plants: fix lang entries
Dqu1J Jan 7, 2026
232c612
plants: fix shading for tall_cross model
Dqu1J Jan 8, 2026
aa74505
plants: implement wisteria
Dqu1J Jan 8, 2026
533054e
plants: fix lotus lily shading
Dqu1J Jan 8, 2026
e95850d
remove: crossbow with spyglass (for now...)
Dqu1J Jan 8, 2026
4b82ee4
refactor: make loot table injections data-driven
Dqu1J Jan 11, 2026
59d69db
fix: glow stick item doing nothing
Dqu1J Jan 11, 2026
3f90438
change: reduce chicken nugget drop rates
Dqu1J Jan 11, 2026
10e477e
i18n: update ru_ru
Dqu1J Jan 12, 2026
f901031
i18n: update uk_ua
Dqu1J Jan 12, 2026
3119dfd
i18n: update de_de
Dqu1J Jan 12, 2026
b671a8f
i18n: update ro_ro
Dqu1J Jan 12, 2026
ee4f1c5
i18n: update da_dk
Dqu1J Jan 12, 2026
938544c
i18n: add sr_cs, sr_sp
Dqu1J Jan 13, 2026
b8e1526
fix: defer default config file creation until registries ready
Dqu1J Jan 15, 2026
9d30aa6
i18n: update zh_cn; add zh_tw, zh_hk
Dqu1J Jan 15, 2026
845b816
fix: fr_fr.json file
Dqu1J Jan 15, 2026
69b86d1
tag items and blocks
Dqu1J Jan 15, 2026
5f31957
plants: add dye recipes for new sniffer flowers
Dqu1J Jan 15, 2026
cff80b5
plants: i18n fr_fr for seed items
Dqu1J Jan 15, 2026
22d2798
refactor: rope placement logic in RopeBlock
Dqu1J Jan 15, 2026
fdddb1f
advancements: add place_rope_world_height
Dqu1J Jan 15, 2026
14a864c
change: add a particle effect to watering can
Dqu1J Jan 17, 2026
7f7f39f
refactor: move some classes from `misc` to `feature` package
Dqu1J Jan 17, 2026
e9ed13b
fix: save VersionConfig defaults immediately in ConfigLoader
Dqu1J Jan 17, 2026
4f9ed66
add: data-driven brewing stand recipe support
Dqu1J Jan 17, 2026
50938a3
add: suspicious dye recipes
Dqu1J Jan 17, 2026
59e3339
compat: update JEI integration
Dqu1J Jan 17, 2026
fbe5daa
compat: update REI integration
Dqu1J Jan 17, 2026
ec0ef71
config: add SnifferPlantsConfig and SuspiciousDyeConfig
Dqu1J Jan 17, 2026
e224166
config: add checks to item registrations
Dqu1J Jan 18, 2026
3233a7c
fix: move recipes to correct directories
Dqu1J Jan 18, 2026
b046384
fix: jei/rei compat
Dqu1J Jan 18, 2026
5676d73
plants: add seed drops to sniffer loot table
Dqu1J Jan 18, 2026
9e32c0a
fix: neoforge LootTableLoadEvent listener not registered correctly
Dqu1J Jan 18, 2026
47f6482
add: recipe book advancements
Dqu1J Jan 18, 2026
98919e9
change: place glow stick normally if block is targetted
Dqu1J Jan 22, 2026
d01965c
change: update glow stick canSurvive. refactor: glow stick rotation
Dqu1J Jan 22, 2026
6d78ab6
fix: glow stick block collision & landing cansurvive check
Dqu1J Jan 22, 2026
7c0555a
change: adjust GlowStickBlock voxel shape dimensions
Dqu1J Jan 22, 2026
1efdf47
change: make glow sticks waterloggable
Dqu1J Jan 22, 2026
d9a7edc
compat: glow stick entity dynamic lights support
Dqu1J Jan 22, 2026
677bcb7
Delete creeper_drop_music_discs.json
Dqu1J Jan 22, 2026
4091781
change: update glow stick texture
Dqu1J Jan 22, 2026
7f4c656
change: update default food stats for added foods
Dqu1J Jan 22, 2026
3f233fb
compat: disable lithium's mixin.block.redstone_wire for copper patina…
Dqu1J Jan 22, 2026
b1db323
compat: hide disabled items in JEI/REI
Dqu1J Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 19 additions & 9 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
- uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
java-version: '21'
distribution: 'temurin'

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew build
- name: Publish artifacts
uses: actions/upload-artifact@v2

- name: Publish Fabric artifacts
uses: actions/upload-artifact@v4
with:
name: Fabric-Package
path: fabric/build/libs/*.jar

- name: Publish NeoForge artifacts
uses: actions/upload-artifact@v4
with:
name: Package
path: build/libs
name: NeoForge-Package
path: neoforge/build/libs/*.jar
160 changes: 66 additions & 94 deletions build.gradle
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,102 +1,74 @@
plugins {
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'io.github.juuxel.loom-quiltflower' version '1.7.1'
id 'maven-publish'
id 'dev.architectury.loom' version '1.11-SNAPSHOT' apply false
id 'architectury-plugin' version '3.4-SNAPSHOT'
id 'com.gradleup.shadow' version '8.3.6' apply false
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group

repositories {
maven {
url "https://maven.terraformersmc.com/releases"
}
maven {
name = "CottonMC"
url = "https://server.bbkr.space/artifactory/libs-release"
}
maven {
name = "Gegy"
url = "https://maven.gegy.dev"
}
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// ModMenu API
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"

// LibGui
modImplementation include("io.github.cottonmc:LibGui:${project.libgui_version}")

// LambDynamicLights
modImplementation "dev.lambdaurora:lambdynamiclights:${project.lambdynamiclights_version}"

// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
// You may need to force-disable transitiveness on them.
}

processResources {
inputs.property "version", project.version

filesMatching("fabric.mod.json") {
expand "version": project.version
}
}

tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8"

// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
architectury {
minecraft = project.minecraft_version
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
allprojects {
group = rootProject.maven_group
version = rootProject.mod_version
}

loom {
accessWidenerPath = file("src/main/resources/additionaladditions.accesswidener")
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
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.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
subprojects {
apply plugin: 'dev.architectury.loom'
apply plugin: 'architectury-plugin'
apply plugin: 'maven-publish'

base {
// Set up a suffixed format for the mod jar names, e.g. `example-fabric`.
archivesName = "$rootProject.archives_name-$project.name"
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
}

loom {
silentMojangMappingsLicense()
}

dependencies {
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version"
mappings loom.officialMojangMappings()
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}

// Configure Maven publishing.
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = base.archivesName.get()
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.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}
}
22 changes: 22 additions & 0 deletions common/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
architectury {
common rootProject.enabled_platforms.split(',')
}

repositories {
maven {
name = "JEI"
url = "https://maven.blamejared.com/"
}
}

dependencies {
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version"

modCompileOnly "mezz.jei:jei-${minecraft_version}-common-api:${jei_api_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api:${rei_api_version}"
modCompileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin:${rei_api_version}"
}

loom {
accessWidenerPath = file("../common/src/main/resources/additionaladditions.accesswidener" )
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package one.dqu.additionaladditions;

import one.dqu.additionaladditions.config.Config;
import one.dqu.additionaladditions.config.io.ConfigLoader;
import one.dqu.additionaladditions.registry.*;
import one.dqu.additionaladditions.util.ModCompatibility;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class AdditionalAdditions {
public static final String NAMESPACE = "additionaladditions";
public static final Logger LOGGER = LoggerFactory.getLogger(NAMESPACE);

public static void init() {
ConfigLoader.load();

AAMisc.registerAll();
AAEntities.registerAll();
AAItems.registerAll();
AABlocks.registerAll();

ModCompatibility.add(
() -> Config.COPPER_PATINA.get().enabled(),
"Alternate Current mod is incompatible with the Copper Patina feature. Please disable Copper Patina in the config or uninstall Alternate Current.",
"alternate-current", "alternate_current"
);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package one.dqu.additionaladditions;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.item.ClampedItemPropertyFunction;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
import one.dqu.additionaladditions.item.PocketJukeboxItem;
import one.dqu.additionaladditions.registry.AAItems;
import one.dqu.additionaladditions.registry.AAMisc;

@Environment(EnvType.CLIENT)
public final class AdditionalAdditionsClient {
public static void init() {
itemProperties();
}

private static void itemProperties() {
ItemProperties.register(AAItems.POCKET_JUKEBOX_ITEM.get(), ResourceLocation.withDefaultNamespace("disc"), ((itemStack, clientWorld, livingEntity, worldSeed) -> {
return PocketJukeboxItem.hasDisc(itemStack) ? 1.0F : 0.0F;
}));

ClampedItemPropertyFunction albumFunction = (itemStack, clientWorld, livingEntity, worldSeed) -> {
if (!itemStack.has(AAMisc.ALBUM_CONTENTS_COMPONENT.get())) {
return 0.0F;
}
return itemStack.get(AAMisc.ALBUM_CONTENTS_COMPONENT.get()).items().isEmpty() ? 0.0F : 1.0F;
};
ResourceLocation albumLocation = ResourceLocation.fromNamespaceAndPath(AdditionalAdditions.NAMESPACE, "disc");
ItemProperties.register(AAItems.ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.WHITE_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.LIGHT_GRAY_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.GRAY_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.BLACK_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.BROWN_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.RED_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.ORANGE_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.YELLOW_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.LIME_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.GREEN_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.CYAN_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.LIGHT_BLUE_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.BLUE_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.PURPLE_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.MAGENTA_ALBUM.get(), albumLocation, albumFunction);
ItemProperties.register(AAItems.PINK_ALBUM.get(), albumLocation, albumFunction);

ItemProperties.register(AAItems.BAROMETER.get(), ResourceLocation.withDefaultNamespace("angle"), (itemStack, clientWorld, livingEntity, worldSeed) -> {
Entity entity = livingEntity != null ? livingEntity : itemStack.getEntityRepresentation();
if (entity == null) return 0.3125F;
Level world = entity.level();

float sea = world.getSeaLevel();
float height = entity.getBlockY();
float top = world.getMaxBuildHeight();
float bottom = world.getMinBuildHeight();

if (height > top) return 0;
if (height < bottom) return 1;

if (height >= sea) {
double val = (height / (2 * (sea - top))) + 0.25 - ((sea + top) / (4 * (sea - top)));
return (float) val;
} else {
double val = (height / (2 * (bottom - sea))) + 0.75 - ((bottom + sea) / (4 * (bottom - sea)));
return (float) val;
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package one.dqu.additionaladditions.block;

import net.minecraft.world.level.block.RedStoneWireBlock;

public class CopperPatinaBlock extends RedStoneWireBlock {
public CopperPatinaBlock(Properties properties) {
super(properties);
}
}
Loading