Skip to content

Commit

Permalink
Initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
kada49 committed Aug 14, 2023
1 parent 866438e commit 8417ad5
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 80 deletions.
17 changes: 2 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# Template for a Minecraft Forge 1.8.9 Mod
# DisableBurningAnimation

## Usage
This guide works with JetBrains' [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/).

There are two main ways to use template, choose the one that fits you best

1. First Method
* Click on the `Code` button [here](https://github.com/kada49/ForgeTemplate), then click "Download ZIP" or download it directly from [here](https://github.com/kada49/ForgeTemplate/archive/refs/heads/master.zip).
* Extract the folder from the ZIP folder and open the project in IntelliJ IDEA
2. Second Method
* Click on the `Use this template` button [here](https://github.com/kada49/ForgeTemplate) or follow [this link](https://github.com/kada49/ForgeTemplate/generate).
* Create your own project.
* In IntelliJ IDEA open the project by copying your repository's URL, clicking `Get from VCS`, paste the URL and click `Clone`.

When you opened the project replace the mod's name - `ForgeTemplate`, the mod id - `forgetemplate` and the mod version - `1.0` in the `gradle.properties` file and in the main mod class.
Disables the burning animation overlay. Mostly used in the Hypixel SkyBlock Floor 7 Dungeon. Toggle with '/disableburninganimation' or '/dba'.
37 changes: 1 addition & 36 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,14 @@ group = modGroup
version = modVersion
base.archivesName.set(modName)

loom {
// Uncomment this if you want to use the essential library
/*
runConfigs.getByName("client") {
programArgs("--tweakClass", "gg.essential.loader.stage0.EssentialSetupTweaker")
}
*/

forge.pack200Provider.set(Pack200Adapter())
}

repositories {
maven("https://repo.essential.gg/repository/maven-public")
}
loom.forge.pack200Provider.set(Pack200Adapter())

//Creates a configuration called `include` to declare dependencies
val embed: Configuration by configurations.creating
configurations.implementation.get().extendsFrom(embed)

dependencies {
// Dependencies required for loom to set up the development environment
minecraft("com.mojang:minecraft:1.8.9")
mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9")
forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9")

// Uncomment the following lines if you want to use the essential library
embed("gg.essential:loader-launchwrapper:1.2.1")
compileOnly("gg.essential:essential-1.8.9-forge:13419+gad15d412e")
}

tasks {
Expand All @@ -54,21 +34,6 @@ tasks {
}
}

jar {
// Includes dependencies added with 'include' in the final .jar mod file
from(embed.files.map { zipTree(it) })

// Uncomment this if you want to use the essential library
/*
manifest.attributes(
mapOf(
"ModSide" to "CLIENT",
"TweakClass" to "gg.essential.loader.stage0.EssentialSetupTweaker"
)
)
*/
}

withType<JavaCompile> {
options.release.set(8)
options.encoding = "UTF-8"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
loom.platform=forge
modGroup=it.kada49
modName=ForgeTemplate
modName=DisableBurningAnimation
modVersion=1.0

org.gradle.daemon=true
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ pluginManagement {
}
}

rootProject.name = "ForgeTemplate"
rootProject.name = "DisableBurningAnimation"
44 changes: 44 additions & 0 deletions src/main/java/it/kada49/DisableBurningAnimation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package it.kada49;

import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.client.event.RenderBlockOverlayEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import java.io.File;


@Mod(name = "DisableBurningAnimation", modid = "disableburninganimation", version = "1.0", updateJSON = "https://kada49.github.io/json/DisableBurningAnimation-updateJson.json")
public class DisableBurningAnimation {

public static Property ENABLED;
public static Configuration CONFIG;

@EventHandler
@SuppressWarnings("unused")
public void init(FMLInitializationEvent event) {
ClientCommandHandler.instance.registerCommand(new ToggleCommand());

MinecraftForge.EVENT_BUS.register(this);

File configFile = new File(Loader.instance().getConfigDir(), "disableburninganimation.cfg");
CONFIG = new Configuration(configFile);
CONFIG.load();
ENABLED = CONFIG.get("General", "burningEnabled", true);
CONFIG.save();
}

@SubscribeEvent
@SuppressWarnings("unused")
public void blockOverlayEvent(RenderBlockOverlayEvent event) {
if (event.overlayType == RenderBlockOverlayEvent.OverlayType.FIRE && !ENABLED.getBoolean()) {
event.setCanceled(true);
}
}
}
22 changes: 0 additions & 22 deletions src/main/java/it/kada49/ForgeTemplate.java

This file was deleted.

44 changes: 44 additions & 0 deletions src/main/java/it/kada49/ToggleCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package it.kada49;

import net.minecraft.client.Minecraft;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;

import java.util.ArrayList;
import java.util.List;

import static it.kada49.DisableBurningAnimation.CONFIG;
import static it.kada49.DisableBurningAnimation.ENABLED;

public class ToggleCommand extends CommandBase {
@Override
public String getCommandName() {
return "disableburninganimation";
}

@Override
public String getCommandUsage(ICommandSender sender) {
return null;
}

@Override
public void processCommand(ICommandSender sender, String[] args) {
ENABLED.set(!ENABLED.getBoolean());
CONFIG.save();

Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentText("Burning Animation " + (ENABLED.getBoolean() ? "enabled" : "disabled")));
}

@Override
public List<String> getCommandAliases() {
List<String> aliases = new ArrayList<>();
aliases.add("dba");
return aliases;
}

@Override
public int getRequiredPermissionLevel() {
return 0;
}
}
9 changes: 4 additions & 5 deletions src/main/resources/mcmod.info
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[
{
"modid": "forgetemplate",
"name": "ForgeTemplate",
"description": "Template for a Forge 1.8.9 Mod",
"modid": "disableburninganimation",
"name": "DisableBurningAnimation",
"description": "Disables the burning animation overlay. Mostly used in the Hypixel SkyBlock Floor 7 Dungeon. Toggle with '/disableburninganimation' or '/dba'.",
"version": "${version}",
"mcversion": "1.8.9",
"url": "",
"updateUrl": "",
"updateUrl": "https://kada49.github.io/json/DisableBurningAnimation-updateJson.json",
"authorList": ["kada49"],
"credits": "xcfrg for inspiration, the Essential Discord Server for the help",
"logoFile": "",
"screenshots": [],
"dependencies": []
Expand Down

0 comments on commit 8417ad5

Please sign in to comment.