5 Commits

Author SHA1 Message Date
Motschen
2a2b97f41a 2.0.0 - Config and Smart Leaves resourcepack! 2021-01-14 16:21:32 +01:00
Motschen
d762b6c022 Rename to Cull Leaves 2020-11-28 20:02:58 +01:00
Motschen
b05452ecf1 Update README.md 2020-11-28 19:20:44 +01:00
Motschen
361a77aa01 Rename to Cull Leaves 2020-11-28 19:20:04 +01:00
Motschen
26277f87e5 Update README.md 2020-11-28 19:03:45 +01:00
16 changed files with 192 additions and 13 deletions

View File

@@ -1,2 +1,2 @@
# Fast Leaves # Cull Leaves
Adds culling to leaf blocks, providing a huge performance boost over vanilla. Adds culling to leaf blocks, providing a huge performance boost over vanilla.

View File

@@ -24,6 +24,18 @@ dependencies {
modCompile "net.fabricmc:fabric-loader:${project.loader_version}" modCompile "net.fabricmc:fabric-loader:${project.loader_version}"
modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation ("me.sargunvohra.mcmods:autoconfig1u:${project.auto_config_version}"){
exclude module: "fabric-api"
}
modImplementation ("me.shedaniel.cloth:config-2:${project.cloth_config_version}"){
exclude module: "fabric-api"
}
modImplementation ("io.github.prospector:modmenu:${project.mod_menu_version}"){
exclude module: "fabric-api"
}
include "me.sargunvohra.mcmods:autoconfig1u:${project.auto_config_version}"
include "me.shedaniel.cloth:config-2:${project.cloth_config_version}"
} }
processResources { processResources {

View File

@@ -8,10 +8,14 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.10.8 loader_version=0.10.8
# Mod Properties # Mod Properties
mod_version = 1.0.0 mod_version = 2.0.0
maven_group = eu.midnightdust maven_group = eu.midnightdust
archives_base_name = fastleaves archives_base_name = cullleaves
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.26.1+1.16 fabric_version=0.26.1+1.16
auto_config_version = 3.3.1
cloth_config_version = 4.8.3
mod_menu_version = 1.14.6+build.31

View File

@@ -0,0 +1,22 @@
package eu.midnightdust.cullleaves;
import eu.midnightdust.cullleaves.config.CullLeavesConfig;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.sargunvohra.mcmods.autoconfig1u.serializer.JanksonConfigSerializer;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.util.Identifier;
public class CullLeavesClient implements ClientModInitializer {
public static CullLeavesConfig CL_CONFIG;
public void onInitializeClient() {
AutoConfig.register(CullLeavesConfig.class, JanksonConfigSerializer::new);
CL_CONFIG = AutoConfig.getConfigHolder(CullLeavesConfig.class).getConfig();
FabricLoader.getInstance().getModContainer("cullleaves").ifPresent(modContainer -> {
ResourceManagerHelper.registerBuiltinResourcePack(new Identifier("cullleaves:smartleaves"), "resourcepacks/smartleaves", modContainer, true);
});
}
}

View File

@@ -0,0 +1,14 @@
package eu.midnightdust.cullleaves.config;
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.Comment;
import net.minecraft.client.render.entity.PlayerModelPart;
@Config(name = "cullleaves")
public class CullLeavesConfig implements ConfigData {
@ConfigEntry.Gui.PrefixText // Enable/Disable the mod. Requires Chunk Reload (F3 + A).
public boolean enabled = true;
}

View File

@@ -0,0 +1,16 @@
package eu.midnightdust.cullleaves.config;
import io.github.prospector.modmenu.api.ConfigScreenFactory;
import io.github.prospector.modmenu.api.ModMenuApi;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
@Environment(EnvType.CLIENT)
public class ModMenuIntegration implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return parent -> AutoConfig.getConfigScreen(CullLeavesConfig.class, parent).get();
}
}

View File

