Compare commits

..
11 Commits
Author SHA1 Message Date
Martin Robertz 8ce7293034 update 2024-04-19 20:05:19 +02:00
chochem 0432ff0d30 be more specific (#39) 2024-04-19 00:51:01 +01:00
Abdiel Kavash 180509a1a9 Fix crashes related to high level enchantments. (#38)
* Fix crashes with high level enchantments.

* bs+d
2024-04-13 00:55:55 +02:00
Raven Szewczyk 1f27b14054 [ci skip] upgraded build system 2024-02-04 20:02:27 +00:00
Martin Robertz 22e8c36aae update deps+bs 2024-01-31 22:50:58 +01:00
Jurre Groenendijk 0212dd084a Fix typo in thaumic restorer page (#37) 2024-01-31 22:50:08 +01:00
Martin Robertz d54311fb11 update bs+deps 2024-01-12 20:58:37 +01:00
Raven Szewczyk 4a20fa3b06 [ci skip] upgraded build system 2024-01-08 21:29:54 +00:00
Martin Robertz 97e8cdf407 update gradle + deps + bs 2023-12-26 22:01:21 +01:00
Abdiel Kavash 0c75584ccb Talisman of Remedium no longer wastes durability trying to remove permanent debuffs. It also accepts the Unbreaking enchant. (#36)
* Talisman of Remedium accepts Unbreaking enchant.

* Talisman of Remedium no longer removes debuffs with duration < 1 second.

* Talisman of Remedium does not waste durability trying to remove "permanent" debuffs.

* Use a map on player's UUID instead of single variables.
2023-12-26 11:09:31 +01:00
Angus Grewal 47ffee8cd3 Added balancing configs for Shadowbeam Focus. (#35) 2023-11-25 15:48:33 +01:00
15 changed files with 343 additions and 1718 deletions

No files matched your search

+2 -1621
View File
File diff suppressed because it is too large. Load diff
+11 -11
View File
@@ -1,20 +1,20 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:Baubles:1.0.1.16:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-261-GTNH:api')
api('com.github.GTNewHorizons:Baubles:1.0.4:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-349-GTNH:api')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Botania:1.10.0-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.18:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.5.2:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.4.12:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.6.0:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.10.5-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.3.4:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.17-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:Botania:1.10.12-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.7.3:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.5.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.7.3:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.11.15-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.4.8:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.2.1:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.11-GTNH:api') {transitive=false}
compileOnly('curse.maven:computercraft-67504:2269339')
compileOnly('curse.maven:cofh-lib-220333:2388748')
+151 -25
View File
@@ -1,66 +1,192 @@
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
# LOCAL to test local config updates.
gtnh.settings.blowdryerTag = 0.2.0
# Human-readable mod name, available for mcmod.info population.
modName = Thaumic Tinkerer
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
modId = ThaumicTinkerer
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = thaumic.tinkerer
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
useModGroupForPublishing = false
# Will update your build.gradle automatically whenever an update is available
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Define a source file of your project with:
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
replaceGradleTokenInFile = LibMisc.java
gradleTokenModId =
gradleTokenModName =
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = false
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass =
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = GRADLETOKEN_VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile = LibMisc.java
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
apiPackage = api
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile = ThaumicTinkerer_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = true
# Adds some debug arguments like verbose output and export
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = true
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage = 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
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass = preloader.ThaumicTLoaderContainer
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
usesShadowedDependencies = false
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# Maven repository to publish the mod to.
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
#
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish to Modrinth.
modrinthProjectId =
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
# Syntax: scope1-type1:name1;scope2-type2:name2;...
# Where scope can be one of [required, optional, incompatible, embedded],
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
# Syntax: type1:name1;type2:name2;...
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
#customArchiveBaseName =
# customArchiveBaseName =
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
# versionPattern =
# Uncomment to prevent the source code from being published.
# noPublishedSources = true
# Uncomment this to disable Spotless checks.
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
# disableSpotless = true
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
# disableCheckstyle = true
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
# Whether IDEA should run spotless checks when pressing the Build button.
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
Binary file not shown.
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+13 -9
View File
@@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Vendored
+10 -10
View File
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
+5 -10
View File
@@ -4,10 +4,10 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons.retrofuturagradle")
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
@@ -17,12 +17,7 @@ pluginManagement {
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21'
}
blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
}
@@ -50,6 +50,11 @@ public final class ConfigHandler {
public static int soulHeartHeight;
public static int visShadowbeamOrder;
public static int visShadowbeamAir;
public static int visShadowbeamEntropy;
public static int baseDamageShadowbeam;
private static Configuration config;
public static void loadConfig(File configFile) {
@@ -59,6 +64,8 @@ public final class ConfigHandler {
new ConfigCategory("enchantments");
new ConfigCategory("general.kami");
new ConfigCategory("balance.shadowbeam");
config.addCustomCategoryComment("general.kami", "These will only be used if KAMI is enabled.");
config.load();
@@ -143,6 +150,39 @@ public final class ConfigHandler {
.getInt("Water Potion id", "potions", 89, 30, 1023, "Set to the potion id for water potion");
potionAirId = config.getInt("Air Potion id", "potions", 86, 30, 1023, "Set to the potion id for air potion");
// Shadowbeam Balance
visShadowbeamAir = config.getInt(
"aer vis cost",
"balance.shadowbeam",
15,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"vis cost for the aer aspect, 1/100th in-game");
visShadowbeamOrder = config.getInt(
"ordo vis cost",
"balance.shadowbeam",
25,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"vis cost for the ordo aspect, 1/100th in-game");
visShadowbeamEntropy = config.getInt(
"perditio vis cost",
"balance.shadowbeam",
25,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"vis cost for the perditio aspect, 1/100th in-game");
baseDamageShadowbeam = config.getInt(
"shadowbeam base damage",
"balance.shadowbeam",
8,
Integer.MIN_VALUE,
Integer.MAX_VALUE,
"base damage of the shadowbeam focus");
if (enableKami) {
bedrockDimensionID = config.getInt(
@@ -208,7 +208,7 @@ public class AspectCropLootManager {
addAspectLoot(Aspect.ENERGY, new ItemStack(ConfigItems.itemResource, 12));
addAspectLoot(Aspect.MAGIC, "shard");
addAspectLoot(Aspect.MAGIC, "materialAspectShard");
addAspectLoot(Aspect.HEAL, new ItemStack(Items.golden_apple));
@@ -71,7 +71,7 @@ public class ModEnchantmentHandler {
int finalStrike = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.finalStrike, heldItem);
if (finalStrike > 0) {
Random rand = new Random();
if (rand.nextInt(20 - finalStrike) == 0) {
if ((finalStrike >= 19 || rand.nextInt(20 - finalStrike) == 0)) {
event.ammount *= 3;
}
}
@@ -154,10 +154,14 @@ public class ModEnchantmentHandler {
int quickDraw = EnchantmentHelper.getEnchantmentLevel(LibEnchantIDs.idQuickDraw, heldItem);
ItemStack usingItem = player.itemInUse;
int time = player.itemInUseCount;
if (quickDraw > 0 && usingItem != null && usingItem.getItem() instanceof ItemBow)
if ((usingItem.getItem().getMaxItemUseDuration(usingItem) - time) % (6 - quickDraw) == 0)
player.itemInUseCount = time - 1;
if (quickDraw > 0 && usingItem != null && usingItem.getItem() instanceof ItemBow) {
int speedup = quickDraw / 6;
quickDraw = quickDraw % 6;
if (player.itemInUseCount % (6 - quickDraw) == 0) {
speedup++;
}
player.itemInUseCount = Math.max(2, player.itemInUseCount - speedup);
}
}
}
@@ -12,7 +12,10 @@
package thaumic.tinkerer.common.item;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.UUID;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
@@ -26,8 +29,6 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import org.apache.commons.lang3.ArrayUtils;
import baubles.api.BaubleType;
import baubles.api.BaublesApi;
import baubles.api.IBauble;
@@ -60,6 +61,11 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
private IIcon enabledIcon;
private static final int EFFECT_BURNING = -1;
// 0 = no effect, otherwise either EFFECT_BURNING or the ID of the effect removed.
private HashMap<UUID, Integer> mLastEffectRemoved = new HashMap<>();
private final HashMap<UUID, Collection<Integer>> mPermanentEffects = new HashMap<>();
public ItemCleansingTalisman() {
setMaxStackSize(1);
setMaxDamage(LibFeatures.CLEANSING_TALISMAN_USES);
@@ -142,6 +148,12 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
return EnumRarity.uncommon;
}
@Override
public int getItemEnchantability() {
// Equivalent to iron.
return 10;
}
@Override
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.AMULET;
@@ -153,15 +165,48 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
if (isEnabled(par1ItemStack) && !par2World.isRemote) {
if (player.ticksExisted % 20 == 0) {
if (player instanceof EntityPlayer) {
boolean removed = false;
int damage = 1;
Collection<PotionEffect> potions = player.getActivePotionEffects();
int lastEffectRemoved;
Collection<Integer> permanentEffects;
UUID uuid = player.getUniqueID();
if (mPermanentEffects.containsKey(uuid)) {
lastEffectRemoved = mLastEffectRemoved.get(uuid);
permanentEffects = mPermanentEffects.get(uuid);
} else {
lastEffectRemoved = 0;
permanentEffects = new HashSet<>();
mLastEffectRemoved.put(uuid, lastEffectRemoved);
mPermanentEffects.put(uuid, permanentEffects);
}
// All effects we try to remove in this operation, including permanent effects.
Collection<Integer> effectsToRemove = new HashSet<>();
// One new effect we remove this operation, with a durability cost.
int effectRemoved = 0;
if (player.isBurning()) {
player.extinguish();
removed = true;
} else for (PotionEffect potion : potions) {
if (permanentEffects.contains(EFFECT_BURNING)) {
// Remove permanent effects at no cost.
effectsToRemove.add(EFFECT_BURNING);
} else if (lastEffectRemoved == EFFECT_BURNING) {
// We removed burning last time, player is on fire permanently.
permanentEffects.add(EFFECT_BURNING);
effectsToRemove.add(EFFECT_BURNING);
} else if (effectRemoved == 0) {
// Actually remove burning.
effectsToRemove.add(EFFECT_BURNING);
effectRemoved = EFFECT_BURNING;
}
}
Collection<PotionEffect> potions = player.getActivePotionEffects();
for (PotionEffect potion : potions) {
// Skip effects without a duration; e.g., dolly, TiC cleaver, etc.
if (potion.duration < 20) {
continue;
}
int id = potion.getPotionID();
boolean badEffect;
badEffect = ReflectionHelper.getPrivateValue(
@@ -171,28 +216,57 @@ public class ItemCleansingTalisman extends ItemBase implements IBauble {
if (Potion.potionTypes[id] instanceof PotionWarpWard) {
badEffect = false;
}
if (badEffect) {
player.removePotionEffect(id);
removed = true;
int[] warpPotionIDs = new int[] { Config.potionBlurredID, Config.potionDeathGazeID,
Config.potionInfVisExhaustID, Config.potionSunScornedID, Config.potionUnHungerID };
if (ArrayUtils.contains(warpPotionIDs, potion.getPotionID())) {
damage = 10;
if (permanentEffects.contains(id)) {
// Remove permanent effects at no cost.
effectsToRemove.add(id);
} else if (lastEffectRemoved == id) {
// We removed this effect last time, player is affected by this permanently.
effectsToRemove.add(id);
permanentEffects.add(id);
} else if (effectRemoved == 0) {
// Actually remove the effect.
effectsToRemove.add(id);
effectRemoved = id;
}
break;
}
}
if (removed) {
for (int effectID : effectsToRemove) {
if (effectID == EFFECT_BURNING) {
player.extinguish();
} else {
player.removePotionEffect(effectID);
}
}
// True if some permanent effects are no longer affecting the player.
boolean permanentRemoved = permanentEffects.retainAll(effectsToRemove);
if (effectRemoved != 0) {
int damage = 1;
if (effectRemoved == Config.potionBlurredID || effectRemoved == Config.potionDeathGazeID
|| effectRemoved == Config.potionInfVisExhaustID
|| effectRemoved == Config.potionSunScornedID
|| effectRemoved == Config.potionUnHungerID) {
damage = 10;
}
par1ItemStack.damageItem(damage, player);
if (par1ItemStack.getItemDamage() <= 0) {
BaublesApi.getBaubles((EntityPlayer) player).setInventorySlotContents(0, null); // Slot 0 =
// Talisman
// Slot
if (par1ItemStack.stackSize <= 0) {
// Slot 0 = talisman slot.
BaublesApi.getBaubles((EntityPlayer) player).setInventorySlotContents(0, null);
}
}
if (effectRemoved != 0 || permanentRemoved) {
par2World.playSoundAtEntity(player, "thaumcraft:wand", 0.3F, 0.1F);
}
lastEffectRemoved = effectRemoved;
mLastEffectRemoved.put(uuid, lastEffectRemoved);
}
}
}
@@ -37,10 +37,10 @@ import thaumic.tinkerer.common.research.ResearchHelper;
public class ItemFocusShadowbeam extends ItemModKamiFocus {
private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, 500).add(Aspect.ENTROPY, 500)
.add(Aspect.AIR, 300);
private static final AspectList visUsage = new AspectList().add(Aspect.ORDER, ConfigHandler.visShadowbeamOrder)
.add(Aspect.ENTROPY, ConfigHandler.visShadowbeamEntropy).add(Aspect.AIR, ConfigHandler.visShadowbeamAir);
private static final int DAMAGE = 100;
private static final int DAMAGE = ConfigHandler.baseDamageShadowbeam;
public ItemFocusShadowbeam() {
super();
@@ -440,7 +440,7 @@ ttresearch.page.REVEALING_HELM.0=As it turns out, goggles don't offer much prote
# -- THAUMIC REHABILITATOR
ttresearch.name.REPAIRER=Thaumic Restorer
ttresearch.lore.REPAIRER=Undoing the damage you've done
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair, items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
# -- WAND FOCUS: DISTORTION
ttresearch.name.FOCUS_DEFLECT=Wand Focus: Distortion
@@ -441,7 +441,7 @@ ttresearch.page.REVEALING_HELM.0=As it turns out, goggles don't offer much prote
# -- THAUMIC REHABILITATOR
ttresearch.name.REPAIRER=Réparateur thaumique
ttresearch.lore.REPAIRER=L'outil du parfait Patrick
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair, items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
ttresearch.page.REPAIRER.0=You created a new contraption to restore broken tools. By right clicking this block with a broken tool and hooking it to essentia tubes, it'll gather essentia to repair the tool.<BR><BR>The essentia that will repair items is Instrumentum.<BR><BR>Looking at the block with goggles of revealing also shows how worn down the item in it still is. Redstone current will be emitted while an item is being repaired.
# -- WAND FOCUS: DISTORTION
ttresearch.name.FOCUS_DEFLECT=Foci de baguette: Distortion