Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Add "Mob Drops" NEI page + Extreme Extermination Chamber (#1)
Browse files Browse the repository at this point in the history
* First commit

* Mixins

* Merge the same items with diffrent damage

* Faster random in NEI

* More accuracy ?

* Update ClientProxy.java

* Renaming

* Update buildscript

* Use reserved MTE ID's

* EEC work

* Rework NEI page

* Fix inaccurate chances

* Basic equipment spawn

* Add config options

* Translations

* Add infernal drops

* Witchery fix

* Forestry fixes

* More fixes

* Default blacklist

* NEI sorting

* Comment out testing deps

* Clientsided check

* Blood Magic support

* LoaderReference

* Check if peacefull is allowed

* Add some XP output

* Add recipe

* Send Server config to Client

* Add command to reload config

* Translations

* Process MT additions
  • Loading branch information
kuba6000 authored Aug 14, 2022
1 parent d8d8a46 commit 6d436a2
Show file tree
Hide file tree
Showing 33 changed files with 3,537 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1659365110
//version: 1659977784
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -651,7 +651,7 @@ task updateBuildScript {
}
}

if (isNewBuildScriptVersionAvailable(projectDir.toString())) {
if (!project.getGradle().startParameter.isOffline() && isNewBuildScriptVersionAvailable(projectDir.toString())) {
if (autoUpdateBuildScript.toBoolean()) {
performBuildScriptUpdate(projectDir.toString())
} else {
Expand Down
27 changes: 27 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
// Add your dependencies here

dependencies {
compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.78:dev")
compile("com.github.GTNewHorizons:EnderCore:0.2.6:dev")
compile("com.github.GTNewHorizons:EnderIO:2.3.1.29:dev")
compile("com.github.GTNewHorizons:Infernal-Mobs:1.7.5-GTNH:dev")
compileOnly("com.github.GTNewHorizons:BloodMagic:1.3.10:dev")
{
transitive = false
}
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
{
transitive = false
}
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.9:dev")
{
transitive = false
}
runtime("com.github.GTNewHorizons:Baubles:1.0.1.14:dev")
runtime("curse.maven:cofh-core-69162:2388751")

// For testing
//runtime("com.github.GTNewHorizons:OpenBlocks:1.6.9-GTNH:dev")
//runtime("com.github.GTNewHorizons:CraftTweaker:3.2.9:dev")
//compile("com.github.GTNewHorizons:SpecialMobs:3.3.12:dev")
//compile("com.github.GTNewHorizons:twilightforest:2.3.8.15:dev")
//compile("com.github.GTNewHorizons:EnderZoo:1.0.23:dev")
//runtime("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
//runtime("com.github.GTNewHorizons:BloodMagic:1.3.10:dev")
//compile("curse.maven:witchery-69673:2234410")
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ apiPackage =
accessTransformersFile =

# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
usesMixins = true
# Adds some debug arguments like verbose output and export
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
mixinPlugin = mixin.MixinPlugin
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
mixinsPackage = mixin.mixins
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
Expand Down
23 changes: 22 additions & 1 deletion repositories.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
// Add any additional repositories for your dependencies here

repositories {

maven {
name = "GTNH Maven"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
}
maven {
name = "ic2"
url = "http://maven.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
}
}
maven {
url "https://cursemaven.com"
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
maven {
url 'https://repo.openmods.info/artifactory/openmods/'
}
}
8 changes: 8 additions & 0 deletions src/main/java/kubatech/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,23 @@
package kubatech;

import cpw.mods.fml.common.event.*;
import kubatech.api.utils.ModUtils;
import kubatech.loaders.MobRecipeLoader;
import kubatech.nei.IMCForNEI;
import net.minecraftforge.common.MinecraftForge;

@SuppressWarnings("unused")
public class ClientProxy extends CommonProxy {

public void preInit(FMLPreInitializationEvent event) {
ModUtils.isClientSided = true;
super.preInit(event);
}

public void init(FMLInitializationEvent event) {
super.init(event);
IMCForNEI.IMCSender();
MinecraftForge.EVENT_BUS.register(MobRecipeLoader.instance);
}

public void postInit(FMLPostInitializationEvent event) {
Expand Down
20 changes: 17 additions & 3 deletions src/main/java/kubatech/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@

package kubatech;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.*;
import kubatech.commands.CommandConfig;
import kubatech.commands.CommandHandler;
import kubatech.commands.CommandHelp;
import kubatech.loaders.RecipeLoader;

public class CommonProxy {

public void preInit(FMLPreInitializationEvent event) {
Config.syncronizeConfiguration(event.getSuggestedConfigurationFile());
kubatech.info("Initializing ! Version: " + Tags.VERSION);

kubatech.info("I am " + Tags.MODNAME + " at version " + Tags.VERSION);
Config.init(event.getSuggestedConfigurationFile());
Config.synchronizeConfiguration();
RecipeLoader.addRecipes();
FMLCommonHandler.instance().bus().register(new FMLEventHandler());
}

public void init(FMLInitializationEvent event) {}
Expand All @@ -35,7 +43,13 @@ public void postInit(FMLPostInitializationEvent event) {}

public void serverAboutToStart(FMLServerAboutToStartEvent event) {}

public void serverStarting(FMLServerStartingEvent event) {}
public void serverStarting(FMLServerStartingEvent event) {
RecipeLoader.addRecipesLate();
CommandHandler cmd = new CommandHandler();
cmd.addCommand(new CommandHelp());
cmd.addCommand(new CommandConfig());
event.registerServerCommand(cmd);
}

public void serverStarted(FMLServerStartedEvent event) {}

Expand Down
54 changes: 53 additions & 1 deletion src/main/java/kubatech/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,62 @@

public class Config {

public static void syncronizeConfiguration(File configFile) {
private static class Categories {
public static final String mobHandler = "MobHandler";
}

public static boolean mobHandlerEnabled = true;
public static boolean includeEmptyMobs = true;
public static String[] mobBlacklist;
public static File configFile;

public static void init(File configFile) {
Config.configFile = configFile;
}

public static void synchronizeConfiguration() {
Configuration configuration = new Configuration(configFile);
configuration.load();

mobHandlerEnabled = configuration
.get(
Categories.mobHandler,
"Enabled",
true,
"Enable \"Mob Drops\" NEI page and Extreme Extermination Chamber")
.getBoolean();
includeEmptyMobs = configuration
.get(Categories.mobHandler, "IncludeEmptyMobs", true, "Include mobs that have no drops in NEI")
.getBoolean();
mobBlacklist = configuration
.get(
Categories.mobHandler,
"MobBlacklist",
new String[] {
"Giant",
"Thaumcraft.TravelingTrunk",
"chisel.snowman",
"OpenBlocks.Luggage",
"OpenBlocks.MiniMe",
"SpecialMobs.SpecialCreeper",
"SpecialMobs.SpecialZombie",
"SpecialMobs.SpecialPigZombie",
"SpecialMobs.SpecialSlime",
"SpecialMobs.SpecialSkeleton",
"SpecialMobs.SpecialEnderman",
"SpecialMobs.SpecialCaveSpider",
"SpecialMobs.SpecialGhast",
"SpecialMobs.SpecialWitch",
"SpecialMobs.SpecialSpider",
"TwilightForest.HydraHead",
"TwilightForest.RovingCube",
"TwilightForest.Harbinger Cube",
"TwilightForest.Adherent",
"SpecialMobs.SpecialSilverfish",
},
"These mobs will be skipped when generating recipe map")
.getStringList();

if (configuration.hasChanged()) {
configuration.save();
}
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/kubatech/FMLEventHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package kubatech;

import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
import kubatech.network.LoadConfigPacket;
import net.minecraft.entity.player.EntityPlayerMP;

public class FMLEventHandler {
// Gets fired only server-sided
@SubscribeEvent
public void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {
if (!(event.player instanceof EntityPlayerMP)) return;
kubatech.info("Sending config to " + event.player.getDisplayName());
kubatech.NETWORK.sendTo(LoadConfigPacket.instance, (EntityPlayerMP) event.player);
}
}
12 changes: 12 additions & 0 deletions src/main/java/kubatech/api/LoaderReference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package kubatech.api;

import cpw.mods.fml.common.Loader;

public class LoaderReference {
public static final boolean BloodMagic = Loader.isModLoaded("AWWayofTime");
public static final boolean EnderIO = Loader.isModLoaded("EnderIO");
public static final boolean ExtraUtilities = Loader.isModLoaded("ExtraUtilities");
public static final boolean InfernalMobs = Loader.isModLoaded("InfernalMobs");
public static final boolean Thaumcraft = Loader.isModLoaded("Thaumcraft");
public static final boolean MineTweaker = Loader.isModLoaded("MineTweaker3");
}
26 changes: 26 additions & 0 deletions src/main/java/kubatech/api/Variables.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* KubaTech - Gregtech Addon
* Copyright (C) 2022 kuba6000
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/

package kubatech.api;

import net.minecraft.util.EnumChatFormatting;

public class Variables {
public static final String Author = "Author: " + EnumChatFormatting.GOLD + "kuba6000";
}
Loading

0 comments on commit 6d436a2

Please sign in to comment.