Compare commits

...
6 Commits
Author SHA1 Message Date
Dream Master d4191557af update 2024-10-13 21:04:51 +02:00
Raven Szewczyk 6670fcdb5f Share both research and discovered aspects list with the knowledge sharing tome (#41)
* Update buildscript, switch to RFG tag generation

* Share both research and discovered aspects list with the knowledge sharing book
2024-07-17 16:38:52 +00:00
Martin Robertz 2058c309d4 update 2024-05-22 22:45:09 +02:00
Under 2633f752f3 Add configs for annoying Kami features (#40)
1. Kami/Ichor Leggings have had the "produce light" ability config'ed and disabled by default.
2. Kami/Ichor boots have had the "dirt into grass" ability config'ed but left enabled by default.

Just let me know if the general consensus would be that the dirt into grass should also be disabled by default and I'll swap that to default to false as well.
2024-05-21 15:01:33 -04:00
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
13 changed files with 128 additions and 66 deletions

No files matched your search

+9 -9
View File
@@ -2,19 +2,19 @@
dependencies {
api('com.github.GTNewHorizons:Baubles:1.0.4:dev')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-348-GTNH:api')
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-468-GTNH:api')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Botania:1.10.12-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:Botania:1.11.5-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderCore:0.4.6:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.7.1:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.5.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.7.2:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.11.14-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.9-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderIO:2.8.18:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:EnderStorage:1.6.4:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:waila:1.8.1:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.12.11-GTNH:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.5.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:CodeChickenLib:1.3.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:OpenComputers:1.10.26-GTNH:api') {transitive=false}
compileOnly('curse.maven:computercraft-67504:2269339')
compileOnly('curse.maven:cofh-lib-220333:2388748')
+15 -4
View File
@@ -50,10 +50,10 @@ 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 =
generateGradleTokenClass = thaumic.tinkerer.Tags
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenVersion = VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
@@ -70,7 +70,7 @@ gradleTokenGroupName =
# 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
replaceGradleTokenInFile =
# 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.
@@ -85,6 +85,11 @@ accessTransformersFile = ThaumicTinkerer_at.cfg
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = true
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
# Mixin classes will have access to "main" classes, but not the other way around.
separateMixinSourceSet =
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = true
@@ -117,9 +122,15 @@ 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.
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
# list of strings, with the acceptable keys being(case does not matter):
# cursemaven
# modrinth
excludeWellKnownRepositories =
# 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.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+5 -2
View File
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# 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
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Vendored
+2
View File
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.21'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.27'
}
@@ -47,6 +47,8 @@ public final class ConfigHandler {
public static int netherDimensionID;
public static int endDimensionID;
public static int bedrockDimensionID = 19;
public static boolean shouldKamiLegsDoLightFeature = false;
public static boolean shouldKamiBootsDoGrass = true;
public static int soulHeartHeight;
@@ -228,6 +230,16 @@ public final class ConfigHandler {
-1023,
1023,
"The Dimension ID for the End, leave at 1 if you don't modify it with another mod/plugin.");
shouldKamiLegsDoLightFeature = config.getBoolean(
"Kami Leggings Light Placing Feature Enabled",
"general.kami",
shouldKamiLegsDoLightFeature,
"Sets if Legs of the Burning Mantle (Awakened Kami leggings) will do the effect where it places lights near you.");
shouldKamiBootsDoGrass = config.getBoolean(
"Kami Boots Dirt into Grass Feature Enabled",
"general.kami",
shouldKamiBootsDoGrass,
"Sets if Boots of the Horizontal Shield (Awakened Kami Boots) will do the effect where dirt under you turns into grass.");
}
LibEnchantIDs.idAscentBoost = loadEnchant(LibEnchantNames.ASCENT_BOOST, LibEnchantIDs.idAscentBoost);
@@ -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));
@@ -1,6 +1,5 @@
package thaumic.tinkerer.common.item;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,9 +16,12 @@ import net.minecraftforge.common.util.Constants;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchPage;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigItems;
import thaumcraft.common.lib.research.PlayerKnowledge;
import thaumcraft.common.lib.research.ResearchManager;
import thaumic.tinkerer.common.ThaumicTinkerer;
import thaumic.tinkerer.common.core.handler.ConfigHandler;
@@ -36,7 +38,9 @@ import thaumic.tinkerer.common.research.TTResearchItem;
public class ItemShareBook extends ItemBase {
private static final String TAG_PLAYER = "player";
private static final String NON_ASIGNED = "[none]";
private static final String TAG_RESEARCH = "research";
private static final String TAG_ASPECTS = "aspects";
private static final String NON_ASSIGNED = "[none]";
public ItemShareBook() {
super();
@@ -83,44 +87,57 @@ public class ItemShareBook extends ItemBase {
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
String name = getPlayerName(par1ItemStack);
if (name.endsWith(NON_ASIGNED)) {
setPlayerName(par1ItemStack, par3EntityPlayer.getGameProfile().getName());
setPlayerResearch(par1ItemStack, par3EntityPlayer.getGameProfile().getName());
if (!par2World.isRemote)
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.write"));
} else sync: {
List<String> researchesDone = ResearchManager.getResearchForPlayer(name);
if (researchesDone == null) {
if (par2World.isRemote) researchesDone = getPlayerResearch(par1ItemStack);
else {
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
break sync;
}
public ItemStack onItemRightClick(ItemStack bookStack, World world, EntityPlayer player) {
String name = getPlayerName(bookStack);
if (name.endsWith(NON_ASSIGNED)) {
setPlayerName(bookStack, player.getGameProfile().getName());
savePlayerResearch(ItemNBTHelper.getNBT(bookStack), player.getGameProfile().getName());
if (!world.isRemote) {
player.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.write"));
}
} else {
// Try to load latest research for the saved player, fall back to the stored NBT if it fails.
final NBTTagCompound researchSource;
if (ResearchManager.getResearchForPlayer(name) != null) {
researchSource = new NBTTagCompound();
savePlayerResearch(researchSource, name);
} else {
researchSource = ItemNBTHelper.getNBT(bookStack);
}
for (String key : researchesDone)
ThaumicTinkerer.tcProxy.getResearchManager().completeResearch(par3EntityPlayer, key);
loadPlayerResearch(researchSource, player);
if (!par2World.isRemote)
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
if (!world.isRemote) {
player.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
}
}
return par1ItemStack;
return bookStack;
}
private List<String> getPlayerResearch(ItemStack par1ItemStack) {
List<String> retVals = new ArrayList<>();
NBTTagCompound cmp = ItemNBTHelper.getNBT(par1ItemStack);
if (!cmp.hasKey("research")) return retVals;
NBTTagList list = cmp.getTagList("research", Constants.NBT.TAG_STRING);
for (int i = 0; i < list.tagCount(); i++) {
retVals.add(list.getStringTagAt(i));
private void loadPlayerResearch(NBTTagCompound cmp, EntityPlayer player) {
// Ensure full TC player data gets loaded
final String playerName = player.getGameProfile().getName();
ResearchManager.getResearchForPlayer(playerName);
if (cmp.hasKey(TAG_RESEARCH)) {
final NBTTagList list = cmp.getTagList(TAG_RESEARCH, Constants.NBT.TAG_STRING);
for (int i = 0; i < list.tagCount(); i++) {
final String research = list.getStringTagAt(i);
ThaumicTinkerer.tcProxy.getResearchManager().completeResearch(player, research);
}
}
if (cmp.hasKey(TAG_ASPECTS)) {
final PlayerKnowledge pk = ThaumicTinkerer.tcProxy.getPlayerKnowledge();
final NBTTagList list = cmp.getTagList(TAG_ASPECTS, Constants.NBT.TAG_STRING);
for (int i = 0; i < list.tagCount(); i++) {
final String aspectTag = list.getStringTagAt(i);
final Aspect aspect = Aspect.getAspect(aspectTag);
if (aspect != null) {
pk.addDiscoveredAspect(playerName, aspect);
}
}
ResearchManager.scheduleSave(player);
}
return retVals;
}
@Override
@@ -134,7 +151,7 @@ public class ItemShareBook extends ItemBase {
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
String name = getPlayerName(par1ItemStack);
par3List.add(
name.equals(NON_ASIGNED) ? StatCollector.translateToLocal("ttmisc.shareTome.noAssign")
name.equals(NON_ASSIGNED) ? StatCollector.translateToLocal("ttmisc.shareTome.noAssign")
: String.format(StatCollector.translateToLocal("ttmisc.shareTome.playerName"), name));
}
@@ -144,21 +161,32 @@ public class ItemShareBook extends ItemBase {
}
private String getPlayerName(ItemStack stack) {
return ItemNBTHelper.getString(stack, TAG_PLAYER, NON_ASIGNED);
return ItemNBTHelper.getString(stack, TAG_PLAYER, NON_ASSIGNED);
}
private void setPlayerName(ItemStack stack, String playerName) {
ItemNBTHelper.setString(stack, TAG_PLAYER, playerName);
}
private void setPlayerResearch(ItemStack stack, String playername) {
List<String> researchesDone = ResearchManager.getResearchForPlayer(playername);
NBTTagCompound cmp = ItemNBTHelper.getNBT(stack);
NBTTagList list = new NBTTagList();
for (String tag : researchesDone) {
list.appendTag(new NBTTagString(tag));
private void savePlayerResearch(NBTTagCompound target, String playername) {
// also loads the aspect list
final List<String> researchesDone = ResearchManager.getResearchForPlayer(playername);
// Save all unlocked research notes.
final NBTTagList researchList = new NBTTagList();
for (final String tag : researchesDone) {
researchList.appendTag(new NBTTagString(tag));
}
cmp.setTag("research", list);
target.setTag(TAG_RESEARCH, researchList);
// Save all discovered aspect types.
final PlayerKnowledge pk = Thaumcraft.proxy.getPlayerKnowledge();
final NBTTagList aspectsToSave = new NBTTagList();
final AspectList aspectsDiscovered = pk.getAspectsDiscovered(playername);
if (aspectsDiscovered == null) {
return;
}
aspectsDiscovered.aspects.keySet().stream().map(Aspect::getTag).sorted().map(NBTTagString::new)
.forEach(aspectsToSave::appendTag);
target.setTag(TAG_ASPECTS, aspectsToSave);
}
@Override
@@ -67,11 +67,13 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv {
player.jumpMovementFactor = player.isSprinting() ? 0.05F : 0.04F;
player.fallDistance = 0F;
int x = (int) player.posX;
int y = (int) player.posY - 1;
int z = (int) player.posZ;
if (player.worldObj.getBlock(x, y, z) == Blocks.dirt && player.worldObj.getBlockMetadata(x, y, z) == 0)
player.worldObj.setBlock(x, y, z, Blocks.grass, 0, 2);
if (ConfigHandler.shouldKamiBootsDoGrass) {
int x = (int) player.posX;
int y = (int) player.posY - 1;
int z = (int) player.posZ;
if (player.worldObj.getBlock(x, y, z) == Blocks.dirt && player.worldObj.getBlockMetadata(x, y, z) == 0)
player.worldObj.setBlock(x, y, z, Blocks.grass, 0, 2);
}
}
@Override
@@ -85,7 +85,9 @@ public class ItemGemLegs extends ItemIchorclothArmorAdv {
if (player.isBurning()) player.heal(0.5F);
addPotionEffect(player, Potion.fireResistance, 119, -1);
setNearBrightNitor(player);
if (ConfigHandler.shouldKamiLegsDoLightFeature) {
setNearBrightNitor(player);
}
}
}
@@ -11,11 +11,13 @@
*/
package thaumic.tinkerer.common.lib;
import thaumic.tinkerer.Tags;
public final class LibMisc {
public static final String MOD_ID = "ThaumicTinkerer";
public static final String MOD_NAME = "Thaumic Tinkerer";
public static final String VERSION = "GRADLETOKEN_VERSION";
public static final String VERSION = Tags.VERSION;
public static final String NETWORK_CHANNEL = MOD_ID;