@@ -1,5 +1,6 @@
package eu.midnightdust.fastleaves.mixin; package eu.midnightdust.cullleaves.mixin;
import eu.midnightdust.cullleaves.CullLeavesClient;
import net.fabricmc.api.EnvType; import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@@ -19,6 +20,9 @@ public class MixinLeavesBlock extends Block {
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public boolean isSideInvisible(BlockState state, BlockState neighborState, Direction offset) { public boolean isSideInvisible(BlockState state, BlockState neighborState, Direction offset) {
return neighborState.getBlock() instanceof LeavesBlock; if (CullLeavesClient.CL_CONFIG.enabled) {
return neighborState.getBlock() instanceof LeavesBlock;
}
else return false;
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,5 @@
{
"text.autoconfig.cullleaves.title":"Cull Leaves Config",
"text.autoconfig.cullleaves.option.enabled.@PrefixText":"After changing this setting you have to reload all chunks (F3 + A)",
"text.autoconfig.cullleaves.option.enabled":"Enabled"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,6 +1,6 @@
{ {
"required": true, "required": true,
"package": "eu.midnightdust.fastleaves.mixin", "package": "eu.midnightdust.cullleaves.mixin",
"compatibilityLevel": "JAVA_8", "compatibilityLevel": "JAVA_8",
"client": [ "client": [
"MixinLeavesBlock" "MixinLeavesBlock"

View File

@@ -1,9 +1,9 @@
{ {
"schemaVersion": 1, "schemaVersion": 1,
"id": "fastleaves", "id": "cullleaves",
"version": "${version}", "version": "${version}",
"name": "Fast Leaves", "name": "Cull Leaves",
"description": "Adds culling to leaf blocks, providing a huge performance boost over vanilla.", "description": "Adds culling to leaf blocks, providing a huge performance boost over vanilla.",
"authors": [ "authors": [
"Motschen", "Motschen",
@@ -11,16 +11,29 @@
], ],
"contact": { "contact": {
"homepage": "https://www.midnightdust.eu/", "homepage": "https://www.midnightdust.eu/",
"sources": "https://github.com/TeamMidnightDust/FastLeaves", "sources": "https://github.com/TeamMidnightDust/CullLeaves",
"issues": "https://github.com/TeamMidnightDust/FastLeaves/issues" "issues": "https://github.com/TeamMidnightDust/CullLeaves/issues"
}, },
"license": "MIT", "license": "MIT",
"icon": "assets/fastleaves/icon.png", "icon": "assets/cullleaves/icon.png",
"environment": "client", "environment": "client",
"entrypoints": {
"client": [
"eu.midnightdust.cullleaves.CullLeavesClient"
],
"modmenu": [
"eu.midnightdust.cullleaves.config.ModMenuIntegration"
]
},
"depends": {
"fabric-resource-loader-v0": "*",
"minecraft": ">=1.16"
},
"mixins": [ "mixins": [
"fastleaves.mixins.json" "cullleaves.mixins.json"
] ]
} }

View File

@@ -0,0 +1,73 @@
{
"credit": "made by Motschen",
"parent": "block/block",
"textures": {
"particle": "#all"
},
"elements": [
{
"name": "main",
"from": [0, 0, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "north", "tintindex": 0},
"east": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "east", "tintindex": 0},
"south": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "south", "tintindex": 0},
"west": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "west", "tintindex": 0},
"up": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up", "tintindex": 0},
"down": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "down", "tintindex": 0}
}
},
{
"name": "bottom",
"from": [0, 0, 0],
"to": [16, 0, 16],
"faces": {
"up": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "down", "tintindex": 0}
}
},
{
"name": "west",
"from": [0, 0, 0],
"to": [0, 16, 16],
"faces": {
"east": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "west", "tintindex": 0}
}
},
{
"name": "north",
"from": [0, 0, 0],
"to": [16, 16, 0],
"faces": {
"south": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "north", "tintindex": 0}
}
},
{
"name": "east",
"from": [16, 0, 0],
"to": [16, 16, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [23, 8, 8]},
"faces": {
"west": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "east", "tintindex": 0}
}
},
{
"name": "south",
"from": [0, 0, 16],
"to": [16, 16, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 8, 23]},
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "south", "tintindex": 0}
}
},
{
"name": "up",
"from": [0, 16, 0],
"to": [16, 16, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 23, 8]},
"faces": {
"down": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up", "tintindex": 0}
}
}
]
}

View File

@@ -0,0 +1,10 @@
The MIT License
Copyright © 2020 Motschen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 6,
"description": "§2Makes the leaves look identical to the optifine smart leaves effect"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB