mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-10-26 14:24:22 +00:00
Compare commits
36
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5c4e9217b | ||
|
|
6610499e7c | ||
|
|
ebcca54ad4 | ||
|
|
89237f644a | ||
|
|
052041f846 | ||
|
|
8f1d0abbeb | ||
|
|
d179ee57e9 | ||
|
|
1e2c85f898 | ||
|
|
f1900cd9b3 | ||
|
|
398af04ea5 | ||
|
|
d5beca8e52 | ||
|
|
db3e5b6388 | ||
|
|
177cb6af04 | ||
|
|
0c89751e53 | ||
|
|
98cb2bb68c | ||
|
|
7d615a0ceb | ||
|
|
d2be71b4e3 | ||
|
|
d03a0c697c | ||
|
|
e8da80454b | ||
|
|
272075dd51 | ||
|
|
56bd18670f | ||
|
|
29f0c6af40 | ||
|
|
5ed33dfa4f | ||
|
|
7a74dabcea | ||
|
|
68518a7858 | ||
|
|
f83cd1ab0b | ||
|
|
5595d0377c | ||
|
|
6c4d37a345 | ||
|
|
77e14f3c8a | ||
|
|
71e00772b7 | ||
|
|
cf60696c68 | ||
|
|
d24f3facfe | ||
|
|
5cdf19daac | ||
|
|
93e6a1f7ba | ||
|
|
1039b52854 | ||
|
|
33a26a5059 |
No files matched your search
+2
-1474
File diff suppressed because it is too large.
Load diff
+7
-7
@@ -1,16 +1,16 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
compile('com.github.GTNewHorizons:Baubles:1.0.1.14:dev')
|
||||
compile('com.github.GTNewHorizons:Baubles:1.0.4:dev')
|
||||
|
||||
compile('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.14.0:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.13-GTNH:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.27:api') {transitive=false}
|
||||
compile('com.github.GTNewHorizons:GTNHLib:0.0.13:dev')
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.8:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.13.5-GTNH:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.4.8:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api') {transitive=false}
|
||||
compile('com.github.GTNewHorizons:GTNHLib:0.2.11:dev')
|
||||
|
||||
compileOnly('curse.maven:cofh-lib-220333:2388748')
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
|
||||
|
||||
+146
-26
@@ -1,72 +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 = Botania
|
||||
|
||||
# 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 = Botania
|
||||
|
||||
# Root package of the mod, used to find various classes in other properties,
|
||||
# mcmod.info substitution, enabling assertions in run tasks, etc.
|
||||
modGroup = vazkii.botania
|
||||
|
||||
# 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:
|
||||
# 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
|
||||
# version in @Mod([...], version = VERSION, [...]).
|
||||
# Leave these properties empty to skip individual token replacements.
|
||||
replaceGradleTokenInFile = LibMisc.java
|
||||
gradleTokenModId =
|
||||
gradleTokenModName =
|
||||
gradleTokenVersion = GRADLETOKEN_VERSION
|
||||
gradleTokenGroupName =
|
||||
|
||||
# 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 = botania_at.cfg
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
# 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 =
|
||||
|
||||
# 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 =
|
||||
|
||||
# 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 prevent the source code from being published
|
||||
# noPublishedSources =
|
||||
# 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 this to disable spotless checks
|
||||
# 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
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.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
|
||||
@@ -83,10 +83,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# 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"'
|
||||
# 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
|
||||
@@ -133,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.
|
||||
@@ -144,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
|
||||
@@ -152,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
|
||||
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# 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.
|
||||
|
||||
# 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, 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
@@ -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
@@ -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.22'
|
||||
}
|
||||
|
||||
blowdryerSetup {
|
||||
repoSubfolder 'gtnhShared'
|
||||
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
|
||||
//devLocal '.' // Use this when testing config updates locally
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package vazkii.botania.api.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* An item that implements this will allow some custom render. This will be called while the item is in the inventory,
|
||||
* armor slot or bauble slots.
|
||||
*/
|
||||
public interface IInWorldRenderable
|
||||
{
|
||||
public void renderInWorld(EntityPlayer player, ItemStack stack);
|
||||
}
|
||||
@@ -43,11 +43,7 @@ public class RecipeElvenTrade {
|
||||
List<ItemStack> validStacks = OreDictionary.getOres((String) input);
|
||||
boolean found = false;
|
||||
for(ItemStack ostack : validStacks) {
|
||||
ItemStack cstack = ostack.copy();
|
||||
if(cstack.getItemDamage() == Short.MAX_VALUE)
|
||||
cstack.setItemDamage(stack.getItemDamage());
|
||||
|
||||
if(stack.isItemEqual(cstack)) {
|
||||
if(OreDictionary.itemMatches(ostack, stack, false)) {
|
||||
if(!stacksToRemove.contains(stack))
|
||||
stacksToRemove.add(stack);
|
||||
oredictIndex = j;
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.api.recipe;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
@@ -22,8 +18,6 @@ import vazkii.botania.api.subtile.SubTileEntity;
|
||||
|
||||
public class RecipePureDaisy {
|
||||
|
||||
private static final Map<String, List<ItemStack>> oreMap = new HashMap();
|
||||
|
||||
Object input;
|
||||
Block output;
|
||||
int outputMeta;
|
||||
@@ -53,21 +47,10 @@ public class RecipePureDaisy {
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return false;
|
||||
|
||||
List<ItemStack> ores;
|
||||
if(oreMap.containsKey(entry))
|
||||
ores = oreMap.get(entry);
|
||||
else {
|
||||
ores = OreDictionary.getOres(entry);
|
||||
oreMap.put(entry, ores);
|
||||
}
|
||||
|
||||
for(ItemStack ostack : ores) {
|
||||
ItemStack cstack = ostack.copy();
|
||||
if(cstack.getItemDamage() == Short.MAX_VALUE)
|
||||
cstack.setItemDamage(stack.getItemDamage());
|
||||
|
||||
if(stack.isItemEqual(cstack))
|
||||
for(ItemStack ostack : OreDictionary.getOres(entry, false)) {
|
||||
if(OreDictionary.itemMatches(ostack, stack, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider;
|
||||
import vazkii.botania.api.item.IInWorldRenderable;
|
||||
import vazkii.botania.api.item.IWireframeCoordinateListProvider;
|
||||
import vazkii.botania.api.wand.ICoordBoundItem;
|
||||
import vazkii.botania.api.wand.IWireframeAABBProvider;
|
||||
@@ -36,6 +37,10 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public final class BoundTileRenderer {
|
||||
|
||||
public static int getWireframeColor(){
|
||||
return Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldRenderLast(RenderWorldLastEvent event) {
|
||||
GL11.glPushMatrix();
|
||||
@@ -49,7 +54,7 @@ public final class BoundTileRenderer {
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
int color = Color.HSBtoRGB(ClientTickHandler.ticksInGame % 200 / 200F, 0.6F, 1F);
|
||||
int color = getWireframeColor();
|
||||
if(stack != null && stack.getItem() instanceof ICoordBoundItem) {
|
||||
ChunkCoordinates coords = ((ICoordBoundItem) stack.getItem()).getBinding(stack);
|
||||
if(coords != null)
|
||||
@@ -82,6 +87,11 @@ public final class BoundTileRenderer {
|
||||
renderBlockOutlineAt(coords, color, 5F);
|
||||
}
|
||||
}
|
||||
if(stackInSlot != null && stackInSlot.getItem() instanceof IInWorldRenderable) {
|
||||
IInWorldRenderable provider = (IInWorldRenderable) stackInSlot.getItem();
|
||||
provider.renderInWorld(player,stackInSlot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
@@ -2,6 +2,8 @@ package vazkii.botania.client.core.handler;
|
||||
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import vazkii.botania.common.network.PacketHandler;
|
||||
import vazkii.botania.common.network.PacketLokiClear;
|
||||
import vazkii.botania.common.network.PacketLokiMirror;
|
||||
import vazkii.botania.common.network.PacketLokiToggle;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -13,10 +15,15 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class KeyHandler {
|
||||
private static final KeyBinding keyToggleRingOfLoki= new KeyBinding("botaniamisc.toggleLoki", 0, "botaniamisc.keyCategory");
|
||||
private static final KeyBinding keyRingOfLokiClear= new KeyBinding("botaniamisc.ringOfLokiClear", 0, "botaniamisc.keyCategory");
|
||||
private static final KeyBinding keyRingOfLokiMirror= new KeyBinding("botaniamisc.ringOfLokiMirror", 0, "botaniamisc.keyCategory");
|
||||
|
||||
public KeyHandler() {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
ClientRegistry.registerKeyBinding(keyToggleRingOfLoki);
|
||||
ClientRegistry.registerKeyBinding(keyRingOfLokiClear);
|
||||
ClientRegistry.registerKeyBinding(keyRingOfLokiMirror);
|
||||
|
||||
}
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
@@ -28,9 +35,22 @@ public class KeyHandler {
|
||||
if (keyToggleRingOfLoki.isPressed()){
|
||||
toggleRingLoki();
|
||||
}
|
||||
if(keyRingOfLokiClear.isPressed()){
|
||||
ringOfLokiClear();
|
||||
}
|
||||
if(keyRingOfLokiMirror.isPressed()){
|
||||
toggleRingLokiMirroring();
|
||||
}
|
||||
}
|
||||
|
||||
private static void toggleRingLoki() {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketLokiToggle());
|
||||
}
|
||||
|
||||
private static void ringOfLokiClear() {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketLokiClear());
|
||||
}
|
||||
private static void toggleRingLokiMirroring() {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketLokiMirror());
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
@@ -33,6 +35,8 @@ public final class ShaderHelper {
|
||||
private static final int VERT = ARBVertexShader.GL_VERTEX_SHADER_ARB;
|
||||
private static final int FRAG = ARBFragmentShader.GL_FRAGMENT_SHADER_ARB;
|
||||
|
||||
private static final Int2IntMap TIME_UNIFORM_LOCATIONS = new Int2IntOpenHashMap();
|
||||
|
||||
public static int pylonGlow = 0;
|
||||
public static int enchanterRune = 0;
|
||||
public static int manaPool = 0;
|
||||
@@ -67,8 +71,8 @@ public final class ShaderHelper {
|
||||
ARBShaderObjects.glUseProgramObjectARB(shader);
|
||||
|
||||
if(shader != 0) {
|
||||
int time = ARBShaderObjects.glGetUniformLocationARB(shader, "time");
|
||||
ARBShaderObjects.glUniform1iARB(time, ClientTickHandler.ticksInGame);
|
||||
int timeUniform = TIME_UNIFORM_LOCATIONS.computeIfAbsent(shader, s -> ARBShaderObjects.glGetUniformLocationARB(shader, "time"));
|
||||
ARBShaderObjects.glUniform1iARB(timeUniform, ClientTickHandler.ticksInGame);
|
||||
|
||||
if(callback != null)
|
||||
callback.call(shader);
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 16, 2015, 6:42:40 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.bag;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.client.gui.SlotLocked;
|
||||
|
||||
public class ContainerFlowerBag extends Container {
|
||||
|
||||
InventoryFlowerBag flowerBagInv;
|
||||
|
||||
public ContainerFlowerBag(EntityPlayer player) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
int slot = player.inventory.currentItem;
|
||||
IInventory playerInv = player.inventory;
|
||||
flowerBagInv = new InventoryFlowerBag(player, slot);
|
||||
|
||||
for(i = 0; i < 2; ++i)
|
||||
for(j = 0; j < 8; ++j) {
|
||||
int k = j + i * 8;
|
||||
addSlotToContainer(new SlotFlower(flowerBagInv, k, 17 + j * 18, 26 + i * 18, k));
|
||||
}
|
||||
|
||||
for(i = 0; i < 3; ++i)
|
||||
for(j = 0; j < 9; ++j)
|
||||
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
|
||||
for(i = 0; i < 9; ++i) {
|
||||
if(player.inventory.currentItem == i)
|
||||
addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
|
||||
else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
boolean can = flowerBagInv.isUseableByPlayer(player);
|
||||
if(!can)
|
||||
onContainerClosed(player);
|
||||
|
||||
return can;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
flowerBagInv.pushInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
if(p_82846_2_ < 16) {
|
||||
if(!mergeItemStack(itemstack1, 16, 52, true))
|
||||
return null;
|
||||
} else {
|
||||
int i = itemstack.getItemDamage();
|
||||
if(i < 16) {
|
||||
Slot slot1 = (Slot)inventorySlots.get(i);
|
||||
if(slot1.isItemValid(itemstack) && !mergeItemStack(itemstack1, i, i + 1, true))
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(itemstack1.stackSize == 0)
|
||||
slot.putStack((ItemStack)null);
|
||||
else slot.onSlotChanged();
|
||||
|
||||
if(itemstack1.stackSize == itemstack.stackSize)
|
||||
return null;
|
||||
|
||||
slot.onPickupFromSlot(p_82846_1_, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 16, 2015, 6:42:43 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.bag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class GuiFlowerBag extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_FLOWER_BAG);
|
||||
|
||||
public GuiFlowerBag(EntityPlayer player) {
|
||||
super(new ContainerFlowerBag(player));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String s = StatCollector.translateToLocal("item.botania:flowerBag.name");
|
||||
fontRendererObj.drawString(s, xSize / 2 - fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
|
||||
fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(texture);
|
||||
int k = (width - xSize) / 2;
|
||||
int l = (height - ySize) / 2;
|
||||
drawTexturedModalRect(k, l, 0, 0, xSize, ySize);
|
||||
|
||||
List<Slot> slotList = inventorySlots.inventorySlots;
|
||||
for(Slot slot : slotList)
|
||||
if(slot instanceof SlotFlower) {
|
||||
SlotFlower slotf = (SlotFlower) slot;
|
||||
if(!slotf.getHasStack()) {
|
||||
ItemStack stack = new ItemStack(ModBlocks.flower, 0, slotf.color);
|
||||
int x = guiLeft + slotf.xDisplayPosition;
|
||||
int y = guiTop + slotf.yDisplayPosition;
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
mc.fontRenderer.drawStringWithShadow("0", x + 11, y + 9, 0xFF6666);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int p_146983_1_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 16, 2015, 6:42:56 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.bag;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.ItemFlowerBag;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class InventoryFlowerBag implements IInventory {
|
||||
|
||||
private static final ItemStack[] FALLBACK_INVENTORY = new ItemStack[16];
|
||||
|
||||
EntityPlayer player;
|
||||
int slot;
|
||||
ItemStack[] stacks = null;
|
||||
|
||||
boolean invPushed = false;
|
||||
ItemStack storedInv = null;
|
||||
|
||||
public InventoryFlowerBag(EntityPlayer player, int slot) {
|
||||
this.player = player;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
public static boolean isFlowerBag(ItemStack stack) {
|
||||
return stack != null && stack.getItem() == ModItems.flowerBag;
|
||||
}
|
||||
|
||||
ItemStack getStack() {
|
||||
ItemStack stack = player.inventory.getStackInSlot(slot);
|
||||
if(stack != null)
|
||||
storedInv = stack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
ItemStack[] getInventory() {
|
||||
if(stacks != null)
|
||||
return stacks;
|
||||
|
||||
ItemStack stack = getStack();
|
||||
if(isFlowerBag(getStack())) {
|
||||
stacks = ItemFlowerBag.loadStacks(stack);
|
||||
return stacks;
|
||||
}
|
||||
|
||||
return FALLBACK_INVENTORY;
|
||||
}
|
||||
|
||||
public void pushInventory() {
|
||||
if(invPushed)
|
||||
return;
|
||||
|
||||
ItemStack stack = getStack();
|
||||
if(stack == null)
|
||||
stack = storedInv;
|
||||
|
||||
if(stack != null) {
|
||||
ItemStack[] inv = getInventory();
|
||||
ItemFlowerBag.setStacks(stack, inv);
|
||||
}
|
||||
|
||||
invPushed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return getInventory()[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
ItemStack[] inventorySlots = getInventory();
|
||||
if (inventorySlots[i] != null) {
|
||||
ItemStack stackAt;
|
||||
|
||||
if (inventorySlots[i].stackSize <= j) {
|
||||
stackAt = inventorySlots[i];
|
||||
inventorySlots[i] = null;
|
||||
return stackAt;
|
||||
} else {
|
||||
stackAt = inventorySlots[i].splitStack(j);
|
||||
|
||||
if (inventorySlots[i].stackSize == 0)
|
||||
inventorySlots[i] = null;
|
||||
|
||||
return stackAt;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
return getStackInSlot(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemstack) {
|
||||
ItemStack[] inventorySlots = getInventory();
|
||||
inventorySlots[i] = itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return isFlowerBag(getStack()) ? 64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
|
||||
return isFlowerBag(getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||
return isFlowerBag(getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return LibItemNames.FLOWER_BAG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 16, 2015, 7:20:05 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.gui.bag;
|
||||
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class SlotFlower extends Slot {
|
||||
|
||||
InventoryFlowerBag inv;
|
||||
int color;
|
||||
|
||||
public SlotFlower(InventoryFlowerBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) {
|
||||
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
|
||||
this.color = color;
|
||||
inv = p_i1824_1_;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChange(ItemStack oldStack, ItemStack newStack) {
|
||||
inv.setInventorySlotContents(color, newStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack.getItem() == Item.getItemFromBlock(ModBlocks.flower) && stack.getItemDamage() == color;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package vazkii.botania.client.gui.bags;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.client.gui.SlotLocked;
|
||||
|
||||
public abstract class ContainerMagicPlantBag extends Container {
|
||||
|
||||
protected InventoryMagicPlantBag magicPlantInv;
|
||||
public ContainerMagicPlantBag(EntityPlayer player) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
IInventory playerInv = player.inventory;
|
||||
|
||||
addMagicPlantSlots(player);
|
||||
|
||||
for(i = 0; i < 3; ++i) {
|
||||
for(j = 0; j < 9; ++j) {
|
||||
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(i = 0; i < 9; ++i) {
|
||||
if(player.inventory.currentItem == i) {
|
||||
addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
|
||||
}
|
||||
else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void addMagicPlantSlots(EntityPlayer player);
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
boolean can = magicPlantInv.isUseableByPlayer(player);
|
||||
if(!can)
|
||||
onContainerClosed(player);
|
||||
|
||||
return can;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
magicPlantInv.pushInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
if(p_82846_2_ < 16) {
|
||||
if(!mergeItemStack(itemstack1, 16, 52, true))
|
||||
return null;
|
||||
} else {
|
||||
int i = itemstack.getItemDamage();
|
||||
if(i < 16) {
|
||||
Slot slot1 = (Slot)inventorySlots.get(i);
|
||||
if(slot1.isItemValid(itemstack) && !mergeItemStack(itemstack1, i, i + 1, true))
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(itemstack1.stackSize == 0)
|
||||
slot.putStack((ItemStack)null);
|
||||
else slot.onSlotChanged();
|
||||
|
||||
if(itemstack1.stackSize == itemstack.stackSize)
|
||||
return null;
|
||||
|
||||
slot.onPickupFromSlot(p_82846_1_, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package vazkii.botania.client.gui.bags;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public abstract class GuiMagicPlantBag extends GuiContainer {
|
||||
|
||||
private final ResourceLocation texture;
|
||||
public GuiMagicPlantBag(ContainerMagicPlantBag container, ResourceLocation texture) {
|
||||
super(container);
|
||||
this.texture = texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String s = StatCollector.translateToLocal(getLocalizedNameKey());
|
||||
fontRendererObj.drawString(s, xSize / 2 - fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
|
||||
fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
mc.getTextureManager().bindTexture(texture);
|
||||
int k = (width - xSize) / 2;
|
||||
int l = (height - ySize) / 2;
|
||||
drawTexturedModalRect(k, l, 0, 0, xSize, ySize);
|
||||
|
||||
List<Slot> slotList = inventorySlots.inventorySlots;
|
||||
for(Slot slot : slotList)
|
||||
if(slot instanceof SlotMagicPlant) {
|
||||
SlotMagicPlant slotf = (SlotMagicPlant) slot;
|
||||
if(!slotf.getHasStack()) {
|
||||
ItemStack stack = new ItemStack(itemTypeAllowed(), 0, slotf.color);
|
||||
int x = guiLeft + slotf.xDisplayPosition;
|
||||
int y = guiTop + slotf.yDisplayPosition;
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
mc.fontRenderer.drawStringWithShadow("0", x + 11, y + 9, 0xFF6666);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys(int p_146983_1_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected abstract Block itemTypeAllowed();
|
||||
|
||||
protected abstract String getLocalizedNameKey();
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package vazkii.botania.client.gui.bags;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.bag.ItemBagBase;
|
||||
|
||||
public abstract class InventoryMagicPlantBag implements IInventory {
|
||||
|
||||
private static final ItemStack[] FALLBACK_INVENTORY = new ItemStack[16];
|
||||
|
||||
EntityPlayer player;
|
||||
int slot;
|
||||
ItemStack[] stacks = null;
|
||||
|
||||
boolean invPushed = false;
|
||||
ItemStack storedInv = null;
|
||||
|
||||
public InventoryMagicPlantBag(EntityPlayer player, int slot) {
|
||||
this.player = player;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
ItemStack getStack() {
|
||||
ItemStack stack = player.inventory.getStackInSlot(slot);
|
||||
if(stack != null)
|
||||
storedInv = stack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
public void pushInventory() {
|
||||
if(invPushed)
|
||||
return;
|
||||
|
||||
ItemStack stack = getStack();
|
||||
if(stack == null)
|
||||
stack = storedInv;
|
||||
|
||||
if(stack != null) {
|
||||
ItemStack[] inv = getInventory();
|
||||
ItemBagBase.setStacks(stack, inv);
|
||||
}
|
||||
|
||||
invPushed = true;
|
||||
}
|
||||
|
||||
ItemStack[] getInventory() {
|
||||
if(stacks != null)
|
||||
return stacks;
|
||||
|
||||
ItemStack stack = getStack();
|
||||
if(isMagicPlantBag(getStack())) {
|
||||
stacks = ItemBagBase.loadStacks(stack);
|
||||
return stacks;
|
||||
}
|
||||
|
||||
return FALLBACK_INVENTORY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int slotIn) {
|
||||
return getInventory()[slotIn];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int index, int count) {
|
||||
ItemStack[] inventorySlots = getInventory();
|
||||
if (inventorySlots[index] != null) {
|
||||
ItemStack stackAt;
|
||||
|
||||
if (inventorySlots[index].stackSize <= count) {
|
||||
stackAt = inventorySlots[index];
|
||||
inventorySlots[index] = null;
|
||||
return stackAt;
|
||||
} else {
|
||||
stackAt = inventorySlots[index].splitStack(count);
|
||||
|
||||
if (inventorySlots[index].stackSize == 0)
|
||||
inventorySlots[index] = null;
|
||||
|
||||
return stackAt;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int index) {
|
||||
return getStackInSlot(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int index, ItemStack stack) {
|
||||
ItemStack[] inventorySlots = getInventory();
|
||||
inventorySlots[index] = stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return getBagName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return isMagicPlantBag(getStack()) ? 64 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
return isMagicPlantBag(getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int index, ItemStack stack) {
|
||||
return isMagicPlantBag(getStack());
|
||||
}
|
||||
|
||||
protected abstract String getBagName();
|
||||
|
||||
public abstract boolean isMagicPlantBag(ItemStack stack);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
package vazkii.botania.client.gui.bags;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public abstract class SlotMagicPlant extends Slot {
|
||||
|
||||
InventoryMagicPlantBag inv;
|
||||
int color;
|
||||
|
||||
public SlotMagicPlant(InventoryMagicPlantBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) {
|
||||
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
|
||||
this.color = color;
|
||||
inv = p_i1824_1_;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChange(ItemStack oldStack, ItemStack newStack) {
|
||||
inv.setInventorySlotContents(color, newStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack stack) {
|
||||
return stack.getItem() == Item.getItemFromBlock(getValidBlock()) && stack.getItemDamage() == color;
|
||||
}
|
||||
|
||||
protected abstract Block getValidBlock();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package vazkii.botania.client.gui.bags.flowerBag;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import vazkii.botania.client.gui.bags.ContainerMagicPlantBag;
|
||||
|
||||
public class ContainerFlowerBag extends ContainerMagicPlantBag {
|
||||
public ContainerFlowerBag(EntityPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMagicPlantSlots(EntityPlayer player) {
|
||||
int slot = player.inventory.currentItem;
|
||||
magicPlantInv = new InventoryFlowerBag(player, slot);
|
||||
|
||||
for(int i = 0; i < 2; ++i) {
|
||||
for (int j = 0; j < 8; ++j) {
|
||||
int k = j + i * 8;
|
||||
addSlotToContainer(new SlotFlower(magicPlantInv, k, 17 + j * 18, 26 + i * 18, k));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package vazkii.botania.client.gui.bags.flowerBag;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.client.gui.bags.GuiMagicPlantBag;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class GuiFlowerBag extends GuiMagicPlantBag {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_FLOWER_BAG);
|
||||
|
||||
public GuiFlowerBag(EntityPlayer player) {
|
||||
super(new ContainerFlowerBag(player), texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Block itemTypeAllowed() {
|
||||
return ModBlocks.flower;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLocalizedNameKey() {
|
||||
return "item.botania:flowerBag.name";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package vazkii.botania.client.gui.bags.flowerBag;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.client.gui.bags.InventoryMagicPlantBag;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class InventoryFlowerBag extends InventoryMagicPlantBag {
|
||||
public InventoryFlowerBag(EntityPlayer player, int slot) {
|
||||
super(player, slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMagicPlantBag(ItemStack stack) {
|
||||
return stack != null && stack.getItem() == ModItems.flowerBag;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBagName() {
|
||||
return LibItemNames.FLOWER_BAG;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package vazkii.botania.client.gui.bags.flowerBag;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import vazkii.botania.client.gui.bags.InventoryMagicPlantBag;
|
||||
import vazkii.botania.client.gui.bags.SlotMagicPlant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class SlotFlower extends SlotMagicPlant {
|
||||
public SlotFlower(InventoryMagicPlantBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) {
|
||||
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Block getValidBlock() {
|
||||
return ModBlocks.flower;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package vazkii.botania.client.gui.bags.shroomBag;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import vazkii.botania.client.gui.bags.ContainerMagicPlantBag;
|
||||
|
||||
public class ContainerShroomBag extends ContainerMagicPlantBag {
|
||||
public ContainerShroomBag(EntityPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMagicPlantSlots(EntityPlayer player) {
|
||||
int slot = player.inventory.currentItem;
|
||||
magicPlantInv = new InventoryShroomBag(player, slot);
|
||||
|
||||
for(int i = 0; i < 2; ++i) {
|
||||
for (int j = 0; j < 8; ++j) {
|
||||
int k = j + i * 8;
|
||||
addSlotToContainer(new SlotShroom(magicPlantInv, k, 17 + j * 18, 26 + i * 18, k));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package vazkii.botania.client.gui.bags.shroomBag;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.botania.client.gui.bags.GuiMagicPlantBag;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class GuiShroomBag extends GuiMagicPlantBag {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_SHROOM_BAG);
|
||||
|
||||
public GuiShroomBag(EntityPlayer player) {
|
||||
super(new ContainerShroomBag(player), texture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Block itemTypeAllowed() {
|
||||
return ModBlocks.mushroom;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLocalizedNameKey() {
|
||||
return "item.botania:shroomBag.name";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package vazkii.botania.client.gui.bags.shroomBag;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.client.gui.bags.InventoryMagicPlantBag;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class InventoryShroomBag extends InventoryMagicPlantBag {
|
||||
public InventoryShroomBag(EntityPlayer player, int slot) {
|
||||
super(player, slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMagicPlantBag(ItemStack stack) {
|
||||
return stack != null && stack.getItem() == ModItems.shroomBag;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBagName() {
|
||||
return LibItemNames.SHROOM_BAG;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package vazkii.botania.client.gui.bags.shroomBag;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import vazkii.botania.client.gui.bags.InventoryMagicPlantBag;
|
||||
import vazkii.botania.client.gui.bags.SlotMagicPlant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
|
||||
public class SlotShroom extends SlotMagicPlant {
|
||||
public SlotShroom(InventoryMagicPlantBag p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_, int color) {
|
||||
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Block getValidBlock() {
|
||||
return ModBlocks.mushroom;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,6 +44,7 @@ public final class LibResources {
|
||||
public static final String GUI_NEI_BLANK = PREFIX_GUI + "neiBlank.png";
|
||||
public static final String GUI_NEI_BREWERY = PREFIX_GUI + "neiBrewery.png";
|
||||
public static final String GUI_FLOWER_BAG = PREFIX_GUI + "flowerBag.png";
|
||||
public static final String GUI_SHROOM_BAG = PREFIX_GUI + "shroomBag.png";
|
||||
public static final String GUI_BAUBLE_BOX = PREFIX_GUI + "baubleBox.png";
|
||||
public static final String GUI_HUD_ICONS = PREFIX_GUI + "hudIcons.png";
|
||||
public static final String GUI_STENCIL = PREFIX_GUI + "stencil.png";
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
@@ -16,13 +16,21 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.world.WorldTypeSkyblock;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
public final class SkyblockRenderEvents {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRender(RenderWorldLastEvent event) {
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
if(ConfigHandler.enableFancySkybox && world.provider.dimensionId == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) {
|
||||
|
||||
boolean renderFancySkybox = ConfigHandler.enableFancySkybox && (
|
||||
(ConfigHandler.enableFancySkyboxInNormalWorlds && (world.provider.dimensionId == 0) ) ||
|
||||
(ConfigHandler.enableFancySkyboxInDimension && ConfigHandler.fancySkyboxDimensions.contains(world.provider.dimensionId)) ||
|
||||
(WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))
|
||||
);
|
||||
|
||||
if(renderFancySkybox) {
|
||||
if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer))
|
||||
world.provider.setSkyRenderer(new SkyblockSkyRenderer());
|
||||
}
|
||||
|
||||
@@ -10,17 +10,21 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.ILexicon;
|
||||
import vazkii.botania.api.lexicon.multiblock.Multiblock;
|
||||
@@ -61,16 +65,20 @@ public class TileAlfPortal extends TileMod {
|
||||
|
||||
private static final String TAG_TICKS_OPEN = "ticksOpen";
|
||||
private static final String TAG_TICKS_SINCE_LAST_ITEM = "ticksSinceLastItem";
|
||||
private static final String TAG_STACK_COUNT = "stackCount";
|
||||
private static final String TAG_STACK_COUNT = "stackCount"; // Input stacks
|
||||
private static final String TAG_OUTPUT_COUNT = "outputStackCount";
|
||||
private static final String TAG_STACK = "portalStack";
|
||||
private static final String TAG_OUTPUT_STACK = "outputStack";
|
||||
private static final String TAG_PORTAL_FLAG = "_elvenPortal";
|
||||
|
||||
List<ItemStack> stacksIn = new ArrayList();
|
||||
List<ItemStack> stacksIn = new ArrayList<>();
|
||||
Deque<ItemStack> stacksOut = new ArrayDeque<>();
|
||||
|
||||
public int ticksOpen = 0;
|
||||
int ticksSinceLastItem = 0;
|
||||
private boolean closeNow = false;
|
||||
private boolean hasUnloadedParts = false;
|
||||
private boolean explode = false;
|
||||
|
||||
private static final Function<int[], int[]> CONVERTER_X_Z = new Function<int[], int[]>() {
|
||||
@Override
|
||||
@@ -142,14 +150,18 @@ public class TileAlfPortal extends TileMod {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack != null && (!(stack.getItem() instanceof IElvenItem) || !((IElvenItem) stack.getItem()).isElvenItem(stack)) && !item.getEntityData().hasKey(TAG_PORTAL_FLAG)) {
|
||||
item.setDead();
|
||||
addItem(stack);
|
||||
if (validateItemUsage(stack)) {
|
||||
addItem(stack);
|
||||
}
|
||||
ticksSinceLastItem = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if(ticksSinceLastItem >= 4) {
|
||||
if(!worldObj.isRemote)
|
||||
if(!worldObj.isRemote) {
|
||||
resolveRecipes();
|
||||
spawnOutput();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else closeNow = false;
|
||||
@@ -164,11 +176,40 @@ public class TileAlfPortal extends TileMod {
|
||||
for(int i = 0; i < 36; i++)
|
||||
blockParticle(meta);
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, newMeta, 1 | 2);
|
||||
} else if(explode) {
|
||||
worldObj.createExplosion(null, xCoord + .5, yCoord + 2.0, zCoord + .5, 3f, true);
|
||||
explode = false;
|
||||
}
|
||||
|
||||
hasUnloadedParts = false;
|
||||
}
|
||||
|
||||
private boolean validateItemUsage(ItemStack inputStack) {
|
||||
if (inputStack.getItem() instanceof ILexicon) {
|
||||
// lexicon does not formally have a recipe and is handled in a special branch
|
||||
// in resolveRecipe(), therefore it needs a special branch here as well
|
||||
return true;
|
||||
}
|
||||
for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) {
|
||||
for(Object o : recipe.getInputs()) {
|
||||
if(o instanceof String) {
|
||||
for(ItemStack target : OreDictionary.getOres((String) o)) {
|
||||
if(OreDictionary.itemMatches(target, inputStack, false))
|
||||
return true;
|
||||
}
|
||||
} else if(o instanceof ItemStack) {
|
||||
ItemStack target = (ItemStack) o;
|
||||
if(inputStack.getItem() == target.getItem() && inputStack.getItemDamage() == target.getItemDamage())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(inputStack.getItem() == Items.bread) //Don't teleport bread. (See also: #2403)
|
||||
explode = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void blockParticle(int meta) {
|
||||
int i = worldObj.rand.nextInt(AIR_POSITIONS.length);
|
||||
double[] pos = new double[] {
|
||||
@@ -210,12 +251,16 @@ public class TileAlfPortal extends TileMod {
|
||||
}
|
||||
|
||||
void resolveRecipes() {
|
||||
if (stacksIn.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for(ItemStack stack : stacksIn) {
|
||||
if(stack != null && stack.getItem() instanceof ILexicon) {
|
||||
((ILexicon) stack.getItem()).unlockKnowledge(stack, BotaniaAPI.elvenKnowledge);
|
||||
ItemLexicon.setForcedPage(stack, LexiconData.elvenMessage.getUnlocalizedName());
|
||||
spawnItem(stack);
|
||||
addOutput(stack);
|
||||
stacksIn.remove(i);
|
||||
return;
|
||||
}
|
||||
@@ -224,9 +269,48 @@ public class TileAlfPortal extends TileMod {
|
||||
|
||||
for(RecipeElvenTrade recipe : BotaniaAPI.elvenTradeRecipes) {
|
||||
if(recipe.matches(stacksIn, false)) {
|
||||
recipe.matches(stacksIn, true);
|
||||
spawnItem(recipe.getOutput().copy());
|
||||
break;
|
||||
ItemStack output = recipe.getOutput().copy();
|
||||
int stackSize = output.stackSize;
|
||||
output.stackSize = 0;
|
||||
while (recipe.matches(stacksIn, true)) {
|
||||
output.stackSize += stackSize;
|
||||
}
|
||||
addOutput(output);
|
||||
if (stacksIn.isEmpty()) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void addOutput(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return;
|
||||
}
|
||||
if (stacksOut.isEmpty()) {
|
||||
stacksOut.addLast(stack);
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack lastStack = stacksOut.getLast();
|
||||
if (stack.isItemEqual(lastStack)) {
|
||||
lastStack.stackSize += stack.stackSize;
|
||||
} else {
|
||||
stacksOut.addLast(stack);
|
||||
}
|
||||
}
|
||||
|
||||
void spawnOutput() {
|
||||
if (!stacksOut.isEmpty()) {
|
||||
ItemStack stack = stacksOut.getFirst();
|
||||
if (stack.stackSize > 1) {
|
||||
--stack.stackSize;
|
||||
stack = stack.copy();
|
||||
stack.stackSize = 1;
|
||||
spawnItem(stack);
|
||||
} else if (stack.stackSize == 1) {
|
||||
stacksOut.removeFirst();
|
||||
spawnItem(stack);
|
||||
} else {
|
||||
stacksOut.removeFirst();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -250,6 +334,15 @@ public class TileAlfPortal extends TileMod {
|
||||
cmp.setTag(TAG_STACK + i, stackcmp);
|
||||
i++;
|
||||
}
|
||||
|
||||
cmp.setInteger(TAG_OUTPUT_COUNT, stacksOut.size());
|
||||
i = 0;
|
||||
for(ItemStack stack : stacksOut) {
|
||||
NBTTagCompound stackcmp = new NBTTagCompound();
|
||||
stack.writeToNBT(stackcmp);
|
||||
cmp.setTag(TAG_OUTPUT_STACK + i, stackcmp);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -263,6 +356,14 @@ public class TileAlfPortal extends TileMod {
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(stackcmp);
|
||||
stacksIn.add(stack);
|
||||
}
|
||||
|
||||
count = cmp.getInteger(TAG_OUTPUT_COUNT);
|
||||
stacksOut.clear();
|
||||
for(int i = 0; i < count; i++) {
|
||||
NBTTagCompound stackcmp = cmp.getCompoundTag(TAG_OUTPUT_STACK + i);
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(stackcmp);
|
||||
stacksOut.addLast(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.brew.potion;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -31,17 +32,20 @@ public class PotionBloodthirst extends PotionMod {
|
||||
super(ConfigHandler.potionIDBloodthirst, LibPotionNames.BLOODTHIRST, false, 0xC30000, 3);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSpawn(LivingSpawnEvent.CheckSpawn event) {
|
||||
if(event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) {
|
||||
List<EntityPlayer> players = event.world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE));
|
||||
for(EntityPlayer player : players)
|
||||
if (event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) {
|
||||
double rangeSq = RANGE * RANGE;
|
||||
List<EntityPlayer> players = (List<EntityPlayer>) event.world.playerEntities.stream()
|
||||
.filter(player -> ((EntityPlayer) player).getDistanceSq(event.x, event.y, event.z) <= rangeSq)
|
||||
.map(player -> (EntityPlayer) player)
|
||||
.collect(Collectors.toList());
|
||||
for (EntityPlayer player : players) {
|
||||
if(hasEffect(player) && !hasEffect(player, ModPotions.emptiness)) {
|
||||
event.setResult(Result.ALLOW);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
package vazkii.botania.common.brew.potion;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -33,14 +34,18 @@ public class PotionEmptiness extends PotionMod {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSpawn(LivingSpawnEvent.CheckSpawn event) {
|
||||
if(event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) {
|
||||
List<EntityPlayer> players = event.world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(event.x - RANGE, event.y - RANGE, event.z - RANGE, event.x + RANGE, event.y + RANGE, event.z + RANGE));
|
||||
for(EntityPlayer player : players)
|
||||
if(hasEffect(player)) {
|
||||
if (event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) {
|
||||
double rangeSq = RANGE * RANGE;
|
||||
List<EntityPlayer> players = (List<EntityPlayer>) event.world.playerEntities.stream()
|
||||
.filter(player -> ((EntityPlayer) player).getDistanceSq(event.x, event.y, event.z) <= rangeSq)
|
||||
.map(player -> (EntityPlayer) player)
|
||||
.collect(Collectors.toList());
|
||||
for (EntityPlayer player : players) {
|
||||
if (hasEffect(player)) {
|
||||
event.setResult(Result.DENY);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,10 +11,13 @@
|
||||
package vazkii.botania.common.core.handler;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
@@ -66,6 +69,8 @@ public final class ConfigHandler {
|
||||
public static boolean enableArmorModels = true;
|
||||
public static boolean enableFancySkybox = true;
|
||||
public static boolean enableFancySkyboxInNormalWorlds = false;
|
||||
public static boolean enableFancySkyboxInDimension = false;
|
||||
public static HashSet<Integer> fancySkyboxDimensions = new HashSet<Integer>() {};
|
||||
|
||||
public static int manaBarHeight = 29;
|
||||
public static int flightBarHeight = 49;
|
||||
@@ -197,7 +202,13 @@ public final class ConfigHandler {
|
||||
|
||||
desc = "Set this to true to enable the fancy skybox in non Garden of Glass worlds. (Does not require Garden of Glass loaded to use, needs 'fancySkybox.enable' to be true as well)";
|
||||
enableFancySkyboxInNormalWorlds = loadPropBool("fancySkybox.normalWorlds", desc, enableFancySkyboxInNormalWorlds);
|
||||
|
||||
|
||||
desc = "Set this to true to enable the fancy skybox in custom dimension. (Does not require Garden of Glass loaded to use, needs 'fancySkybox.enable' to be true as well)";
|
||||
enableFancySkyboxInDimension = loadPropBool("fancySkybox.customDim", desc, enableFancySkyboxInDimension);
|
||||
|
||||
desc = "The ID of the dimension to use";
|
||||
fancySkyboxDimensions = loadPropIntSet("fancySkybox.customDimID", desc, fancySkyboxDimensions);
|
||||
|
||||
desc = "The height of the mana display bar in above the XP bar. You can change this if you have a mod that changes where the XP bar is.";
|
||||
manaBarHeight = loadPropInt("manaBar.height", desc, manaBarHeight);
|
||||
|
||||
@@ -364,6 +375,19 @@ public final class ConfigHandler {
|
||||
return prop.getIntList();
|
||||
}
|
||||
|
||||
public static HashSet<Integer> loadPropIntSet(String propName, String desc, HashSet<Integer> intSet) {
|
||||
int[] defaultValues = intSet.stream().mapToInt(Number::intValue).toArray();
|
||||
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, defaultValues);
|
||||
prop.comment = desc;
|
||||
|
||||
if(adaptor != null)
|
||||
adaptor.adaptPropertyIntArray(prop, prop.getIntList());
|
||||
|
||||
return Arrays.stream(prop.getIntList())
|
||||
.boxed()
|
||||
.collect(Collectors.toCollection(HashSet::new));
|
||||
}
|
||||
|
||||
public static int loadPropPotionId(String propName, int default_) {
|
||||
if(!verifiedPotionArray)
|
||||
verifyPotionArray();
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package vazkii.botania.common.core.helper;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
|
||||
public class LokiCursor {
|
||||
private static final String TAG_X_OFFSET = "xOffset";
|
||||
private static final String TAG_Y_OFFSET = "yOffset";
|
||||
private static final String TAG_Z_OFFSET = "zOffset";
|
||||
private static final String TAG_MIRROR_MODE = "mirror";
|
||||
|
||||
private static final byte xAxisBitmask = 4; //100
|
||||
private static final byte yAxisBitmask = 2; //010
|
||||
private static final byte zAxisBitmask = 1; //001
|
||||
|
||||
private byte mirrorMode;
|
||||
private ChunkCoordinates coordinates;
|
||||
|
||||
public LokiCursor(int x, int y, int z, byte mode){
|
||||
coordinates = new ChunkCoordinates(x,y,z);
|
||||
mirrorMode = mode;
|
||||
}
|
||||
|
||||
public static LokiCursor fromNBT(NBTTagCompound cmp){
|
||||
int x = cmp.getInteger(TAG_X_OFFSET);
|
||||
int y = cmp.getInteger(TAG_Y_OFFSET);
|
||||
int z = cmp.getInteger(TAG_Z_OFFSET);
|
||||
byte mirror = cmp.getByte(TAG_MIRROR_MODE);
|
||||
|
||||
return new LokiCursor(x,y,z,mirror);
|
||||
}
|
||||
public static boolean isMirrorX(byte mirrorMode){
|
||||
return (mirrorMode & xAxisBitmask) > 0;
|
||||
}
|
||||
public static boolean isMirrorY(byte mirrorMode){
|
||||
return (mirrorMode & yAxisBitmask) > 0;
|
||||
}
|
||||
public static boolean isMirrorZ(byte mirrorMode){
|
||||
return (mirrorMode & zAxisBitmask) > 0;
|
||||
}
|
||||
public NBTTagCompound toNBT() {
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
cmp.setInteger(TAG_X_OFFSET, coordinates.posX);
|
||||
cmp.setInteger(TAG_Y_OFFSET, coordinates.posY);
|
||||
cmp.setInteger(TAG_Z_OFFSET, coordinates.posZ);
|
||||
cmp.setInteger(TAG_MIRROR_MODE, mirrorMode);
|
||||
return cmp;
|
||||
}
|
||||
|
||||
public int getX(){
|
||||
return coordinates.posX;
|
||||
}
|
||||
|
||||
public int getY(){
|
||||
return coordinates.posY;
|
||||
}
|
||||
|
||||
public int getZ(){
|
||||
return coordinates.posZ;
|
||||
}
|
||||
|
||||
public ChunkCoordinates getCoordinates(){
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
public boolean isMirrorX(){
|
||||
return isMirrorX(mirrorMode);
|
||||
}
|
||||
public boolean isMirrorY(){
|
||||
return isMirrorY(mirrorMode);
|
||||
}
|
||||
public boolean isMirrorZ(){
|
||||
return isMirrorZ(mirrorMode);
|
||||
}
|
||||
|
||||
public boolean isMirror(){
|
||||
return mirrorMode!=0;
|
||||
}
|
||||
}
|
||||
@@ -257,6 +257,7 @@ public final class ModCraftingRecipes {
|
||||
public static IRecipe recipeSwapRing;
|
||||
public static IRecipe recipeSnowHorn;
|
||||
public static IRecipe recipeFlowerBag;
|
||||
public static IRecipe recipeShroomBag;
|
||||
public static IRecipe recipePhantomInk;
|
||||
public static IRecipe recipePoolCart;
|
||||
public static IRecipe recipePump;
|
||||
@@ -1768,6 +1769,13 @@ public final class ModCraftingRecipes {
|
||||
'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE));
|
||||
recipeFlowerBag = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Mushroom Pouch Recipe
|
||||
GameRegistry.addShapedRecipe(new ItemStack(ModItems.shroomBag),
|
||||
"WPW", "W W", " W ",
|
||||
'P', new ItemStack(ModBlocks.mushroom, 1, Short.MAX_VALUE),
|
||||
'W', new ItemStack(Blocks.wool, 1, Short.MAX_VALUE));
|
||||
recipeShroomBag = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Phantom Ink Recipe
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.phantomInk, 4), LibOreDict.MANA_PEARL, "dye", "blockGlass", new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle));
|
||||
recipePhantomInk = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
@@ -198,15 +198,17 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
ItemStack stackAt = inv.getStackInSlot(i);
|
||||
if(stackAt != null && stack.isItemEqual(stackAt) && ItemStack.areItemStackTagsEqual(stack, stackAt)) {
|
||||
boolean consume = true;
|
||||
|
||||
ItemStack container = stackAt.getItem().getContainerItem(stackAt);
|
||||
if(container != null) {
|
||||
if(container == stackAt)
|
||||
consume = false;
|
||||
else {
|
||||
InventoryHelper.insertItemIntoInventory(inv, container);
|
||||
if(container.stackSize != 0 && player != null)
|
||||
player.dropPlayerItemWithRandomChoice(container, false);
|
||||
if(stackAt.getItem().hasContainerItem()) {
|
||||
//there are monsters in this world that will return false above but not null below
|
||||
ItemStack container = stackAt.getItem().getContainerItem(stackAt);
|
||||
if (container != null) {
|
||||
if (container == stackAt)
|
||||
consume = false;
|
||||
else {
|
||||
InventoryHelper.insertItemIntoInventory(inv, container);
|
||||
if (container.stackSize != 0 && player != null)
|
||||
player.dropPlayerItemWithRandomChoice(container, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Mar 16, 2015, 6:43:33 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ItemFlowerBag extends ItemMod {
|
||||
|
||||
private static final String TAG_ITEMS = "InvItems";
|
||||
private static final String TAG_SLOT = "Slot";
|
||||
|
||||
public ItemFlowerBag() {
|
||||
setUnlocalizedName(LibItemNames.FLOWER_BAG);
|
||||
setMaxStackSize(1);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPickupItem(EntityItemPickupEvent event) {
|
||||
ItemStack stack = event.item.getEntityItem();
|
||||
if(stack.getItem() == Item.getItemFromBlock(ModBlocks.flower) && stack.stackSize > 0) {
|
||||
int color = stack.getItemDamage();
|
||||
if(color > 15)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < event.entityPlayer.inventory.getSizeInventory(); i++) {
|
||||
if(i == event.entityPlayer.inventory.currentItem)
|
||||
continue; // prevent item deletion
|
||||
|
||||
ItemStack invStack = event.entityPlayer.inventory.getStackInSlot(i);
|
||||
if(invStack != null && invStack.getItem() == this) {
|
||||
ItemStack[] bagInv = loadStacks(invStack);
|
||||
ItemStack stackAt = bagInv[color];
|
||||
boolean didChange = false;
|
||||
if(stackAt == null) {
|
||||
bagInv[color] = stack.copy();
|
||||
stack.stackSize = 0;
|
||||
didChange = true;
|
||||
} else {
|
||||
int stackAtSize = stackAt.stackSize;
|
||||
int stackSize = stack.stackSize;
|
||||
int spare = 64 - stackAtSize;
|
||||
int pass = Math.min(spare, stackSize);
|
||||
if(pass > 0) {
|
||||
stackAt.stackSize += pass;
|
||||
stack.stackSize -= pass;
|
||||
didChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(didChange)
|
||||
setStacks(invStack, bagInv);
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
player.openGui(Botania.instance, LibGuiIDs.FLOWER_BAG, world, 0, 0, 0);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile != null && tile instanceof IInventory) {
|
||||
if(!world.isRemote) {
|
||||
ForgeDirection side = ForgeDirection.getOrientation(s);
|
||||
IInventory inv = (IInventory) tile;
|
||||
ItemStack[] stacks = loadStacks(stack);
|
||||
ItemStack[] newStacks = new ItemStack[stacks.length];
|
||||
boolean putAny = false;
|
||||
|
||||
int i = 0;
|
||||
for(ItemStack petal : stacks) {
|
||||
if(petal != null) {
|
||||
int count = InventoryHelper.testInventoryInsertion(inv, petal, side);
|
||||
InventoryHelper.insertItemIntoInventory(inv, petal, side, -1);
|
||||
|
||||
ItemStack newPetal = petal.copy();
|
||||
if(newPetal.stackSize == 0)
|
||||
newPetal = null;
|
||||
|
||||
newStacks[i] = newPetal;
|
||||
putAny |= count > 0;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
setStacks(stack, newStacks);
|
||||
if(putAny && inv instanceof TileEntityChest) {
|
||||
inv = InventoryHelper.getInventory(inv);
|
||||
player.displayGUIChest(inv);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ItemStack[] loadStacks(ItemStack stack) {
|
||||
NBTTagList var2 = ItemNBTHelper.getList(stack, TAG_ITEMS, 10, false);
|
||||
ItemStack[] inventorySlots = new ItemStack[16];
|
||||
for(int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
||||
NBTTagCompound var4 = var2.getCompoundTagAt(var3);
|
||||
byte var5 = var4.getByte(TAG_SLOT);
|
||||
if(var5 >= 0 && var5 < inventorySlots.length)
|
||||
inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
|
||||
}
|
||||
|
||||
return inventorySlots;
|
||||
}
|
||||
|
||||
public static void setStacks(ItemStack stack, ItemStack[] inventorySlots) {
|
||||
NBTTagList var2 = new NBTTagList();
|
||||
for(int var3 = 0; var3 < inventorySlots.length; ++var3)
|
||||
if(inventorySlots[var3] != null) {
|
||||
NBTTagCompound var4 = new NBTTagCompound();
|
||||
var4.setByte(TAG_SLOT, (byte)var3);
|
||||
inventorySlots[var3].writeToNBT(var4);
|
||||
var2.appendTag(var4);
|
||||
}
|
||||
|
||||
ItemNBTHelper.setList(stack, TAG_ITEMS, var2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,6 +15,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.common.item.bag.ItemFlowerBag;
|
||||
import vazkii.botania.common.item.bag.ItemShroomBag;
|
||||
import vazkii.botania.common.item.brew.ItemBrewFlask;
|
||||
import vazkii.botania.common.item.brew.ItemBrewVial;
|
||||
import vazkii.botania.common.item.brew.ItemIncenseStick;
|
||||
@@ -232,6 +234,7 @@ public final class ModItems {
|
||||
public static Item cosmetic;
|
||||
public static Item swapRing;
|
||||
public static Item flowerBag;
|
||||
public static Item shroomBag;
|
||||
public static Item phantomInk;
|
||||
public static Item poolMinecart;
|
||||
public static Item pinkinator;
|
||||
@@ -381,6 +384,7 @@ public final class ModItems {
|
||||
cosmetic = new ItemBaubleCosmetic();
|
||||
swapRing = new ItemSwapRing();
|
||||
flowerBag = new ItemFlowerBag();
|
||||
shroomBag = new ItemShroomBag();
|
||||
phantomInk = new ItemPhantomInk();
|
||||
poolMinecart = new ItemPoolMinecart();
|
||||
pinkinator = new ItemPinkinator();
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
package vazkii.botania.common.item.bag;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemMod;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public abstract class ItemBagBase extends ItemMod {
|
||||
|
||||
private static final String TAG_ITEMS = "InvItems";
|
||||
private static final String TAG_SLOT = "Slot";
|
||||
|
||||
public ItemBagBase(String name) {
|
||||
setUnlocalizedName(name);
|
||||
setMaxStackSize(1);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPickupItem(EntityItemPickupEvent event) {
|
||||
ItemStack stack = event.item.getEntityItem();
|
||||
if(stack.getItem() == Item.getItemFromBlock(getValidPickUp()) && stack.stackSize > 0) {
|
||||
int color = stack.getItemDamage();
|
||||
if(color > 15)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < event.entityPlayer.inventory.getSizeInventory(); i++) {
|
||||
if(i == event.entityPlayer.inventory.currentItem)
|
||||
continue; // prevent item deletion
|
||||
|
||||
ItemStack invStack = event.entityPlayer.inventory.getStackInSlot(i);
|
||||
if(invStack != null && invStack.getItem() == this) {
|
||||
ItemStack[] bagInv = loadStacks(invStack);
|
||||
ItemStack stackAt = bagInv[color];
|
||||
boolean didChange = false;
|
||||
if(stackAt == null) {
|
||||
bagInv[color] = stack.copy();
|
||||
stack.stackSize = 0;
|
||||
didChange = true;
|
||||
} else {
|
||||
int stackAtSize = stackAt.stackSize;
|
||||
int stackSize = stack.stackSize;
|
||||
int spare = 64 - stackAtSize;
|
||||
int pass = Math.min(spare, stackSize);
|
||||
if(pass > 0) {
|
||||
stackAt.stackSize += pass;
|
||||
stack.stackSize -= pass;
|
||||
didChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(didChange)
|
||||
setStacks(invStack, bagInv);
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
player.openGui(Botania.instance, getGuiID(), world, 0, 0, 0);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile != null && tile instanceof IInventory) {
|
||||
if(!world.isRemote) {
|
||||
ForgeDirection side = ForgeDirection.getOrientation(s);
|
||||
IInventory inv = (IInventory) tile;
|
||||
ItemStack[] stacks = loadStacks(stack);
|
||||
ItemStack[] newStacks = new ItemStack[stacks.length];
|
||||
boolean putAny = false;
|
||||
|
||||
int i = 0;
|
||||
for(ItemStack petal : stacks) {
|
||||
if(petal != null) {
|
||||
int count = InventoryHelper.testInventoryInsertion(inv, petal, side);
|
||||
InventoryHelper.insertItemIntoInventory(inv, petal, side, -1);
|
||||
|
||||
ItemStack newPetal = petal.copy();
|
||||
if(newPetal.stackSize == 0)
|
||||
newPetal = null;
|
||||
|
||||
newStacks[i] = newPetal;
|
||||
putAny |= count > 0;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
setStacks(stack, newStacks);
|
||||
if(putAny && inv instanceof TileEntityChest) {
|
||||
inv = InventoryHelper.getInventory(inv);
|
||||
player.displayGUIChest(inv);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static ItemStack[] loadStacks(ItemStack stack) {
|
||||
NBTTagList var2 = ItemNBTHelper.getList(stack, TAG_ITEMS, 10, false);
|
||||
ItemStack[] inventorySlots = new ItemStack[16];
|
||||
for(int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
||||
NBTTagCompound var4 = var2.getCompoundTagAt(var3);
|
||||
byte var5 = var4.getByte(TAG_SLOT);
|
||||
if(var5 >= 0 && var5 < inventorySlots.length)
|
||||
inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
|
||||
}
|
||||
|
||||
return inventorySlots;
|
||||
}
|
||||
|
||||
public static void setStacks(ItemStack stack, ItemStack[] inventorySlots) {
|
||||
NBTTagList var2 = new NBTTagList();
|
||||
for(int var3 = 0; var3 < inventorySlots.length; ++var3)
|
||||
if(inventorySlots[var3] != null) {
|
||||
NBTTagCompound var4 = new NBTTagCompound();
|
||||
var4.setByte(TAG_SLOT, (byte)var3);
|
||||
inventorySlots[var3].writeToNBT(var4);
|
||||
var2.appendTag(var4);
|
||||
}
|
||||
|
||||
ItemNBTHelper.setList(stack, TAG_ITEMS, var2);
|
||||
}
|
||||
|
||||
protected abstract Block getValidPickUp();
|
||||
|
||||
protected abstract int getGuiID();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package vazkii.botania.common.item.bag;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemFlowerBag extends ItemBagBase {
|
||||
|
||||
public ItemFlowerBag() {
|
||||
super(LibItemNames.FLOWER_BAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Block getValidPickUp() {
|
||||
return ModBlocks.flower;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getGuiID() {
|
||||
return LibGuiIDs.FLOWER_BAG;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package vazkii.botania.common.item.bag;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemShroomBag extends ItemBagBase{
|
||||
|
||||
public ItemShroomBag() {
|
||||
super(LibItemNames.SHROOM_BAG);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Block getValidPickUp() {
|
||||
return ModBlocks.mushroom;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getGuiID() {
|
||||
return LibGuiIDs.SHROOM_BAG;
|
||||
}
|
||||
}
|
||||
@@ -106,7 +106,7 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.hasPhantomInk"), par3List);
|
||||
}
|
||||
|
||||
void addStringToTooltip(String s, List<String> tooltip) {
|
||||
public void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,12 +10,16 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.relic;
|
||||
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.gtnewhorizon.gtnhlib.GTNHLib;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -24,19 +28,27 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider;
|
||||
import vazkii.botania.api.item.IInWorldRenderable;
|
||||
import vazkii.botania.api.item.ISequentialBreaker;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.handler.BoundTileRenderer;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.LokiCursor;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
@@ -48,26 +60,45 @@ import baubles.common.network.PacketSyncBauble;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.common.network.PacketLokiHudNotificationAck;
|
||||
|
||||
public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeCoordinateListProvider, IManaUsingItem {
|
||||
|
||||
public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeCoordinateListProvider, IManaUsingItem, IInWorldRenderable {
|
||||
|
||||
private static final String TAG_CURSOR_LIST = "cursorList";
|
||||
private static final String TAG_CURSOR_PREFIX = "cursor";
|
||||
private static final String TAG_CURSOR_COUNT = "cursorCount";
|
||||
private static final String TAG_X_OFFSET = "xOffset";
|
||||
private static final String TAG_Y_OFFSET = "yOffset";
|
||||
private static final String TAG_Z_OFFSET = "zOffset";
|
||||
private static final String TAG_X_ORIGIN = "xOrigin";
|
||||
private static final String TAG_Y_ORIGIN = "yOrigin";
|
||||
private static final String TAG_Z_ORIGIN = "zOrigin";
|
||||
private static final String TAG_MODE = "mode";
|
||||
private static final String TAG_BREAKING_MODE = "breaking";
|
||||
private static final String TAG_MIRROR_MODE = "mirror";
|
||||
private boolean recursion = false;
|
||||
|
||||
public static enum HUD_MESSAGE {
|
||||
MODE, BREAKING, CLEAR, MIRROR, INSUFFICIENT_MANA
|
||||
}
|
||||
|
||||
public ItemLokiRing() {
|
||||
super(LibItemNames.LOKI_RING);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||
EntityPlayer player = event.getPlayer();
|
||||
int x = event.x;
|
||||
int y = event.y;
|
||||
int z = event.z;
|
||||
int side = event.blockMetadata;
|
||||
ItemStack stack = player.getCurrentEquippedItem();
|
||||
if(stack == null) return;
|
||||
Item item = player.getCurrentEquippedItem().getItem();
|
||||
breakOnAllCursors(player, item, stack, x, y, z, side);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if(recursion) return;
|
||||
@@ -90,123 +121,318 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
ItemStack heldItemStack = player.getCurrentEquippedItem();
|
||||
ChunkCoordinates originCoords = getOriginPos(lokiRing);
|
||||
MovingObjectPosition lookPos = ToolCommons.raytraceFromEntity(player.worldObj, player, true, 10F);
|
||||
List<ChunkCoordinates> cursors = getCursorList(lokiRing);
|
||||
List<LokiCursor> cursors = getCursorList(lokiRing);
|
||||
int cursorCount = cursors.size();
|
||||
|
||||
int cost = Math.min(cursorCount, (int) Math.pow(Math.E, cursorCount * 0.25));
|
||||
//I don`t think mana for placing should be cruel , so I just made graph with funny line
|
||||
int cost = (int)(50*Math.sin(0.04* cursorCount)+cursorCount+120+20*Math.cos(0.2*cursorCount));
|
||||
|
||||
if (heldItemStack == null && event.action == Action.RIGHT_CLICK_BLOCK && player.isSneaking() && isRingEnabled(lokiRing)) {
|
||||
if(originCoords.posY == -1 && lookPos != null) {
|
||||
setOriginPos(lokiRing, lookPos.blockX, lookPos.blockY, lookPos.blockZ);
|
||||
setCursorList(lokiRing, null);
|
||||
if(player instanceof EntityPlayerMP)
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player);
|
||||
syncLokiRing(player);
|
||||
} else if(lookPos != null) {
|
||||
if(originCoords.posX == lookPos.blockX && originCoords.posY == lookPos.blockY && originCoords.posZ == lookPos.blockZ) {
|
||||
setOriginPos(lokiRing, 0, -1, 0);
|
||||
clearMasterCursor(lokiRing);
|
||||
if(player instanceof EntityPlayerMP)
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player);
|
||||
syncLokiRing(player);
|
||||
} else {
|
||||
addCursor : {
|
||||
int relX = lookPos.blockX - originCoords.posX;
|
||||
int relY = lookPos.blockY - originCoords.posY;
|
||||
int relZ = lookPos.blockZ - originCoords.posZ;
|
||||
|
||||
for(ChunkCoordinates cursor : cursors)
|
||||
if(cursor.posX == relX && cursor.posY == relY && cursor.posZ == relZ) {
|
||||
for(LokiCursor cursor : cursors)
|
||||
if(cursor.getX() == relX && cursor.getY() == relY && cursor.getZ() == relZ) {
|
||||
cursors.remove(cursor);
|
||||
setCursorList(lokiRing, cursors);
|
||||
if(player instanceof EntityPlayerMP)
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player);
|
||||
syncLokiRing(player);
|
||||
break addCursor;
|
||||
}
|
||||
|
||||
addCursor(lokiRing, relX, relY, relZ);
|
||||
addCursor(lokiRing, relX, relY, relZ, getRingMirrorMode(lokiRing) );
|
||||
if(player instanceof EntityPlayerMP)
|
||||
PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, slot), (EntityPlayerMP) player);
|
||||
syncLokiRing(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (heldItemStack != null && event.action == Action.RIGHT_CLICK_BLOCK && lookPos != null && isRingEnabled(lokiRing)) {
|
||||
|
||||
recursion = true;
|
||||
if(!ManaItemHandler.requestManaExact(lokiRing, player, cost, true)){
|
||||
if(player instanceof EntityPlayerMP){
|
||||
vazkii.botania.common.network.PacketHandler.INSTANCE.sendTo(new PacketLokiHudNotificationAck(HUD_MESSAGE.INSUFFICIENT_MANA),(EntityPlayerMP) player);
|
||||
}
|
||||
else
|
||||
{
|
||||
renderHUDNotification(HUD_MESSAGE.INSUFFICIENT_MANA);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
recursion = true;
|
||||
|
||||
double oldPosX = player.posX;
|
||||
double oldPosY = player.posY;
|
||||
double oldPosZ = player.posZ;
|
||||
float oldPitch = player.rotationPitch;
|
||||
float oldYaw = player.rotationYaw;
|
||||
|
||||
int masterOffsetX = originCoords.posY == -1 ? 0 :lookPos.blockX - originCoords.posX;
|
||||
int masterOffsetY = originCoords.posY == -1 ? 0 :lookPos.blockY - originCoords.posY;
|
||||
int masterOffsetZ = originCoords.posY == -1 ? 0 :lookPos.blockZ - originCoords.posZ;
|
||||
|
||||
double playerOffsetX = player.posX - originCoords.posX;
|
||||
double playerOffsetY = player.posY - originCoords.posY;
|
||||
double playerOffsetZ = player.posZ - originCoords.posZ;
|
||||
|
||||
for(LokiCursor cursor : cursors) {
|
||||
|
||||
int x = lookPos.blockX + cursor.getX();
|
||||
int y = lookPos.blockY + cursor.getY();
|
||||
int z = lookPos.blockZ + cursor.getZ();
|
||||
|
||||
if(cursor.isMirrorX()){
|
||||
x -= 2*masterOffsetX;
|
||||
}
|
||||
if(cursor.isMirrorY()){
|
||||
y -= 2*masterOffsetY;
|
||||
}
|
||||
if(cursor.isMirrorZ()){
|
||||
z -= 2*masterOffsetZ;
|
||||
}
|
||||
|
||||
if (player.worldObj.isAirBlock(x, y, z) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
player.posX = cursor.getX()+oldPosX;
|
||||
player.posY = cursor.getY()+oldPosY;
|
||||
player.posZ = cursor.getZ()+oldPosZ;
|
||||
player.rotationYaw = oldYaw;
|
||||
|
||||
if(cursor.isMirrorX()){
|
||||
player.posX -= 2*playerOffsetX;
|
||||
player.rotationYaw = player.rotationYaw * (-1);
|
||||
}
|
||||
if(cursor.isMirrorY()){
|
||||
player.posY -= 2*playerOffsetY;
|
||||
player.rotationPitch = oldPitch * (-1);
|
||||
}
|
||||
if(cursor.isMirrorZ()){
|
||||
player.posZ -= 2*playerOffsetZ;
|
||||
player.rotationYaw = 180 - (Math.abs(player.rotationYaw));
|
||||
if(oldYaw < 0){
|
||||
player.rotationYaw *= -1;
|
||||
}
|
||||
}
|
||||
|
||||
float hitX = (float) (lookPos.hitVec.xCoord - lookPos.blockX);
|
||||
float hitY = (float) (lookPos.hitVec.yCoord - lookPos.blockY);
|
||||
float hitZ = (float) (lookPos.hitVec.zCoord - lookPos.blockZ);
|
||||
if(cursor.isMirrorX()){
|
||||
hitX = 1-hitX;
|
||||
}
|
||||
if(cursor.isMirrorY()){
|
||||
hitY = 1-hitY;
|
||||
}
|
||||
if(cursor.isMirrorZ()){
|
||||
hitZ = 1-hitZ;
|
||||
}
|
||||
|
||||
int hitSide = lookPos.sideHit;
|
||||
if(cursor.isMirrorX() && (hitSide == ForgeDirection.EAST.ordinal() || hitSide == ForgeDirection.WEST.ordinal()) ){
|
||||
hitSide = hitSide ^ 1;
|
||||
}
|
||||
if(cursor.isMirrorY() && (hitSide == ForgeDirection.DOWN.ordinal() || hitSide == ForgeDirection.UP.ordinal()) ){
|
||||
hitSide = hitSide ^ 1;
|
||||
}
|
||||
if(cursor.isMirrorZ() && (hitSide == ForgeDirection.NORTH.ordinal() || hitSide == ForgeDirection.SOUTH.ordinal()) ){
|
||||
hitSide = hitSide ^ 1;
|
||||
}
|
||||
|
||||
for(ChunkCoordinates cursor : cursors) {
|
||||
int x = lookPos.blockX + cursor.posX;
|
||||
int y = lookPos.blockY + cursor.posY;
|
||||
int z = lookPos.blockZ + cursor.posZ;
|
||||
Item item = heldItemStack.getItem();
|
||||
if (!player.worldObj.isAirBlock(x, y, z) && ManaItemHandler.requestManaExact(lokiRing, player, cost, true)) {
|
||||
player.posX = cursor.posX+oldPosX;
|
||||
player.posY = cursor.posY+oldPosY;
|
||||
player.posZ = cursor.posZ+oldPosZ;
|
||||
Block markedBlock = player.worldObj.getBlock(x, y, z);
|
||||
|
||||
float hitX = (float) (lookPos.hitVec.xCoord - lookPos.blockX);
|
||||
float hitY = (float) (lookPos.hitVec.yCoord - lookPos.blockY);
|
||||
float hitZ = (float) (lookPos.hitVec.zCoord - lookPos.blockZ);
|
||||
|
||||
Block markedBlock = player.worldObj.getBlock(x, y, z);
|
||||
boolean wasActivated = markedBlock.onBlockActivated(player.worldObj, x, y, z, player, lookPos.sideHit, hitX,hitY,hitZ);
|
||||
|
||||
if (heldItemStack.stackSize == 0 ) {
|
||||
boolean wasActivated = markedBlock.onBlockActivated(player.worldObj, x, y, z, player, hitSide, hitX,hitY,hitZ);
|
||||
|
||||
if (heldItemStack.stackSize == 0 ) {
|
||||
event.setCanceled(true);
|
||||
break;
|
||||
}
|
||||
if (!wasActivated) {
|
||||
item.onItemUse(player.capabilities.isCreativeMode ? heldItemStack.copy() : heldItemStack, player, player.worldObj, x, y, z, hitSide, (float) lookPos.hitVec.xCoord - x, (float) lookPos.hitVec.yCoord - y, (float) lookPos.hitVec.zCoord - z);
|
||||
if(heldItemStack.stackSize == 0) {
|
||||
event.setCanceled(true);
|
||||
break;
|
||||
}
|
||||
if (!wasActivated) {
|
||||
item.onItemUse(player.capabilities.isCreativeMode ? heldItemStack.copy() : heldItemStack, player, player.worldObj, x, y, z, lookPos.sideHit, (float) lookPos.hitVec.xCoord - x, (float) lookPos.hitVec.yCoord - y, (float) lookPos.hitVec.zCoord - z);
|
||||
if(heldItemStack.stackSize == 0) {
|
||||
event.setCanceled(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
recursion = false;
|
||||
player.posX = oldPosX;
|
||||
player.posY = oldPosY;
|
||||
player.posZ = oldPosZ;
|
||||
player.rotationPitch = oldPitch;
|
||||
player.rotationYaw = oldYaw;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setMode(ItemStack stack, boolean state) {
|
||||
stack.stackTagCompound.setBoolean(TAG_MODE, state);
|
||||
}
|
||||
|
||||
public static void setBreakingMode(ItemStack stack, boolean state) {
|
||||
stack.stackTagCompound.setBoolean(TAG_BREAKING_MODE, state);
|
||||
}
|
||||
|
||||
public static void setMirrorMode (ItemStack stack, byte state) {
|
||||
stack.stackTagCompound.setByte(TAG_MIRROR_MODE, state);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderHUDNotification(){
|
||||
public static void renderHUDNotification(HUD_MESSAGE type){
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
String text = getLokiModeText(getLokiRing(mc.thePlayer));
|
||||
String text;
|
||||
switch (type) {
|
||||
case MODE:
|
||||
text = getLokiModeText(getLokiRing(mc.thePlayer));
|
||||
break;
|
||||
case BREAKING:
|
||||
text = getLokiBreakingModeText(getLokiRing(mc.thePlayer));
|
||||
break;
|
||||
case CLEAR:
|
||||
text = getLokiCearText(getLokiRing(mc.thePlayer));
|
||||
break;
|
||||
case MIRROR:
|
||||
text = getLokiMirrorText(getLokiRing(mc.thePlayer));
|
||||
break;
|
||||
case INSUFFICIENT_MANA:
|
||||
text = EnumChatFormatting.RED + StatCollector.translateToLocal("botaniamisc.insufficient_mana");
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
GTNHLib.proxy.printMessageAboveHotbar(text, 60, true, true);
|
||||
}
|
||||
public static String getLokiModeText(ItemStack stack){
|
||||
return EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.botania:lokiRing.name") + " " + (isRingEnabled(stack) ?
|
||||
EnumChatFormatting.GREEN + StatCollector.translateToLocal("botaniamisc.lokiOn") :
|
||||
EnumChatFormatting.RED + StatCollector.translateToLocal("botaniamisc.lokiOff"));
|
||||
|
||||
public static String getOnOffString(boolean state){
|
||||
return state ? EnumChatFormatting.GREEN + StatCollector.translateToLocal("botaniamisc.lokiOn") :
|
||||
EnumChatFormatting.RED + StatCollector.translateToLocal("botaniamisc.lokiOff");
|
||||
}
|
||||
|
||||
public static String getAxisString(byte state) {
|
||||
EnumChatFormatting x = LokiCursor.isMirrorX(state) ? EnumChatFormatting.GREEN : EnumChatFormatting.RED;
|
||||
EnumChatFormatting y = LokiCursor.isMirrorY(state) ? EnumChatFormatting.GREEN : EnumChatFormatting.RED;
|
||||
EnumChatFormatting z = LokiCursor.isMirrorZ(state) ? EnumChatFormatting.GREEN : EnumChatFormatting.RED;
|
||||
|
||||
return x + "X " + y + "Y " + z + "Z";
|
||||
}
|
||||
|
||||
public static String getLokiModeText(ItemStack stack){
|
||||
return EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.botania:lokiRing.name") + " " + getOnOffString(isRingEnabled(stack));
|
||||
}
|
||||
|
||||
public static String getLokiMirrorText(ItemStack stack){
|
||||
return EnumChatFormatting.GOLD + StatCollector.translateToLocal("botaniamisc.lokiMirror") + " "+
|
||||
getAxisString(getRingMirrorMode(stack));
|
||||
}
|
||||
|
||||
public static String getLokiCearText(ItemStack stack){
|
||||
return EnumChatFormatting.GOLD + StatCollector.translateToLocal("botaniamisc.lokiClear");
|
||||
}
|
||||
|
||||
public static String getLokiBreakingModeText(ItemStack stack){
|
||||
return EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.botania:lokiRing.name") + " "+
|
||||
StatCollector.translateToLocal("botaniamisc.breaking") + " " + getOnOffString(isRingBreakingEnabled(stack));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static boolean isRingEnabled (final ItemStack stack){
|
||||
return stack.stackTagCompound.getBoolean(TAG_MODE);
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
return stack.stackTagCompound.getBoolean(TAG_MODE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRingBreakingEnabled (final ItemStack stack){
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
return stack.stackTagCompound.getBoolean(TAG_BREAKING_MODE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static byte getRingMirrorMode(final ItemStack stack){
|
||||
if(stack.hasTagCompound()){
|
||||
return stack.stackTagCompound.getByte(TAG_MIRROR_MODE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public static void breakOnAllCursors(EntityPlayer player, Item item, ItemStack stack, int x, int y, int z, int side) {
|
||||
ItemStack lokiRing = getLokiRing(player);
|
||||
if(lokiRing == null || player.worldObj.isRemote || !(item instanceof ISequentialBreaker))
|
||||
if (lokiRing == null || player.worldObj.isRemote || !isRingEnabled(lokiRing) || !isRingBreakingEnabled(lokiRing))
|
||||
return;
|
||||
List<LokiCursor> cursors = getCursorList(lokiRing);
|
||||
//In case someone wants to mine ore veins with loki, this should make 1 manapool worth of mana last for 2 veins
|
||||
int cost = 30 * cursors.size();
|
||||
if (!ManaItemHandler.requestManaExact(lokiRing, player, cost, true)) {
|
||||
|
||||
List<ChunkCoordinates> cursors = getCursorList(lokiRing);
|
||||
ISequentialBreaker breaker = (ISequentialBreaker) item;
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
vazkii.botania.common.network.PacketHandler.INSTANCE.sendTo(new PacketLokiHudNotificationAck(HUD_MESSAGE.INSUFFICIENT_MANA), (EntityPlayerMP) player);
|
||||
} else {
|
||||
renderHUDNotification(HUD_MESSAGE.INSUFFICIENT_MANA);
|
||||
}
|
||||
}
|
||||
ISequentialBreaker breaker = null;
|
||||
if(item instanceof ISequentialBreaker)
|
||||
breaker = (ISequentialBreaker) item;
|
||||
World world = player.worldObj;
|
||||
boolean silk = EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, stack) > 0;
|
||||
int fortune = EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack);
|
||||
boolean dispose = breaker.disposeOfTrashBlocks(stack);
|
||||
boolean dispose = breaker == null? true : breaker.disposeOfTrashBlocks(stack);
|
||||
|
||||
ChunkCoordinates originCoords = getOriginPos(lokiRing);
|
||||
|
||||
int masterOffsetX = originCoords.posY == -1 ? 0 :x - originCoords.posX;
|
||||
int masterOffsetY = originCoords.posY == -1 ? 0 :y - originCoords.posY;
|
||||
int masterOffsetZ = originCoords.posY == -1 ? 0 :z - originCoords.posZ;
|
||||
|
||||
for(int i = 0; i < cursors.size(); i++) {
|
||||
ChunkCoordinates coords = cursors.get(i);
|
||||
int xp = x + coords.posX;
|
||||
int yp = y + coords.posY;
|
||||
int zp = z + coords.posZ;
|
||||
LokiCursor cursor = cursors.get(i);
|
||||
int xp = x + cursor.getX();
|
||||
int yp = y + cursor.getY();
|
||||
int zp = z + cursor.getZ();
|
||||
if(cursor.isMirrorX()){
|
||||
xp -= 2*masterOffsetX;
|
||||
}
|
||||
if(cursor.isMirrorY()){
|
||||
yp -= 2*masterOffsetY;
|
||||
}
|
||||
if(cursor.isMirrorZ()){
|
||||
zp -= 2*masterOffsetZ;
|
||||
}
|
||||
|
||||
if(cursor.isMirrorX() && (side == ForgeDirection.EAST.ordinal() || side == ForgeDirection.WEST.ordinal()) ){
|
||||
side = side ^ 1;
|
||||
}
|
||||
if(cursor.isMirrorY() && (side == ForgeDirection.DOWN.ordinal() || side == ForgeDirection.UP.ordinal()) ){
|
||||
side = side ^ 1;
|
||||
}
|
||||
if(cursor.isMirrorZ() && (side == ForgeDirection.NORTH.ordinal() || side == ForgeDirection.SOUTH.ordinal()) ){
|
||||
side = side ^ 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Block block = world.getBlock(xp, yp, zp);
|
||||
breaker.breakOtherBlock(player, stack, xp, yp, zp, x, y, z, side);
|
||||
ToolCommons.removeBlockWithDrops(player, stack, player.worldObj, xp, yp, zp, x, y, z, block, new Material[] { block.getMaterial() }, silk, fortune, block.getBlockHardness(world, xp, yp, zp), dispose);
|
||||
if(breaker != null)
|
||||
breaker.breakOtherBlock(player, stack, xp, yp, zp, x, y, z, side);
|
||||
ToolCommons.removeBlockWithDrops(player, stack, player.worldObj, xp, yp, zp, x, y, z, block, new Material[] { block.getMaterial() }, silk, fortune, block.getBlockHardness(world, xp, yp, zp), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,34 +443,55 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
|
||||
@Override
|
||||
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||
setCursorList(stack, null);
|
||||
clearCursors(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiDescription"), list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiDescription2"), list);
|
||||
addStringToTooltip("", list);
|
||||
addStringToTooltip(EnumChatFormatting.WHITE +StatCollector.translateToLocal("botaniamisc.lokiCurrent"), list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiState") + ": " + getOnOffString(isRingEnabled(stack)), list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.breaking") + ": " + getOnOffString(isRingBreakingEnabled(stack)), list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiMirror") + getAxisString(getRingMirrorMode(stack)), list);
|
||||
addStringToTooltip("", list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiToggleDescription") + " " + getOnOffString(true) + EnumChatFormatting.RESET + "/"+ getOnOffString(false), list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.lokiBreakingDescription") + " " + getOnOffString(true) + EnumChatFormatting.RESET+"/" + getOnOffString(false), list);
|
||||
super.addInformation(stack, player, list, adv);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public List<ChunkCoordinates> getWireframesToDraw(EntityPlayer player, ItemStack stack) {
|
||||
if(getLokiRing(player) != stack)
|
||||
ItemStack lokiRing = getLokiRing(player);
|
||||
if(lokiRing != stack || !isRingEnabled(lokiRing) )
|
||||
return null;
|
||||
|
||||
MovingObjectPosition lookPos = Minecraft.getMinecraft().objectMouseOver;
|
||||
|
||||
if(lookPos != null && !player.worldObj.isAirBlock(lookPos.blockX, lookPos.blockY, lookPos.blockZ) && lookPos.entityHit == null) {
|
||||
List<ChunkCoordinates> list = getCursorList(stack);
|
||||
if(lookPos != null && lookPos.entityHit == null) {
|
||||
List<LokiCursor> list = getCursorList(stack);
|
||||
ChunkCoordinates origin = getOriginPos(stack);
|
||||
List<ChunkCoordinates> toDraw = new ArrayList<>();
|
||||
|
||||
if(origin.posY != -1) {
|
||||
for(ChunkCoordinates coords : list) {
|
||||
for(LokiCursor cursor : list) {
|
||||
ChunkCoordinates coords = cursor.getCoordinates();
|
||||
coords.posX += origin.posX;
|
||||
coords.posY += origin.posY;
|
||||
coords.posZ += origin.posZ;
|
||||
toDraw.add(coords);
|
||||
}
|
||||
} else for(ChunkCoordinates coords : list) {
|
||||
} else for(LokiCursor cursor : list) {
|
||||
ChunkCoordinates coords = cursor.getCoordinates();
|
||||
coords.posX += lookPos.blockX;
|
||||
coords.posY += lookPos.blockY;
|
||||
coords.posZ += lookPos.blockZ;
|
||||
toDraw.add(coords);
|
||||
}
|
||||
|
||||
return list;
|
||||
return toDraw;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -252,7 +499,15 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getSourceWireframe(EntityPlayer player, ItemStack stack) {
|
||||
return getLokiRing(player) == stack ? getOriginPos(stack) : null;
|
||||
return getLokiRing(player) == stack && isRingEnabled(stack) ? getOriginPos(stack) : null;
|
||||
}
|
||||
|
||||
public static void clearCursors(ItemStack stack){
|
||||
setCursorList(stack, null);
|
||||
}
|
||||
|
||||
public static void clearMasterCursor(ItemStack stack){
|
||||
setOriginPos(stack, 0, -1, 0);
|
||||
}
|
||||
|
||||
public static ItemStack getLokiRing(EntityPlayer player) {
|
||||
@@ -262,6 +517,17 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
return isLokiRing(stack1) ? stack1 : isLokiRing(stack2) ? stack2 : null;
|
||||
}
|
||||
|
||||
public static int getLokiRingSlot(EntityPlayer player) {
|
||||
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(player);
|
||||
ItemStack stack1 = baubles.getStackInSlot(1);
|
||||
ItemStack stack2 = baubles.getStackInSlot(2);
|
||||
return isLokiRing(stack1) ? 1 : isLokiRing(stack2) ? 2 : null;
|
||||
}
|
||||
|
||||
public static void syncLokiRing(EntityPlayer player){
|
||||
baubles.common.network.PacketHandler.INSTANCE.sendTo(new PacketSyncBauble(player, getLokiRingSlot(player)), (EntityPlayerMP) player);
|
||||
}
|
||||
|
||||
private static boolean isLokiRing(ItemStack stack) {
|
||||
return stack != null && (stack.getItem() == ModItems.lokiRing || stack.getItem() == ModItems.aesirRing);
|
||||
}
|
||||
@@ -279,28 +545,26 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
ItemNBTHelper.setInt(stack, TAG_Z_ORIGIN, z);
|
||||
}
|
||||
|
||||
private static List<ChunkCoordinates> getCursorList(ItemStack stack) {
|
||||
private static List<LokiCursor> getCursorList(ItemStack stack) {
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_CURSOR_LIST, false);
|
||||
List<ChunkCoordinates> cursors = new ArrayList();
|
||||
List<LokiCursor> cursors = new ArrayList();
|
||||
|
||||
int count = cmp.getInteger(TAG_CURSOR_COUNT);
|
||||
for(int i = 0; i < count; i++) {
|
||||
NBTTagCompound cursorCmp = cmp.getCompoundTag(TAG_CURSOR_PREFIX + i);
|
||||
int x = cursorCmp.getInteger(TAG_X_OFFSET);
|
||||
int y = cursorCmp.getInteger(TAG_Y_OFFSET);
|
||||
int z = cursorCmp.getInteger(TAG_Z_OFFSET);
|
||||
cursors.add(new ChunkCoordinates(x, y, z));
|
||||
cursors.add(LokiCursor.fromNBT(cursorCmp));
|
||||
|
||||
}
|
||||
|
||||
return cursors;
|
||||
}
|
||||
|
||||
private static void setCursorList(ItemStack stack, List<ChunkCoordinates> cursors) {
|
||||
private static void setCursorList(ItemStack stack, List<LokiCursor> cursors) {
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
if(cursors != null) {
|
||||
int i = 0;
|
||||
for(ChunkCoordinates cursor : cursors) {
|
||||
NBTTagCompound cursorCmp = cursorToCmp(cursor.posX, cursor.posY, cursor.posZ);
|
||||
for(LokiCursor cursor : cursors) {
|
||||
NBTTagCompound cursorCmp = cursor.toNBT();
|
||||
cmp.setTag(TAG_CURSOR_PREFIX + i, cursorCmp);
|
||||
i++;
|
||||
}
|
||||
@@ -310,18 +574,12 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
ItemNBTHelper.setCompound(stack, TAG_CURSOR_LIST, cmp);
|
||||
}
|
||||
|
||||
private static NBTTagCompound cursorToCmp(int x, int y, int z) {
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
cmp.setInteger(TAG_X_OFFSET, x);
|
||||
cmp.setInteger(TAG_Y_OFFSET, y);
|
||||
cmp.setInteger(TAG_Z_OFFSET, z);
|
||||
return cmp;
|
||||
}
|
||||
|
||||
private static void addCursor(ItemStack stack, int x, int y, int z) {
|
||||
|
||||
private static void addCursor(ItemStack stack, int x, int y, int z, byte mirrorMode) {
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_CURSOR_LIST, false);
|
||||
int count = cmp.getInteger(TAG_CURSOR_COUNT);
|
||||
cmp.setTag(TAG_CURSOR_PREFIX + count, cursorToCmp(x, y, z));
|
||||
cmp.setTag(TAG_CURSOR_PREFIX + count, new LokiCursor(x,y,z, mirrorMode).toNBT());
|
||||
cmp.setInteger(TAG_CURSOR_COUNT, count + 1);
|
||||
ItemNBTHelper.setCompound(stack, TAG_CURSOR_LIST, cmp);
|
||||
}
|
||||
@@ -331,5 +589,117 @@ public class ItemLokiRing extends ItemRelicBauble implements IExtendedWireframeC
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInWorld(EntityPlayer player, ItemStack stack){
|
||||
renderMirrors(player,stack);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void renderMirrors(EntityPlayer player,ItemStack stack) {
|
||||
ItemStack lokiRing = getLokiRing(player);
|
||||
if(lokiRing != stack || !isRingEnabled(lokiRing) )
|
||||
return;
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
List<LokiCursor> cursors = getCursorList(stack);
|
||||
ChunkCoordinates origin = getOriginPos(stack);
|
||||
MovingObjectPosition lookPos = Minecraft.getMinecraft().objectMouseOver;
|
||||
|
||||
|
||||
for(LokiCursor cursor : cursors) {
|
||||
if(!cursor.isMirror()) {
|
||||
continue;
|
||||
}
|
||||
ChunkCoordinates pos = cursor.getCoordinates();
|
||||
if(origin.posY != -1){
|
||||
|
||||
pos.posX += origin.posX;
|
||||
pos.posY += origin.posY;
|
||||
pos.posZ += origin.posZ;
|
||||
}else{
|
||||
pos.posX += lookPos.blockX;
|
||||
pos.posY += lookPos.blockY;
|
||||
pos.posZ += lookPos.blockZ;
|
||||
}
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(pos.posX - RenderManager.renderPosX, pos.posY - RenderManager.renderPosY, pos.posZ - RenderManager.renderPosZ + 1);
|
||||
Color colorRGB = new Color(BoundTileRenderer.getWireframeColor());
|
||||
GL11.glColor4ub((byte) colorRGB.getRed(), (byte) colorRGB.getGreen(), (byte) colorRGB.getBlue(), (byte) 255);
|
||||
Block block = world.getBlock(pos.posX, pos.posY, pos.posZ);
|
||||
|
||||
if (block != null) {
|
||||
AxisAlignedBB axis = block.getSelectedBoundingBoxFromPool(world, pos.posX, pos.posY, pos.posZ);
|
||||
|
||||
if (axis != null) {
|
||||
axis.minX -= pos.posX;
|
||||
axis.maxX -= pos.posX;
|
||||
axis.minY -= pos.posY;
|
||||
axis.maxY -= pos.posY;
|
||||
axis.minZ -= pos.posZ + 1;
|
||||
axis.maxZ -= pos.posZ + 1;
|
||||
|
||||
GL11.glScalef(1F, 1F, 1F);
|
||||
|
||||
GL11.glLineWidth(1F);
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawing(GL11.GL_LINES);
|
||||
if (cursor.isMirrorX()) {
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.minY,axis.minZ);
|
||||
tessellator.addVertex(axis.minX,axis.maxY,axis.maxZ);
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.maxY,axis.minZ);
|
||||
tessellator.addVertex(axis.minX,axis.minY,axis.maxZ);
|
||||
|
||||
tessellator.addVertex(axis.maxX,axis.minY,axis.minZ);
|
||||
tessellator.addVertex(axis.maxX,axis.maxY,axis.maxZ);
|
||||
|
||||
tessellator.addVertex(axis.maxX,axis.maxY,axis.minZ);
|
||||
tessellator.addVertex(axis.maxX,axis.minY,axis.maxZ);
|
||||
|
||||
}
|
||||
if (cursor.isMirrorY()) {
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.minY,axis.minZ);
|
||||
tessellator.addVertex(axis.maxX,axis.minY,axis.maxZ);
|
||||
|
||||
tessellator.addVertex(axis.maxX,axis.minY,axis.minZ);
|
||||
tessellator.addVertex(axis.minX,axis.minY,axis.maxZ);
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.maxY,axis.minZ);
|
||||
tessellator.addVertex(axis.maxX,axis.maxY,axis.maxZ);
|
||||
|
||||
tessellator.addVertex(axis.maxX,axis.maxY,axis.minZ);
|
||||
tessellator.addVertex(axis.minX,axis.maxY,axis.maxZ);
|
||||
|
||||
}
|
||||
if (cursor.isMirrorZ()) {
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.minY,axis.minZ);
|
||||
tessellator.addVertex(axis.maxX,axis.maxY,axis.minZ);
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.maxY,axis.minZ);
|
||||
tessellator.addVertex(axis.maxX,axis.minY,axis.minZ);
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.minY,axis.maxZ);
|
||||
tessellator.addVertex(axis.maxX,axis.maxY,axis.maxZ);
|
||||
|
||||
tessellator.addVertex(axis.minX,axis.maxY,axis.maxZ);
|
||||
tessellator.addVertex(axis.maxX,axis.minY,axis.maxZ);
|
||||
|
||||
|
||||
}
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ public final class LexiconData {
|
||||
public static LexiconEntry terrasteel;
|
||||
public static LexiconEntry blackLotus;
|
||||
public static LexiconEntry flowerBag;
|
||||
public static LexiconEntry shroomBag;
|
||||
public static LexiconEntry gardenOfGlass;
|
||||
|
||||
public static LexiconEntry manaIntro;
|
||||
@@ -395,6 +396,10 @@ public final class LexiconData {
|
||||
flowerBag.setLexiconPages(new PageText("0"), new PageText("2"),
|
||||
new PageCraftingRecipe("1", ModCraftingRecipes.recipeFlowerBag));
|
||||
|
||||
shroomBag = new BLexiconEntry(LibLexicon.BASICS_SHROOM_BAG, categoryBasics);
|
||||
shroomBag.setLexiconPages(new PageText("0"),
|
||||
new PageCraftingRecipe("1", ModCraftingRecipes.recipeShroomBag));
|
||||
|
||||
if (Botania.gardenOfGlassLoaded) {
|
||||
gardenOfGlass = new BLexiconEntry(LibLexicon.BASICS_GARDEN_OF_GLASS, categoryBasics);
|
||||
gardenOfGlass.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"),
|
||||
|
||||
@@ -17,4 +17,6 @@ public final class LibGuiIDs {
|
||||
public static final int FLOWER_BAG = 2;
|
||||
public static final int BAUBLE_BOX = 3;
|
||||
|
||||
public static final int SHROOM_BAG = 4;
|
||||
|
||||
}
|
||||
@@ -126,6 +126,7 @@ public final class LibItemNames {
|
||||
public static final String COSMETIC = "cosmetic";
|
||||
public static final String SWAP_RING = "swapRing";
|
||||
public static final String FLOWER_BAG = "flowerBag";
|
||||
public static final String SHROOM_BAG = "shroomBag";
|
||||
public static final String PHANTOM_INK = "phantomInk";
|
||||
public static final String POOL_MINECART = "poolMinecart";
|
||||
public static final String PINKINATOR = "pinkinator";
|
||||
|
||||
@@ -38,6 +38,7 @@ public final class LibLexicon {
|
||||
public static final String BASICS_TERRASTEEL = "terrasteel";
|
||||
public static final String BASICS_BLACK_LOTUS = "blackLotus";
|
||||
public static final String BASICS_FLOWER_BAG = "flowerBag";
|
||||
public static final String BASICS_SHROOM_BAG = "shroomBag";
|
||||
public static final String BASICS_GARDEN_OF_GLASS = "gardenOfGlass";
|
||||
|
||||
public static final String MANA_INTRO = "mIntro";
|
||||
|
||||
@@ -12,8 +12,10 @@ package vazkii.botania.common.network;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.gui.bag.ContainerFlowerBag;
|
||||
import vazkii.botania.client.gui.bag.GuiFlowerBag;
|
||||
import vazkii.botania.client.gui.bags.flowerBag.ContainerFlowerBag;
|
||||
import vazkii.botania.client.gui.bags.flowerBag.GuiFlowerBag;
|
||||
import vazkii.botania.client.gui.bags.shroomBag.ContainerShroomBag;
|
||||
import vazkii.botania.client.gui.bags.shroomBag.GuiShroomBag;
|
||||
import vazkii.botania.client.gui.box.ContainerBaubleBox;
|
||||
import vazkii.botania.client.gui.box.GuiBaubleBox;
|
||||
import vazkii.botania.client.gui.crafting.ContainerCraftingHalo;
|
||||
@@ -31,6 +33,8 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new ContainerCraftingHalo(player.inventory, world);
|
||||
case LibGuiIDs.FLOWER_BAG :
|
||||
return new ContainerFlowerBag(player);
|
||||
case LibGuiIDs.SHROOM_BAG:
|
||||
return new ContainerShroomBag(player);
|
||||
case LibGuiIDs.BAUBLE_BOX :
|
||||
return new ContainerBaubleBox(player);
|
||||
}
|
||||
@@ -48,6 +52,8 @@ public class GuiHandler implements IGuiHandler {
|
||||
return new GuiCraftingHalo(player.inventory, world);
|
||||
case LibGuiIDs.FLOWER_BAG :
|
||||
return new GuiFlowerBag(player);
|
||||
case LibGuiIDs.SHROOM_BAG:
|
||||
return new GuiShroomBag(player);
|
||||
case LibGuiIDs.BAUBLE_BOX :
|
||||
return new GuiBaubleBox(player);
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ public class PacketHandler {
|
||||
|
||||
public static void initPackets() {
|
||||
INSTANCE.registerMessage(PacketLokiToggle.class, PacketLokiToggle.class, 1, Side.SERVER);
|
||||
INSTANCE.registerMessage(PacketLokiToggleAck.class, PacketLokiToggleAck.class, 2, Side.CLIENT);
|
||||
INSTANCE.registerMessage(PacketLokiClear.class, PacketLokiClear.class, 2, Side.SERVER);
|
||||
INSTANCE.registerMessage(PacketLokiMirror.class, PacketLokiMirror.class, 3, Side.SERVER);
|
||||
INSTANCE.registerMessage(PacketLokiHudNotificationAck.class, PacketLokiHudNotificationAck.class, 4, Side.CLIENT);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package vazkii.botania.common.network;
|
||||
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.relic.ItemLokiRing;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
|
||||
public class PacketLokiClear implements IMessage, IMessageHandler<PacketLokiClear, IMessage> {
|
||||
@Override
|
||||
public void fromBytes(ByteBuf byteBuf) {
|
||||
// not needed
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf byteBuf) {
|
||||
// not needed
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketLokiClear message, MessageContext ctx) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
final ItemStack aRing = ItemLokiRing.getLokiRing(player);
|
||||
if (aRing != null) {
|
||||
ItemLokiRing.clearCursors(aRing);
|
||||
ItemLokiRing.clearMasterCursor(aRing);
|
||||
ItemLokiRing.syncLokiRing(player);
|
||||
PacketHandler.INSTANCE.sendTo(new PacketLokiHudNotificationAck(ItemLokiRing.HUD_MESSAGE.CLEAR), player);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package vazkii.botania.common.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.relic.ItemLokiRing;
|
||||
|
||||
public class PacketLokiHudNotificationAck implements IMessage, IMessageHandler<PacketLokiHudNotificationAck, IMessage> {
|
||||
|
||||
|
||||
public ItemLokiRing.HUD_MESSAGE hudMessage;
|
||||
|
||||
public PacketLokiHudNotificationAck(){
|
||||
|
||||
}
|
||||
|
||||
public PacketLokiHudNotificationAck(ItemLokiRing.HUD_MESSAGE aHudMessage){
|
||||
hudMessage = aHudMessage;
|
||||
}
|
||||
@Override
|
||||
public void fromBytes(ByteBuf byteBuf) {
|
||||
int ordinal = byteBuf.readInt();
|
||||
if (ordinal >= 0 && ordinal < ItemLokiRing.HUD_MESSAGE.values().length) {
|
||||
hudMessage = ItemLokiRing.HUD_MESSAGE.values()[ordinal];
|
||||
} else {
|
||||
hudMessage = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf byteBuf) {
|
||||
byteBuf.writeInt(hudMessage.ordinal());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IMessage onMessage(PacketLokiHudNotificationAck message, MessageContext ctx) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
final ItemStack aRing = ItemLokiRing.getLokiRing(mc.thePlayer) ;
|
||||
if (aRing != null && message.hudMessage != null) {
|
||||
ItemLokiRing.renderHUDNotification(message.hudMessage);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package vazkii.botania.common.network;
|
||||
|
||||
import baubles.common.network.PacketSyncBauble;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.relic.ItemLokiRing;
|
||||
|
||||
public class PacketLokiMirror implements IMessage, IMessageHandler<PacketLokiMirror, IMessage> {
|
||||
@Override
|
||||
public void fromBytes(ByteBuf byteBuf) {
|
||||
// not needed
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf byteBuf) {
|
||||
// not needed
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketLokiMirror message, MessageContext ctx) {
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
final ItemStack aRing = ItemLokiRing.getLokiRing(player);
|
||||
if (aRing != null) {
|
||||
byte mode = ItemLokiRing.getRingMirrorMode(aRing);
|
||||
ItemLokiRing.setMirrorMode(aRing,(byte) ((mode+1)%8));
|
||||
ItemLokiRing.syncLokiRing(player);
|
||||
PacketHandler.INSTANCE.sendTo(new PacketLokiHudNotificationAck(ItemLokiRing.HUD_MESSAGE.MIRROR), player);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -25,12 +25,20 @@ public class PacketLokiToggle implements IMessage, IMessageHandler<PacketLokiTog
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
final ItemStack aRing = ItemLokiRing.getLokiRing(player);
|
||||
if (aRing != null) {
|
||||
boolean ringState = !ItemLokiRing.isRingEnabled(aRing);
|
||||
ItemLokiRing.setMode(aRing, ringState);
|
||||
PacketLokiToggleAck ackMessage = new PacketLokiToggleAck();
|
||||
ackMessage.state = ringState;
|
||||
PacketHandler.INSTANCE.sendTo(ackMessage, player);
|
||||
if(player.isSneaking()){
|
||||
boolean ringState = !ItemLokiRing.isRingBreakingEnabled(aRing);
|
||||
ItemLokiRing.setBreakingMode(aRing, ringState);
|
||||
ItemLokiRing.syncLokiRing(player);
|
||||
PacketHandler.INSTANCE.sendTo(new PacketLokiHudNotificationAck(ItemLokiRing.HUD_MESSAGE.BREAKING), player);
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean ringState = !ItemLokiRing.isRingEnabled(aRing);
|
||||
ItemLokiRing.setMode(aRing, ringState);
|
||||
ItemLokiRing.syncLokiRing(player);
|
||||
PacketHandler.INSTANCE.sendTo(new PacketLokiHudNotificationAck(ItemLokiRing.HUD_MESSAGE.MODE), player);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package vazkii.botania.common.network;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.common.item.relic.ItemLokiRing;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class PacketLokiToggleAck implements IMessage, IMessageHandler<PacketLokiToggleAck, IMessage> {
|
||||
|
||||
public boolean state;
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf byteBuf) {
|
||||
state = byteBuf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf byteBuf) {
|
||||
byteBuf.writeBoolean(state);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IMessage onMessage(PacketLokiToggleAck message, MessageContext ctx) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
final ItemStack aRing = ItemLokiRing.getLokiRing(mc.thePlayer) ;
|
||||
if (aRing != null) {
|
||||
ItemLokiRing.setMode(aRing, message.state);
|
||||
ItemLokiRing.renderHUDNotification();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -155,9 +155,22 @@ botaniamisc.altarRefill1=add back the last recipe
|
||||
botaniamisc.santaweaveInfo=Manaweave, changed up for the &cs&fe&ca&fs&co&fn
|
||||
botaniamisc.enterToView=^ Press ENTER to view ^
|
||||
botaniamisc.keyCategory=Botania
|
||||
botaniamisc.toggleLoki=Toggle Ring of Loki
|
||||
|
||||
#LOKI
|
||||
botaniamisc.toggleLoki=Ring of Loki Switch Key
|
||||
botaniamisc.ringOfLokiClear=Clear Ring of Loki Selection
|
||||
botaniamisc.lokiOn=On
|
||||
botaniamisc.lokiOff=Off
|
||||
botaniamisc.breaking=Breaking
|
||||
botaniamisc.lokiClear=Successfully cleared all selection
|
||||
botaniamisc.lokiDescription=Builder's wand but §c§oC§6§oo§e§oo§a§ol§9§oe§5§or
|
||||
botaniamisc.lokiDescription2=Can Place/Interact/Break with multiple blocks at once!
|
||||
botaniamisc.lokiToggleDescription=Loki Switch Key to turn ring
|
||||
botaniamisc.lokiBreakingDescription=Loki Switch Key + Shift to toggle breaking
|
||||
botaniamisc.lokiCurrent=Current
|
||||
botaniamisc.lokiState=Ring
|
||||
botaniamisc.lokiMirror=Current mirror:
|
||||
botaniamisc.insufficient_mana=Not enough mana!
|
||||
|
||||
# NEI INTEGRATION
|
||||
botania.nei.brewery=Botanical Brewery
|
||||
@@ -1619,6 +1632,7 @@ item.botania:cosmetic31.name=Questgiver Mark
|
||||
item.botania:manaString.name=Mana Infused String
|
||||
item.botania:swapRing.name=Ring of Correction
|
||||
item.botania:flowerBag.name=Flower Pouch
|
||||
item.botania:shroomBag.name=Mushroom Pouch
|
||||
item.botania:phantomInk.name=Phantom Ink
|
||||
item.botania:poolMinecart.name=Minecart with Mana Pool
|
||||
item.botania:pinkinator.name=The Pinkinator
|
||||
@@ -2110,6 +2124,12 @@ botania.page.flowerBag0=The laws of physics regarding one's &4Inventory&0 are so
|
||||
botania.page.flowerBag2=Items won't be added automatically to the pouch if that's the item being held.<br>Furthermore, shift-right clicking the pouch into a &1Chest&0 or other inventory will store the flowers it contains into said inventory.
|
||||
botania.page.flowerBag1=Pull a copter out of it (any colors work)
|
||||
|
||||
# -- MUSHROOM POUCH
|
||||
botania.entry.shroomBag=Mushroom Pouch
|
||||
botania.tagline.shroomBag=A trusty pouch to hold your mushroom goodness
|
||||
botania.page.shroomBag0=Similar to the &1Flower Pouch&0, the mushroom pouch will hold all of those pesky &1Mystical Mushrooms&0 that have been clogging up your inventory.<br>Remember the bag will not pick up items if you are holding it in your hand.<br>Furthermore, shift-right clicking the pouch into a &1Chest&0 or other inventory will store the flowers it contains into said inventory.
|
||||
botania.page.shroomBag1=Any colors work
|
||||
|
||||
# -- WRAP
|
||||
botania.entry.wrap=Wrap
|
||||
botania.tagline.wrap=It's a wrap
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 506 B |
Reference in new issue
Block a user