-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add Fabric (>=0.96.11+1.20.4) support (Fabric, Quilt)
- updated BucketLib to 1.20.4-3.2.0.2 - break temperature can also be configured to be negative (Deactivation by setting a number larger than the hottest fluid) - changed the config descriptions to be more precisely
- Loading branch information
Showing
25 changed files
with
400 additions
and
81 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 |
---|---|---|
|
@@ -23,6 +23,7 @@ body: | |
- Fabric | ||
- Forge | ||
- NeoForge | ||
- Quilt | ||
validations: | ||
required: true | ||
- type: input | ||
|
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
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
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
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
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
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
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
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,68 @@ | ||
plugins { | ||
id 'java' | ||
id 'idea' | ||
id 'maven-publish' | ||
id 'fabric-loom' version '[1.6.6,1.7)' | ||
} | ||
base { | ||
archivesName = "${mod_id}-fabric" | ||
} | ||
|
||
repositories { | ||
maven { url "https://maven.shedaniel.me/" } | ||
maven { url "https://maven.terraformersmc.com/releases/" } | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${minecraft_version}" | ||
mappings loom.officialMojangMappings() | ||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" | ||
|
||
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}") { | ||
exclude(group: "net.fabricmc.fabric-api") | ||
} | ||
modImplementation("com.terraformersmc:modmenu:${mod_menu_version}") | ||
|
||
modImplementation("com.github.cech12.BucketLib:fabric:${bucketlib_version}") | ||
|
||
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' | ||
compileOnly project(":common") | ||
} | ||
|
||
loom { | ||
if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) { | ||
accessWidenerPath.set(project(":common").file("src/main/resources/${mod_id}.accesswidener")) | ||
} | ||
mixin { | ||
defaultRefmapName.set("${mod_id}.refmap.json") | ||
} | ||
runs { | ||
client { | ||
client() | ||
setConfigName("Fabric Client") | ||
ideConfigGenerated(true) | ||
runDir("run") | ||
} | ||
server { | ||
server() | ||
setConfigName("Fabric Server") | ||
ideConfigGenerated(true) | ||
runDir("run") | ||
} | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
source(project(":common").sourceSets.main.allSource) | ||
} | ||
//tasks.withType(Javadoc).configureEach { | ||
// source(project(":common").sourceSets.main.allJava) | ||
//} | ||
//tasks.named("sourcesJar", Jar) { | ||
// from(project(":common").sourceSets.main.allSource) | ||
//} | ||
|
||
processResources { | ||
from project(":common").sourceSets.main.resources | ||
} |
42 changes: 42 additions & 0 deletions
42
fabric/src/main/java/de/cech12/ceramicbucket/CeramicBucketMod.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,42 @@ | ||
package de.cech12.ceramicbucket; | ||
|
||
import de.cech12.bucketlib.api.BucketLibApi; | ||
import de.cech12.bucketlib.api.item.UniversalBucketItem; | ||
import de.cech12.ceramicbucket.init.ModTags; | ||
import de.cech12.ceramicbucket.platform.Services; | ||
import net.fabricmc.api.ModInitializer; | ||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.item.CreativeModeTabs; | ||
import net.minecraft.world.item.Item; | ||
|
||
@SuppressWarnings("unused") | ||
public class CeramicBucketMod implements ModInitializer { | ||
|
||
public static final ResourceLocation UNFIRED_CLAY_BUCKET_LOCATION = new ResourceLocation(Constants.MOD_ID, "unfired_clay_bucket"); | ||
public static final ResourceLocation CERAMIC_BUCKET_LOCATION = new ResourceLocation(Constants.MOD_ID, "ceramic_bucket"); | ||
|
||
public static final Item UNFIRED_CLAY_BUCKET = Registry.register(BuiltInRegistries.ITEM, UNFIRED_CLAY_BUCKET_LOCATION, new Item(new Item.Properties())); | ||
public static final Item CERAMIC_BUCKET = Registry.register(BuiltInRegistries.ITEM, CERAMIC_BUCKET_LOCATION, new UniversalBucketItem(new UniversalBucketItem.Properties() | ||
.upperCrackingTemperature(Services.CONFIG::getBreakTemperature) | ||
.crackingFluids(ModTags.Fluids.CERAMIC_CRACKING) | ||
.milking(Services.CONFIG::isMilkingEnabled) | ||
.entityObtaining(Services.CONFIG::isFishObtainingEnabled) | ||
.dyeable(14975336) | ||
.durability(Services.CONFIG::getDurability) | ||
)); | ||
|
||
@Override | ||
public void onInitialize() { | ||
CommonLoader.init(); | ||
//register bucket | ||
BucketLibApi.registerBucket(CERAMIC_BUCKET_LOCATION); | ||
//register creative tab | ||
ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.INGREDIENTS).register(content -> { | ||
content.accept(UNFIRED_CLAY_BUCKET); | ||
}); | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
fabric/src/main/java/de/cech12/ceramicbucket/compat/ModMenuCompat.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,18 @@ | ||
package de.cech12.ceramicbucket.compat; | ||
|
||
import com.terraformersmc.modmenu.api.ConfigScreenFactory; | ||
import com.terraformersmc.modmenu.api.ModMenuApi; | ||
import de.cech12.ceramicbucket.platform.FabricConfigHelper; | ||
import me.shedaniel.autoconfig.AutoConfig; | ||
import net.fabricmc.api.EnvType; | ||
import net.fabricmc.api.Environment; | ||
|
||
@Environment(EnvType.CLIENT) | ||
public class ModMenuCompat implements ModMenuApi { | ||
|
||
@Override | ||
public ConfigScreenFactory<?> getModConfigScreenFactory() { | ||
return parent -> AutoConfig.getConfigScreen(FabricConfigHelper.class, parent).get(); | ||
} | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
fabric/src/main/java/de/cech12/ceramicbucket/platform/FabricConfigHelper.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,60 @@ | ||
package de.cech12.ceramicbucket.platform; | ||
|
||
import de.cech12.ceramicbucket.Constants; | ||
import de.cech12.ceramicbucket.platform.services.IConfigHelper; | ||
import me.shedaniel.autoconfig.AutoConfig; | ||
import me.shedaniel.autoconfig.ConfigData; | ||
import me.shedaniel.autoconfig.annotation.Config; | ||
import me.shedaniel.autoconfig.annotation.ConfigEntry; | ||
import me.shedaniel.autoconfig.serializer.Toml4jConfigSerializer; | ||
|
||
/** | ||
* The config service implementation for Fabric. | ||
*/ | ||
@Config(name = Constants.MOD_ID) | ||
public class FabricConfigHelper implements ConfigData, IConfigHelper { | ||
|
||
@ConfigEntry.Gui.Tooltip(count = 5) | ||
@ConfigEntry.BoundedDiscrete(min = BREAK_TEMPERATURE_MIN, max = BREAK_TEMPERATURE_MAX) | ||
public long BREAK_TEMPERATURE = BREAK_TEMPERATURE_DEFAULT; | ||
|
||
@ConfigEntry.Gui.Tooltip(count = 4) | ||
@ConfigEntry.BoundedDiscrete(min = DURABILITY_MIN, max = DURABILITY_MAX) | ||
public long DURABILITY = DURABILITY_DEFAULT; | ||
|
||
@ConfigEntry.Gui.Tooltip(count = 4) | ||
public boolean FISH_OBTAINING_ENABLED = FISH_OBTAINING_ENABLED_DEFAULT; | ||
|
||
@ConfigEntry.Gui.Tooltip(count = 4) | ||
public boolean MILKING_ENABLED = MILKING_ENABLED_DEFAULT; | ||
|
||
@Override | ||
public void init() { | ||
AutoConfig.register(FabricConfigHelper.class, Toml4jConfigSerializer::new); | ||
} | ||
|
||
private FabricConfigHelper getConfig() { | ||
return AutoConfig.getConfigHolder(FabricConfigHelper.class).getConfig(); | ||
} | ||
|
||
@Override | ||
public int getBreakTemperature() { | ||
return (int) getConfig().BREAK_TEMPERATURE; | ||
} | ||
|
||
@Override | ||
public int getDurability() { | ||
return (int) getConfig().DURABILITY; | ||
} | ||
|
||
@Override | ||
public boolean isFishObtainingEnabled() { | ||
return getConfig().FISH_OBTAINING_ENABLED; | ||
} | ||
|
||
@Override | ||
public boolean isMilkingEnabled() { | ||
return getConfig().MILKING_ENABLED; | ||
} | ||
|
||
} |
Oops, something went wrong.