Compare commits

...
Author SHA1 Message Date
UltraProdigy 0852f91ba7 Update dep&bs (#126) 2026-03-07 09:34:46 +00:00
UltraProdigy 38845602a9 Optimize Image & Workflow (#125) 2026-03-07 09:39:25 +01:00
Ranzu 4878e88fce GuiTitles Localization (#124) 2026-02-22 21:38:00 +01:00
fa850857e8 Refactor: tiered tool interface (#103)
Co-authored-by: Marcel Sondaar <noreply@combuster.nl>
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: Ruling-0 <47913168+Ruling-0@users.noreply.github.com>
2026-02-05 18:50:27 +01:00
YoshyandRuling-0 e0a0b1ec53 fix typos (#120)
Co-authored-by: Ruling-0 <47913168+Ruling-0@users.noreply.github.com>
2026-01-29 21:14:14 +01:00
Martin Robertz d42076af69 update 2026-01-10 00:37:38 +01:00
ALongStringOfNumbers 610dad28b7 Fix crash when no IC2 is installed (#119) 2026-01-08 23:26:55 -06:00
Martin Robertz eb767ebeaa update bs+deps+gradle 2026-01-05 20:40:32 +01:00
ALongStringOfNumbers 1516aa495e Allow more explosion sources to generate mana via Entropinnyum (#117) 2026-01-05 19:07:43 +01:00
Nikolay S. bba06bcf46 Great Renaming 3 - Misc. (#110) 2025-11-17 10:33:05 +01:00
Martin Robertz d407ca2c31 update 2025-11-04 22:59:19 +01:00
koolkrafter5andNikolay S. c0daedcbd8 Backport modern Rosa Arcana behavior (#109)
Co-authored-by: Nikolay S. <nicksitnikov@gmail.com>
2025-11-03 17:03:15 -06:00
Martin Robertz 4ee06de9f0 update 2025-10-09 08:27:38 +02:00
Nikolay S. 506f2200ef Great Renaming, Part 2 - Items (#107) 2025-10-09 07:55:24 +02:00
Martin Robertz 98860ee317 pdate 2025-10-01 21:52:34 +02:00
Nikolay S.andglowredman 5ca552ce88 Great Renaming, Part 1 - Blocks & deobfParams (#106)
Co-authored-by: glowredman <35727266+glowredman@users.noreply.github.com>
2025-10-01 21:46:12 +02:00
Martin Robertz db1ad3a768 update 2025-10-01 17:29:01 +02:00
koolkrafter5 c047644908 Merge #104 to master (#105) 2025-09-29 20:17:26 +02:00
DarkShadow44andMartin Robertz 33be87e896 Fix reach ring (#95)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
2025-09-28 11:59:11 +00:00
Nikolay S.andMartin Robertz 7c42710a1a Activate Generic Injection (#100)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
2025-09-28 13:54:57 +02:00
Martin Robertz e4b5b2c2ff update 2025-09-26 17:50:27 +02:00
ABKQPOandghostflyby 8350bd9dc7 Modify line-breaking method for rendering fonts in PageText (#101)
Co-authored-by: ghostflyby <ghostflyby+git@outlook.com>
2025-09-26 20:09:24 +08:00
Martin Robertz 5dc4882038 update 2025-09-07 19:41:11 +02:00
koolkrafter5 9404223f53 Revert "Prevent overenchanting (#98)" (#99) 2025-09-07 05:19:10 -04:00
Caedis 9157df8e3b Prevent overenchanting (#98) 2025-09-06 12:59:34 -04:00
Martin Robertz 143b8286d8 update 2025-09-03 16:57:01 +02:00
sisyphussy 825758d639 Add Botania Multiblocks to StructureLib (#93) 2025-09-03 15:09:02 +02:00
Martin Robertz f4f7485a12 update 2025-08-28 09:22:54 +02:00
LewisSaber a0d7b4dde8 fix unbreaking not affecting instant repair (#94) 2025-08-27 15:44:43 +02:00
Matthew Bentham d3f4b99d23 Fix WAILA not displaying quartz pillar block name when placed on its side (#97) 2025-08-22 04:07:24 -05:00
boubou19andAlexdoru 96521a399b Restore methods so other addons work again (#92)
Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com>
2025-07-22 15:22:13 +00:00
koolkrafter5 c5ceef1a78 Improve Null Checking for Petal Apothecary (#91) 2025-07-20 19:40:03 +02:00
boubou19andAlexdoru c72988e435 Faster load (#89)
Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com>
2025-07-17 05:10:15 +02:00
koolkrafter5 26a8bd6a26 Fix achievement text typo (#88) 2025-07-13 05:36:01 +02:00
Martin Robertz 23e4f6760d update 2025-06-08 11:55:28 +02:00
Nikolay S. 72da2272d1 Fix the rest of the lang file mistakes in Botania (#84) 2025-06-06 20:57:18 +00:00
Nikolay S. 36deb60855 Add missing equals sign (#83) 2025-06-06 20:31:18 +00:00
Maya c387a30be8 update 2025-05-25 19:38:30 -06:00
brandynandMaya bcf96ed130 Add configurable F3 Debug (#78)
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
2025-05-25 19:38:18 -06:00
Martin Robertz 7b767d52c5 update 2025-05-16 18:32:31 +02:00
Caedis e812d33caf Replace Baubles with Baubles Expanded (#81) 2025-05-13 19:09:33 -05:00
Martin Robertz a0ba2f2d6a update 2025-03-04 10:08:44 +01:00
miozune 10f4e05d37 Update build (#76) 2025-03-02 15:54:17 +00:00
Dream Master 2b586edcf2 update 2025-01-15 12:01:33 +01:00
Shadow1590Shadow1590Maya
36dfeea862 Reach ring rewrite (#67)
Co-authored-by: Shadow1590 <>
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
2025-01-14 23:50:10 -06:00
glowredmanandMartin Robertz e8fb04df37 Small Cleanup (#68)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
2025-01-13 00:13:56 -06:00
Martin Robertz f5a21fe41e update 2024-12-27 10:06:52 +01:00
5b81cbe85e backported item filter for Rannuncarpus (#60)
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
2024-12-26 22:29:04 -06:00
1595 changed files with 5317 additions and 4427 deletions

No files matched your search

-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env bash
RUNDIR="run"
CRASH="crash-reports"
SERVERLOG="server.log"
if [[ -d $RUNDIR/$CRASH ]]; then
echo "Crash reports detected:"
cat $RUNDIR/$CRASH/crash*.txt
exit 1
fi
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
echo "Fatal errors detected:"
cat server.log
exit 1
fi
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
echo "Server force stopped:"
cat server.log
exit 1
fi
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
echo "Server didn't finish startup:"
cat server.log
exit 1
fi
echo "No crash reports detected"
exit 0
+17
View File
@@ -0,0 +1,17 @@
name: Optimize images
on:
pull_request:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
push:
branches: [ master, main, release/** ]
paths:
- "**/*.png"
jobs:
optimize-images:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
secrets: inherit
+7 -1
View File
@@ -26,7 +26,13 @@ whitelist.json
*.iml
*.ipr
*.iws
src/main/resources/mixins.*.json
src/main/resources/mixins.*([!.]).json
*.bat
*.DS_Store
!gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
+12 -11
View File
@@ -1,19 +1,20 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:Baubles:1.0.4:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly('com.github.GTNewHorizons:Railcraft:9.15.15:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.0.5-GTNH:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.5.0:dev') {transitive=false}
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api') {transitive=false}
api('com.github.GTNewHorizons:GTNHLib:0.6.0:dev')
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.9-GTNH:dev')
api('com.github.GTNewHorizons:GTNHLib:0.9.36:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.55:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.2:dev') {transitive=false}
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.73-GTNH:dev')
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.23:api') {transitive=false}
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.16-GTNH:api') {transitive=false}
compileOnly('curse.maven:cofh-lib-220333:2388748')
compileOnly('curse.maven:minefactory-reloaded-66672:2366150')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.4-GTNH:dev')
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
compileOnly("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.32:dev")
}
+43 -17
View File
@@ -14,7 +14,7 @@ modId = Botania
modGroup = vazkii.botania
# 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.
# When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
@@ -39,13 +39,37 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# 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 modern Java syntax support. Valid values:
# - false: No modern syntax, Java 8 only
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = jabel
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
# forceToolchainVersion = -1
# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25
# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =
# 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
enableGenericInjection = true
# 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.
@@ -55,22 +79,13 @@ generateGradleTokenClass = vazkii.botania.common.Tags
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile =
# replaceGradleTokenInFile =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
@@ -96,7 +111,9 @@ 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!
# Specify the package that contains all of your Mixins. The package must exist or
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
# it must match with this or the build will fail.
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
@@ -151,7 +168,7 @@ modrinthProjectId =
# 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
# Note: UniMixins 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.
@@ -172,6 +189,12 @@ curseForgeRelations =
# projects. New projects should not use this parameter.
# customArchiveBaseName =
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
# runClientWorkingDirectory = run/client
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
# runServerWorkingDirectory = run/server
# 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.
@@ -201,3 +224,6 @@ disableSpotless = true
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
+12
View File
@@ -0,0 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect
toolchainVersion=25
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+4 -8
View File
@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -115,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -173,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -206,15 +203,14 @@ fi
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,
# * DEFAULT_JVM_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" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
Vendored
+1 -2
View File
@@ -70,11 +70,10 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
-20
View File
@@ -1,22 +1,2 @@
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'https://maven.ic2.player.to/'
url 'https://maven2.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
}
maven {
url 'https://jitpack.io'
}
}
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.23'
}
@@ -60,37 +60,37 @@ import cpw.mods.fml.common.Loader;
public final class BotaniaAPI {
private static List<LexiconCategory> categories = new ArrayList<LexiconCategory>();
private static List<LexiconEntry> allEntries = new ArrayList<LexiconEntry>();
private static final List<LexiconCategory> categories = new ArrayList<>();
private static final List<LexiconEntry> allEntries = new ArrayList<>();
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<String, KnowledgeType>();
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<>();
public static Map<String, Brew> brewMap = new LinkedHashMap<String, Brew>();
public static Map<String, Brew> brewMap = new LinkedHashMap<>();
public static List<String> disposableBlocks = new ArrayList<String>();
public static List<String> semiDisposableBlocks = new ArrayList<String>();
public static List<String> disposableBlocks = new ArrayList<>();
public static List<String> semiDisposableBlocks = new ArrayList<>();
public static List<RecipePetals> petalRecipes = new ArrayList<RecipePetals>();
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<RecipePureDaisy>();
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<RecipeManaInfusion>();
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<RecipeRuneAltar>();
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<RecipeElvenTrade>();
public static List<RecipeBrew> brewRecipes = new ArrayList<RecipeBrew>();
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<RecipeManaInfusion>();
public static List<RecipePetals> petalRecipes = new ArrayList<>();
public static List<RecipePureDaisy> pureDaisyRecipes = new ArrayList<>();
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<>();
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<>();
public static List<RecipeElvenTrade> elvenTradeRecipes = new ArrayList<>();
public static List<RecipeBrew> brewRecipes = new ArrayList<>();
public static List<RecipeManaInfusion> miniFlowerRecipes = new ArrayList<>();
private static BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.<String, Class<? extends SubTileEntity>> create();
private static Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<Class<? extends SubTileEntity>, SubTileSignature>();
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet();
public static Map<String, String> subTileMods = new HashMap<String, String>();
public static BiMap<String, String> miniFlowers = HashBiMap.<String, String> create();
private static final BiMap<String, Class<? extends SubTileEntity>> subTiles = HashBiMap.create();
private static final Map<Class<? extends SubTileEntity>, SubTileSignature> subTileSignatures = new HashMap<>();
public static Set<String> subtilesForCreativeMenu = new LinkedHashSet<>();
public static Map<String, String> subTileMods = new HashMap<>();
public static BiMap<String, String> miniFlowers = HashBiMap.create();
public static Map<String, Integer> oreWeights = new HashMap<String, Integer>();
public static Map<String, Integer> oreWeightsNether = new HashMap<String, Integer>();
public static Map<Item, Block> seeds = new HashMap();
public static Set<Item> looniumBlacklist = new LinkedHashSet<Item>();
public static Set<Block> paintableBlocks = new LinkedHashSet<Block>();
public static Set<String> magnetBlacklist = new LinkedHashSet<String>();
public static Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<Class<? extends Entity>>();
public static Map<String, Integer> oreWeights = new HashMap<>();
public static Map<String, Integer> oreWeightsNether = new HashMap<>();
public static Map<Item, Block> seeds = new HashMap<>();
public static Set<Item> looniumBlacklist = new LinkedHashSet<>();
public static Set<Block> paintableBlocks = new LinkedHashSet<>();
public static Set<String> magnetBlacklist = new LinkedHashSet<>();
public static Set<Class<? extends Entity>> gravityRodBlacklist = new LinkedHashSet<>();
public static ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", 16, new int[] { 2, 6, 5, 2 }, 18);
public static ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
@@ -108,7 +108,7 @@ public final class BotaniaAPI {
public static KnowledgeType basicKnowledge;
public static KnowledgeType elvenKnowledge;
// This is here for completeness sake, but you shouldn't use it
// This is here for completeness’s sake, but you shouldn't use it
public static KnowledgeType relicKnowledge;
// All of these categories are initialized during botania's PreInit stage.
@@ -290,14 +290,14 @@ public final class BotaniaAPI {
return fallbackBrew;
}
/*
/**
* Registers a Block as disposable using its Ore Dictionary Name.
*/
public static void registerDisposableBlock(String oreDictName) {
disposableBlocks.add(oreDictName);
}
/*
/**
* Registers a Block as semi disposable using its Ore Dictionary Name.
* This means it will not be trashed when sneaking.
*/
@@ -313,19 +313,19 @@ public final class BotaniaAPI {
return paintable;
}
/*
/**
* Blacklists an Entity from being affected by the Rod of the Shaded Mesa.
* Pass in the class for the Entity, e.g. EntityCow.class
*/
public static void blacklistEntityFromGravityRod(Class entity) {
public static void blacklistEntityFromGravityRod(Class<? extends Entity> entity) {
gravityRodBlacklist.add(entity);
}
/*
/**
* Checks if the provided Entity is contained in the Blacklist.
* Pass in the class for the Entity, e.g. entity.getClass()
*/
public static boolean isEntityBlacklistedFromGravityRod(Class entity) {
public static boolean isEntityBlacklistedFromGravityRod(Class<? extends Entity> entity) {
return gravityRodBlacklist.contains(entity);
}
@@ -476,7 +476,7 @@ public final class BotaniaAPI {
/**
* Registers a Brew Recipe (for the Botanical Brewery).
* @param brew The brew in to be set in this recipe.
* @inputs The items used in the recipe, no more than 6.
* @param inputs The items used in the recipe, no more than 6.
*/
public static RecipeBrew registerBrewRecipe(Brew brew, Object... inputs) {
RecipeBrew recipe = new RecipeBrew(brew, inputs);
@@ -592,7 +592,7 @@ public final class BotaniaAPI {
* https://gist.github.com/Vazkii/9493322
*/
public static void addOreWeightNether(String ore, int weight) {
if(ore.contains("Nether") && OreDictionary.getOres(ore.replace("Nether", "")).size() == 0)
if(ore.contains("Nether") && OreDictionary.getOres(ore.replace("Nether", "")).isEmpty())
return;
oreWeightsNether.put(ore, weight);
@@ -634,7 +634,7 @@ public final class BotaniaAPI {
*/
public static List<IRecipe> getLatestAddedRecipes(int x) {
List<IRecipe> list = CraftingManager.getInstance().getRecipeList();
List<IRecipe> newList = new ArrayList();
List<IRecipe> newList = new ArrayList<>();
for(int i = x - 1; i >= 0; i--)
newList.add(list.get(list.size() - 1 - i));
@@ -42,7 +42,7 @@ public class Brew {
this.name = name;
this.color = color;
this.cost = cost;
this.effects = new ArrayList(Arrays.asList(effects));
this.effects = new ArrayList<>(Arrays.asList(effects));
}
/**
@@ -29,9 +29,9 @@ import vazkii.botania.api.BotaniaAPI;
public final class CorporeaHelper {
private static final List<IInventory> empty = Collections.unmodifiableList(new ArrayList());
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap();
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<ICorporeaAutoCompleteController>();
private static final List<IInventory> empty = Collections.unmodifiableList(new ArrayList<>());
private static final WeakHashMap<List<ICorporeaSpark>, List<IInventory>> cachedNetworks = new WeakHashMap<>();
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<>();
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
@@ -64,7 +64,7 @@ public final class CorporeaHelper {
return cache;
}
List<IInventory> inventories = new ArrayList();
List<IInventory> inventories = new ArrayList<>();
if(network != null)
for(ICorporeaSpark otherSpark : network)
if(otherSpark != null) {
@@ -125,7 +125,7 @@ public final class CorporeaHelper {
* called instead if the context for this exists to avoid having to get the value again.
*/
public static Map<IInventory, Integer> getInventoriesWithItemInNetwork(ItemStack stack,List<IInventory> inventories, boolean checkNBT) {
Map<IInventory, Integer> countMap = new HashMap<IInventory, Integer>();
Map<IInventory, Integer> countMap = new HashMap<>();
List<IWrappedInventory> wrappedInventories = BotaniaAPI.internalHandler.wrapInventory(inventories);
for (IWrappedInventory inv : wrappedInventories) {
CorporeaRequest request = new CorporeaRequest(stack, checkNBT, -1);
@@ -166,14 +166,14 @@ public final class CorporeaHelper {
* purposes of counting huge amounts.
*/
public static List<ItemStack> requestItem(Object matcher, int itemCount, ICorporeaSpark spark, boolean checkNBT, boolean doit) {
List<ItemStack> stacks = new ArrayList<ItemStack>();
List<ItemStack> stacks = new ArrayList<>();
CorporeaRequestEvent event = new CorporeaRequestEvent(matcher, itemCount, spark, checkNBT, doit);
if(MinecraftForge.EVENT_BUS.post(event))
return stacks;
List<IInventory> inventories = getInventoriesOnNetwork(spark);
List<IWrappedInventory> inventoriesW = BotaniaAPI.internalHandler.wrapInventory(inventories);
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<ICorporeaInterceptor, ICorporeaSpark>();
Map<ICorporeaInterceptor, ICorporeaSpark> interceptors = new HashMap<>();
CorporeaRequest request = new CorporeaRequest(matcher, checkNBT, itemCount);
for(IWrappedInventory inv : inventoriesW) {
@@ -39,12 +39,12 @@ public class DummyManaNetwork implements IManaNetwork {
@Override
public List<TileSignature> getAllCollectorsInWorld(World world) {
return new ArrayList();
return new ArrayList<>();
}
@Override
public List<TileSignature> getAllPoolsInWorld(World world) {
return new ArrayList();
return new ArrayList<>();
}
}
@@ -20,7 +20,7 @@ public final class VanillaPacketDispatcher {
public static void dispatchTEToNearbyPlayers(TileEntity tile) {
World world = tile.getWorldObj();
List players = world.playerEntities;
List<?> players = world.playerEntities;
for(Object player : players)
if(player instanceof EntityPlayerMP) {
EntityPlayerMP mp = (EntityPlayerMP) player;
@@ -20,7 +20,7 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
private static int count = 0;
public final String unlocalizedName;
public final List<LexiconEntry> entries = new ArrayList<LexiconEntry>();
public final List<LexiconEntry> entries = new ArrayList<>();
private final int sortingId;
private ResourceLocation icon;
private int priority = 5;
@@ -27,11 +27,11 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
private KnowledgeType type = BotaniaAPI.basicKnowledge;
public List<LexiconPage> pages = new ArrayList<LexiconPage>();
public List<LexiconPage> pages = new ArrayList<>();
private boolean priority = false;
private ItemStack icon = null;
private List<ItemStack> extraDisplayedRecipes = new ArrayList();
private List<ItemStack> extraDisplayedRecipes = new ArrayList<>();
/**
* @param unlocalizedName The unlocalized name of this entry. This will be localized by the client display.
@@ -126,12 +126,12 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
}
public List<ItemStack> getDisplayedRecipes() {
ArrayList<ItemStack> list = new ArrayList();
ArrayList<ItemStack> list = new ArrayList<>();
for(LexiconPage page : pages) {
List<ItemStack> l = page.getDisplayedRecipes();
if(l != null) {
ArrayList<ItemStack> itemsAddedThisPage = new ArrayList();
ArrayList<ItemStack> itemsAddedThisPage = new ArrayList<>();
for(ItemStack s : l) {
addItem: {
@@ -23,7 +23,7 @@ import vazkii.botania.api.mana.IManaItem;
*/
public final class LexiconRecipeMappings {
private static Map<String, EntryData> mappings = new HashMap();
private static Map<String, EntryData> mappings = new HashMap<>();
/**
* Maps the given stack to the given page of the entry.
@@ -23,7 +23,7 @@ import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
*/
public interface IMultiblockRenderHook {
public static Map<Block, IMultiblockRenderHook> renderHooks = new HashMap();
public static Map<Block, IMultiblockRenderHook> renderHooks = new HashMap<>();
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks, MultiblockComponent comp, float alpha);
@@ -15,10 +15,15 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import cpw.mods.fml.common.FMLLog;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import org.apache.logging.log4j.Level;
import vazkii.botania.api.lexicon.multiblock.compat.MultiblockCompatRegistry;
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
import vazkii.botania.common.Botania;
/**
* This class describes a Mutiblock object. It's used to display a
@@ -27,22 +32,26 @@ import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
*/
public class Multiblock {
public List<MultiblockComponent> components = new ArrayList();
public List<ItemStack> materials = new ArrayList();
public List<MultiblockComponent> components = new ArrayList<>();
public List<ItemStack> materials = new ArrayList<>();
public int minX, minY, minZ, maxX, maxY, maxZ, offX, offY, offZ;
public HashMap<List<Integer>, MultiblockComponent> locationCache = new HashMap<List<Integer>, MultiblockComponent>();
public HashMap<List<Integer>, MultiblockComponent> locationCache = new HashMap<>();
/**
* Adds a multiblock component to this multiblock. The component's x y z
* coords should be pivoted to the center of the structure.
*/
public void addComponent(MultiblockComponent component) {
if(getComponentForLocation(component.relPos.posX, component.relPos.posY, component.relPos.posZ) != null)
throw new IllegalArgumentException("Location in multiblock already occupied");
ChunkCoordinates pos = component.relPos;
if(getComponentForLocation(pos.posX, pos.posY, pos.posZ) != null) {
MultiblockComponent comp = getComponentForLocation(pos.posX, pos.posY, pos.posZ);
throw new IllegalArgumentException(
"Location in multiblock {x=" + pos.posX + " y=" + pos.posY + " z=" + pos.posZ + "} already occupied by block " + comp.getBlock().getLocalizedName());
}
components.add(component);
changeAxisForNewComponent(component.relPos.posX, component.relPos.posY, component.relPos.posZ);
changeAxisForNewComponent(pos.posX, pos.posY, pos.posZ);
calculateCostForNewComponent(component);
addComponentToLocationCache(component);
}
@@ -138,6 +147,28 @@ public class Multiblock {
return blocks;
}
public <T extends TileEntity> MultiblockSet makeSetRegisterStructure(
Class<T> controllerTileClass, Block controllerBlock, MultiblockComponent... extra
) {
registerStructure(controllerTileClass, controllerBlock, extra);
return makeSet();
}
public <T extends TileEntity> void registerStructure(
Class<T> controllerTileClass, Block controllerBlock, MultiblockComponent... extra
) {
if (Botania.structureLibLoaded) {
try {
MultiblockCompatRegistry.registerMultiblock(
this, controllerTileClass, controllerBlock, extra
);
} catch (Exception e) {
e.printStackTrace();
FMLLog.log(Level.ERROR, "Failed to load a Botania Multiblock into StructureLib.");
}
}
}
/**
* Makes a MultiblockSet from this Multiblock and its rotations using
* createRotations().
@@ -176,7 +207,7 @@ public class Multiblock {
pos.posX,
pos.posY,
pos.posZ
), comp);
), comp);
}
/**
@@ -0,0 +1,228 @@
package vazkii.botania.api.lexicon.multiblock.compat;
import com.gtnewhorizon.structurelib.alignment.constructable.IMultiblockInfoContainer;
import com.gtnewhorizon.structurelib.alignment.enumerable.ExtendedFacing;
import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment;
import com.gtnewhorizon.structurelib.structure.StructureDefinition;
import com.gtnewhorizon.structurelib.structure.StructureUtility;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import vazkii.botania.api.lexicon.multiblock.Multiblock;
import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Only gets loaded if StructureLib is present inside the Modpack
*/
public class MultiblockCompatRegistry {
public static <T extends TileEntity> void registerMultiblock(
Multiblock mb, Class<T> controllerTileClass,
Block controllerBlock,
MultiblockComponent... extra
) {
List<MultiblockComponent> components = mb.getComponents();
if (extra.length != 0) {
components = new ArrayList<>(components);
Collections.addAll(components, extra);
}
Map<Integer, RawStructureData> structureDataMap = new HashMap<>();
int min_x = Integer.MAX_VALUE, max_x = Integer.MIN_VALUE;
int min_y = Integer.MAX_VALUE, max_y = Integer.MIN_VALUE;
int min_z = Integer.MAX_VALUE, max_z = Integer.MIN_VALUE;
char ch = 'a';
for (MultiblockComponent component : components) {
int hash = getHash(component.getBlock(), component.getMeta());
ChunkCoordinates pos = component.getRelativePosition();
RawStructureData structureData = structureDataMap.get(hash);
if (structureData == null) {
List<ChunkCoordinates> coordinates = new ArrayList<>();
structureData = new RawStructureData(
coordinates,
component.getBlock(),
component.getMeta(),
ch++
);
structureDataMap.put(hash, structureData);
}
structureData.getPositions().add(pos);
min_x = Math.min(min_x, pos.posX); max_x = Math.max(max_x, pos.posX);
min_y = Math.min(min_y, pos.posY); max_y = Math.max(max_y, pos.posY);
min_z = Math.min(min_z, pos.posZ); max_z = Math.max(max_z, pos.posZ);
}
int x_size = max_x - min_x + 1;
int y_size = max_y - min_y + 1;
int z_size = max_z - min_z + 1;
//Data is saved in [z][y][x] format
String[][] stringData = new String[z_size][y_size];
char[] buffer = new char[x_size];
Arrays.fill(buffer, ' ');
//Since Strings and their content are immutable, this is fine.
String filledWithSpaces = new String(buffer);
for (int z = 0; z < z_size; z++) {
for (int y = 0; y < y_size; y++) {
stringData[z][y] = filledWithSpaces;
}
}
int controller_x = 0, controller_y = 0, controller_z = 0;
StringBuilder builder = new StringBuilder(x_size);
for (RawStructureData data : structureDataMap.values()) {
for (ChunkCoordinates pos : data.getPositions()) {
int x = pos.posX - min_x;
int z = pos.posZ - min_z;
//Data has to get flipped
int y = (stringData[z].length - 1) - (pos.posY - min_y);
if (data.getBlock() == controllerBlock) {
controller_x = x;
controller_y = y;
controller_z = z;
}
String s = stringData[z][y];
builder.append(s);
builder.setCharAt(x, data.getBlockIdentifier());
stringData[z][y] = builder.toString();
builder.setLength(0);
}
}
StructureDefinition.Builder<? super T> structureBuilder = IStructureDefinition.builder()
.addShape("main", stringData);
for (RawStructureData data : structureDataMap.values()) {
structureBuilder.addElement(
data.getBlockIdentifier(),
StructureUtility.ofBlock(
data.getBlock(),
data.getMetadata()
)
);
}
IMultiblockInfoContainer.registerTileClass(
controllerTileClass,
new BotaniaMultiblockInfoContainer<>(
structureBuilder.build(),
controller_x,
controller_y,
controller_z
)
);
}
private static int getHash(Block block, int metadata) {
return block.hashCode() * 31 + metadata;
}
private static class BotaniaMultiblockInfoContainer<T extends TileEntity> implements IMultiblockInfoContainer<T> {
private final IStructureDefinition<? super T> structure;
private final int x_offset, y_offset, z_offset;
public BotaniaMultiblockInfoContainer(
IStructureDefinition<? super T> structure,
int x_offset, int y_offset, int z_offset
) {
this.structure = structure;
this.x_offset = x_offset;
this.y_offset = y_offset;
this.z_offset = z_offset;
}
@Override
public void construct(ItemStack stackSize, boolean hintsOnly, T tileEntity, ExtendedFacing aSide) {
structure.buildOrHints(
tileEntity,
stackSize,
"main",
tileEntity.getWorldObj(),
noSideWay(aSide),
tileEntity.xCoord,
tileEntity.yCoord,
tileEntity.zCoord,
x_offset,
y_offset,
z_offset,
hintsOnly
);
}
@Override
public int survivalConstruct(ItemStack stackSize, int elementBudge, ISurvivalBuildEnvironment env, T tileEntity, ExtendedFacing aSide) {
return structure.survivalBuild(
tileEntity,
stackSize,
"main",
tileEntity.getWorldObj(),
noSideWay(aSide),
tileEntity.xCoord,
tileEntity.yCoord,
tileEntity.zCoord,
x_offset,
y_offset,
z_offset,
elementBudge,
env,
false
);
}
@Override
public String[] getDescription(ItemStack stackSize) {
return new String[0];
}
private static ExtendedFacing noSideWay(ExtendedFacing aSide) {
return aSide.getDirection().offsetY != 0 ? ExtendedFacing.DEFAULT : aSide.getOppositeDirection();
}
}
private static class RawStructureData {
private final List<ChunkCoordinates> positions;
private final char identifier;
private final Block block;
private final int metadata;
public RawStructureData(List<ChunkCoordinates> positions, Block block, int metadata, char identifier) {
this.positions = positions;
this.identifier = identifier;
this.block = block;
this.metadata = metadata;
}
public Block getBlock() {
return block;
}
public int getMetadata() {
return metadata;
}
public List<ChunkCoordinates> getPositions() {
return positions;
}
public char getBlockIdentifier() {
return identifier;
}
}
}
@@ -39,7 +39,7 @@ public class MultiblockComponent {
}
public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, TileEntity tileEntity) {
this(relPos, block, meta, block.hasTileEntity() == (tileEntity != null), tileEntity);
this(relPos, block, meta, block.hasTileEntity(0) == (tileEntity != null), tileEntity);
}
public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta, boolean doFancyRender, TileEntity tileEntity) {
@@ -0,0 +1,38 @@
package vazkii.botania.api.mana;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
public interface ITieredManaTooltipDisplay extends IManaTooltipDisplay {
/**
* Returns the text to use for the top-left side of the mana bar
* @param stack the item being rendered
*/
@SideOnly(Side.CLIENT)
@Nonnull
String getLeftManaLabel(@Nonnull ItemStack stack);
/**
* Returns the text to use for the top-right side of the mana bar
* @param stack the item being rendered
*/
@SideOnly(Side.CLIENT)
@Nonnull
String getRightManaLabel(@Nonnull ItemStack stack);
/**
* Should the mana bar use the rainbow effect
* @param stack the item being rendered
*/
@SideOnly(Side.CLIENT)
boolean isRainbowEffect(@Nonnull ItemStack stack);
/**
* Indicate the mana level boundaries for this item.
*/
@Nonnull
int[] getManaTiers(@Nonnull ItemStack stack);
}
@@ -23,10 +23,9 @@ public final class SparkHelper {
return SparkHelper.getEntitiesAround(ISparkEntity.class, world, x, y, z);
}
public static <T> List<T> getEntitiesAround(Class<? extends T> clazz, World world, double x, double y, double z) {
public static <T> List<T> getEntitiesAround(Class<T> clazz, World world, double x, double y, double z) {
int r = SPARK_SCAN_RANGE;
List<T> entities = world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r));
return entities;
return world.getEntitiesWithinAABB(clazz, AxisAlignedBB.getBoundingBox(x - r, y - r, z - r, x + r, y + r, z + r));
}
}
@@ -28,7 +28,7 @@ public class RecipeBrew {
public RecipeBrew(Brew brew, Object... inputs) {
this.brew = brew;
List<Object> inputsToSet = new ArrayList();
List<Object> inputsToSet = new ArrayList<>();
for(Object obj : inputs) {
if(obj instanceof String || obj instanceof ItemStack)
inputsToSet.add(obj);
@@ -39,7 +39,7 @@ public class RecipeBrew {
}
public boolean matches(IInventory inv) {
List<Object> inputsMissing = new ArrayList(inputs);
List<Object> inputsMissing = new ArrayList<>(inputs);
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
@@ -92,7 +92,7 @@ public class RecipeBrew {
}
public List<Object> getInputs() {
return new ArrayList(inputs);
return new ArrayList<>(inputs);
}
public Brew getBrew() {
@@ -14,7 +14,7 @@ public class RecipeElvenTrade {
public RecipeElvenTrade(ItemStack output, Object... inputs) {
this.output = output;
List<Object> inputsToSet = new ArrayList();
List<Object> inputsToSet = new ArrayList<>();
for(Object obj : inputs) {
if(obj instanceof String || obj instanceof ItemStack)
inputsToSet.add(obj);
@@ -25,8 +25,8 @@ public class RecipeElvenTrade {
}
public boolean matches(List<ItemStack> stacks, boolean remove) {
List<Object> inputsMissing = new ArrayList(inputs);
List<ItemStack> stacksToRemove = new ArrayList();
List<Object> inputsMissing = new ArrayList<>(inputs);
List<ItemStack> stacksToRemove = new ArrayList<>();
for(ItemStack stack : stacks) {
if(stack == null) {
@@ -80,7 +80,7 @@ public class RecipeElvenTrade {
}
public List<Object> getInputs() {
return new ArrayList(inputs);
return new ArrayList<>(inputs);
}
public ItemStack getOutput() {
@@ -25,7 +25,7 @@ public class RecipePetals {
public RecipePetals(ItemStack output, Object... inputs) {
this.output = output;
List<Object> inputsToSet = new ArrayList();
List<Object> inputsToSet = new ArrayList<>();
for(Object obj : inputs) {
if(obj instanceof String || obj instanceof ItemStack)
inputsToSet.add(obj);
@@ -36,7 +36,7 @@ public class RecipePetals {
}
public boolean matches(IInventory inv) {
List<Object> inputsMissing = new ArrayList(inputs);
List<Object> inputsMissing = new ArrayList<>(inputs);
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stack = inv.getStackInSlot(i);
@@ -86,7 +86,7 @@ public class RecipePetals {
}
public List<Object> getInputs() {
return new ArrayList(inputs);
return new ArrayList<>(inputs);
}
public ItemStack getOutput() {
@@ -21,7 +21,7 @@ public class WikiHooks {
private static final IWikiProvider FALLBACK_PROVIDER = new SimpleWikiProvider("FTB Wiki", "http://ftb.gamepedia.com/%s");
private static final Map<String, IWikiProvider> modWikis = new HashMap();
private static final Map<String, IWikiProvider> modWikis = new HashMap<>();
public static IWikiProvider getWikiFor(Block block) {
UniqueIdentifier mod = GameRegistry.findUniqueIdentifierFor(block);
@@ -25,12 +25,12 @@ import vazkii.botania.common.lib.LibBlockNames;
public final class ModChallenges {
public static final EnumMap<EnumChallengeLevel, List<Challenge>> challenges = new EnumMap(EnumChallengeLevel.class);
public static final HashMap<String, Challenge> challengeLookup = new HashMap();
public static final EnumMap<EnumChallengeLevel, List<Challenge>> challenges = new EnumMap<>(EnumChallengeLevel.class);
public static final HashMap<String, Challenge> challengeLookup = new HashMap<>();
public static void init() {
for(EnumChallengeLevel level : EnumChallengeLevel.class.getEnumConstants())
challenges.put(level, new ArrayList());
challenges.put(level, new ArrayList<>());
addChallenge(EnumChallengeLevel.EASY, "flowerFarm", new ItemStack(ModBlocks.flower, 1, 6));
addChallenge(EnumChallengeLevel.EASY, "recordFarm", new ItemStack(Items.record_13));
@@ -78,7 +78,7 @@ public class ClientTickHandler {
if(player != null) {
ItemStack stack = player.getCurrentEquippedItem();
if(stack != null && stack.getItem() instanceof ItemTwigWand) {
List<TileSignature> list = new ArrayList(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld));
List<TileSignature> list = new ArrayList<>(ManaNetworkHandler.instance.getAllCollectorsInWorld(Minecraft.getMinecraft().theWorld));
for(TileSignature sig : list) {
if(!sig.remoteWorld)
continue;
@@ -68,7 +68,7 @@ public final class ContributorFancinessHandler {
}
public static void load(Properties props) {
flowerMap = new HashMap();
flowerMap = new HashMap<>();
for(String key : props.stringPropertyNames()) {
String value = props.getProperty(key);
@@ -39,10 +39,10 @@ public class CorporeaAutoCompleteHandler {
boolean isAutoCompleted = false;
String originalString = "";
List<CompletionData> completions = new ArrayList<CompletionData>();
List<CompletionData> completions = new ArrayList<>();
int position;
static TreeSet<String> itemNames = new TreeSet<String>(
static TreeSet<String> itemNames = new TreeSet<>(
new Comparator<String>() {
@Override
public int compare(String arg0, String arg1) {
@@ -55,7 +55,7 @@ public class CorporeaAutoCompleteHandler {
public static void updateItemList() {
itemNames.clear();
Iterator<Item> iterator = Item.itemRegistry.iterator();
ArrayList<ItemStack> curList = new ArrayList<ItemStack>();
ArrayList<ItemStack> curList = new ArrayList<>();
while(iterator.hasNext()) {
Item item = iterator.next();
@@ -144,9 +144,9 @@ public class CorporeaAutoCompleteHandler {
private ArrayList<CompletionData> getNames(String prefix) {
String s = prefix.trim();
if(s.isEmpty())
return new ArrayList();
return new ArrayList<>();
TreeSet<CompletionData> result = new TreeSet<CompletionData>();
TreeSet<CompletionData> result = new TreeSet<>();
String[] words = s.split(" ");
int i = words.length - 1;
String curPrefix = words[i];
@@ -156,11 +156,11 @@ public class CorporeaAutoCompleteHandler {
if(i >= 0)
curPrefix = words[i] + " " + curPrefix;
}
return new ArrayList<CompletionData>(result);
return new ArrayList<>(result);
}
private List<CompletionData> getNamesStartingWith(String prefix) {
ArrayList<CompletionData> result = new ArrayList<CompletionData>();
ArrayList<CompletionData> result = new ArrayList<>();
int length = prefix.length();
SortedSet<String> after = itemNames.tailSet(prefix);
for(String str : after) {
@@ -35,7 +35,7 @@ public final class DebugHandler {
@SubscribeEvent
public void onDrawDebugText(RenderGameOverlayEvent.Text event) {
World world = Minecraft.getMinecraft().theWorld;
if(Minecraft.getMinecraft().gameSettings.showDebugInfo) {
if(Minecraft.getMinecraft().gameSettings.showDebugInfo && ConfigHandler.showF3Debug) {
event.left.add(null);
String version = LibMisc.VERSION;
if(version.contains("GRADLE"))
@@ -128,7 +128,7 @@ public final class HUDHandler {
renderCrystalCubeHUD(event.resolution, (TileCorporeaCrystalCube) tile);
}
if(!TileCorporeaIndex.getInputHandler().getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) {
if(!TileCorporeaIndex.InputHandler.getNearbyIndexes(mc.thePlayer).isEmpty() && mc.currentScreen != null && mc.currentScreen instanceof GuiChat) {
profiler.startSection("nearIndex");
renderNearIndexDisplay(event.resolution);
profiler.endSection();
@@ -174,11 +174,11 @@ public class LightningHandler {
public static class LightningBolt {
public ArrayList<Segment> segments = new ArrayList<Segment>();
public ArrayList<Segment> segments = new ArrayList<>();
public Vector3 start;
public Vector3 end;
ChunkCoordinates target;
HashMap<Integer, Integer> splitparents = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> splitparents = new HashMap<>();
public double length;
public int numsegments0;
@@ -195,7 +195,7 @@ public class LightningHandler {
private World world;
private Entity source;
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<LightningBolt>();
public static ConcurrentLinkedQueue<LightningBolt> boltlist = new ConcurrentLinkedQueue<>();
public float speed = 1.5F;
public static final int fadetime = 20;
@@ -347,7 +347,7 @@ public class LightningHandler {
return;
ArrayList<Segment> oldsegments = segments;
segments = new ArrayList<Segment>();
segments = new ArrayList<>();
Segment prev = null;
@@ -428,7 +428,7 @@ public class LightningHandler {
}
private void calculateCollisionAndDiffs() {
HashMap<Integer, Integer> lastactivesegment = new HashMap<Integer, Integer>();
HashMap<Integer, Integer> lastactivesegment = new HashMap<>();
Collections.sort(segments, new SegmentSorter());
@@ -51,9 +51,9 @@ public class MultiblockBlockAccess implements IBlockAccess {
}
@Override
public int getLightBrightnessForSkyBlocks(int x, int y, int z, int p_72802_4_) {
public int getLightBrightnessForSkyBlocks(int x, int y, int z, int lightValue) {
if(hasBlockAccess)
return originalBlockAccess.getLightBrightnessForSkyBlocks(x,y,z,p_72802_4_);
return originalBlockAccess.getLightBrightnessForSkyBlocks(x, y, z, lightValue);
return 15728640;
}
@@ -29,7 +29,7 @@ import vazkii.botania.common.item.ModItems;
public final class RedStringRenderer {
public static final Queue<TileRedString> redStringTiles = new ArrayDeque();
public static final Queue<TileRedString> redStringTiles = new ArrayDeque<>();
static float sizeAlpha = 0F;
public static void renderAll() {
@@ -25,7 +25,6 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
@@ -34,11 +33,11 @@ import vazkii.botania.api.lexicon.ILexicon;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.api.lexicon.LexiconRecipeMappings.EntryData;
import vazkii.botania.api.mana.IManaTooltipDisplay;
import vazkii.botania.api.mana.ITieredManaTooltipDisplay;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.item.ItemLexicon;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick;
import vazkii.botania.common.lib.LibObfuscation;
import cpw.mods.fml.relauncher.ReflectionHelper;
@@ -64,7 +63,7 @@ public final class TooltipAdditionDisplayHandler {
try {
tooltip = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips);
} catch(Exception e) {
tooltip = new ArrayList();
tooltip = new ArrayList<>();
}
int width = 0;
for(String s : tooltip)
@@ -83,10 +82,10 @@ public final class TooltipAdditionDisplayHandler {
if(offscreen)
offx = -13 - width;
if(stack.getItem() instanceof ItemTerraPick)
drawTerraPick(stack, mouseX, mouseY, offx, offy, width, height, font);
else if(stack.getItem() instanceof IManaTooltipDisplay)
drawManaBar(stack, (IManaTooltipDisplay) stack.getItem(), mouseX, mouseY, offx, offy, width, height);
if(stack.getItem() instanceof ITieredManaTooltipDisplay tieredItem)
drawTieredManaBar(stack, tieredItem, mouseX, mouseY, offx, offy, width, height, font);
else if(stack.getItem() instanceof IManaTooltipDisplay manaItem)
drawManaBar(stack, manaItem, mouseX, mouseY, offx, offy, width, height);
EntryData data = LexiconRecipeMappings.getDataForStack(stack);
if(data != null) {
@@ -169,33 +168,37 @@ public final class TooltipAdditionDisplayHandler {
} else lexiconLookupTime = 0F;
}
private static void drawTerraPick(ItemStack stack, int mouseX, int mouseY, int offx, int offy, int width, int height, FontRenderer font) {
int level = ItemTerraPick.getLevel(stack);
int max = ItemTerraPick.LEVELS[Math.min(ItemTerraPick.LEVELS.length - 1, level + 1)];
boolean ss = level >= ItemTerraPick.LEVELS.length - 1;
int curr = ItemTerraPick.getMana_(stack);
float percent = level == 0 ? 0F : (float) curr / (float) max;
int rainbowWidth = Math.min(width - (ss ? 0 : 1), (int) (width * percent));
float huePer = width == 0 ? 0F : 1F / width;
float hueOff = (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.01F;
private static void drawTieredManaBar(ItemStack stack, ITieredManaTooltipDisplay item, int mouseX, int mouseY, int offx, int offy, int width, int height, FontRenderer font) {
float percent = item.getManaFractionForDisplay(stack);
int manaBarWidth = Math.min(width - (percent == 1 ? 0 : 1), (int) (width * percent));
float huePer = width == 0 ? 0F : 1F / width;
float hueOff = (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.01F;
GL11.glDisable(GL11.GL_DEPTH_TEST);
Gui.drawRect(mouseX + offx - 1, mouseY - offy - height - 1, mouseX + offx + width + 1, mouseY - offy, 0xFF000000);
for(int i = 0; i < rainbowWidth; i++)
Gui.drawRect(mouseX + offx + i, mouseY - offy - height, mouseX + offx + i + 1, mouseY - offy, Color.HSBtoRGB(hueOff + huePer * i, 1F, 1F));
Gui.drawRect(mouseX + offx + rainbowWidth, mouseY - offy - height, mouseX + offx + width, mouseY - offy, 0xFF555555);
GL11.glDisable(GL11.GL_DEPTH_TEST);
Gui.drawRect(mouseX + offx - 1, mouseY - offy - height - 1, mouseX + offx + width + 1, mouseY - offy, 0xFF000000);
if (item.isRainbowEffect(stack)) {
for (int i = 0; i < manaBarWidth; i++) {
Gui.drawRect(mouseX + offx + i, mouseY - offy - height, mouseX + offx + i + 1, mouseY - offy, Color.HSBtoRGB(hueOff + huePer * i, 1F, 1F));
}
} else {
Gui.drawRect(mouseX + offx, mouseY - offy - height, mouseX + offx + manaBarWidth, mouseY - offy, Color.HSBtoRGB(0.528F, ((float) Math.sin((ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.3F + 0.4F, 1F));
}
Gui.drawRect(mouseX + offx + manaBarWidth, mouseY - offy - height, mouseX + offx + width, mouseY - offy, 0xFF555555);
String rank = StatCollector.translateToLocal("botania.rank" + level).replaceAll("&", "\u00a7");
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_LIGHTING);
font.drawStringWithShadow(rank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF);
if(!ss) {
rank = StatCollector.translateToLocal("botania.rank" + (level + 1)).replaceAll("&", "\u00a7");
font.drawStringWithShadow(rank, mouseX + offx + width - font.getStringWidth(rank), mouseY - offy - 12, 0xFFFFFF);
}
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glPopAttrib();
}
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_LIGHTING);
String leftRank = item.getLeftManaLabel(stack).replaceAll("&", "\u00a7");
if (!leftRank.isEmpty()) {
font.drawStringWithShadow(leftRank, mouseX + offx, mouseY - offy - 12, 0xFFFFFF);
}
String rightRank = item.getRightManaLabel(stack).replaceAll("&", "\u00a7");
if (!rightRank.isEmpty()) {
font.drawStringWithShadow(rightRank, mouseX + offx + width - font.getStringWidth(rightRank), mouseY - offy - 12, 0xFFFFFF);
}
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glPopAttrib();
}
private static void drawManaBar(ItemStack stack, IManaTooltipDisplay display, int mouseX, int mouseY, int offx, int offy, int width, int height) {
float fraction = display.getManaFractionForDisplay(stack);
@@ -12,12 +12,12 @@ package vazkii.botania.client.core.helper;
public final class FontHelper {
public static boolean isFormatColor(char par0) {
return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70;
public static boolean isFormatColor(char letter) {
return letter >= 48 && letter <= 57 || letter >= 97 && letter <= 102 || letter >= 65 && letter <= 70;
}
public static boolean isFormatSpecial(char par0) {
return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82;
public static boolean isFormatSpecial(char letter) {
return letter >= 107 && letter <= 111 || letter >= 75 && letter <= 79 || letter == 114 || letter == 82;
}
public static String getFormatFromString(String par0Str) {
@@ -20,6 +20,7 @@ import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
@@ -97,15 +98,15 @@ public final class RenderHelper {
GL11.glColor4f(1F, 1F, 1F, 1F);
}
public static void drawGradientRect(int par1, int par2, float z, int par3, int par4, int par5, int par6) {
float var7 = (par5 >> 24 & 255) / 255F;
float var8 = (par5 >> 16 & 255) / 255F;
float var9 = (par5 >> 8 & 255) / 255F;
float var10 = (par5 & 255) / 255F;
float var11 = (par6 >> 24 & 255) / 255F;
float var12 = (par6 >> 16 & 255) / 255F;
float var13 = (par6 >> 8 & 255) / 255F;
float var14 = (par6 & 255) / 255F;
public static void drawGradientRect(int left, int top, float z, int right, int bottom, int topColor, int bottomColor) {
float topA = (topColor >> 24 & 255) / 255F;
float topR = (topColor >> 16 & 255) / 255F;
float topG = (topColor >> 8 & 255) / 255F;
float topB = (topColor & 255) / 255F;
float bottomA = (bottomColor >> 24 & 255) / 255F;
float bottomR = (bottomColor >> 16 & 255) / 255F;
float bottomG = (bottomColor >> 8 & 255) / 255F;
float bottomB = (bottomColor & 255) / 255F;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -113,12 +114,12 @@ public final class RenderHelper {
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator var15 = Tessellator.instance;
var15.startDrawingQuads();
var15.setColorRGBA_F(var8, var9, var10, var7);
var15.addVertex(par3, par2, z);
var15.addVertex(par1, par2, z);
var15.setColorRGBA_F(var12, var13, var14, var11);
var15.addVertex(par1, par4, z);
var15.addVertex(par3, par4, z);
var15.setColorRGBA_F(topR, topG, topB, topA);
var15.addVertex(right, top, z);
var15.addVertex(left, top, z);
var15.setColorRGBA_F(bottomR, bottomG, bottomB, bottomA);
var15.addVertex(left, bottom, z);
var15.addVertex(right, bottom, z);
var15.draw();
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
@@ -126,17 +127,17 @@ public final class RenderHelper {
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6) {
drawTexturedModalRect(par1, par2, z, par3, par4, par5, par6, 0.00390625F, 0.00390625F);
public static void drawTexturedModalRect(int x, int y, float z, int textureX, int textureY, int width, int height) {
drawTexturedModalRect(x, y, z, textureX, textureY, width, height, 0.00390625F, 0.00390625F);
}
public static void drawTexturedModalRect(int par1, int par2, float z, int par3, int par4, int par5, int par6, float f, float f1) {
public static void drawTexturedModalRect(int x, int y, float z, int textureX, int textureY, int width, int height, float f, float f1) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(par1 + 0, par2 + par6, z, (par3 + 0) * f, (par4 + par6) * f1);
tessellator.addVertexWithUV(par1 + par5, par2 + par6, z, (par3 + par5) * f, (par4 + par6) * f1);
tessellator.addVertexWithUV(par1 + par5, par2 + 0, z, (par3 + par5) * f, (par4 + 0) * f1);
tessellator.addVertexWithUV(par1 + 0, par2 + 0, z, (par3 + 0) * f, (par4 + 0) * f1);
tessellator.addVertexWithUV(x + 0, y + height, z, (textureX + 0) * f, (textureY + height) * f1);
tessellator.addVertexWithUV(x + width, y + height, z, (textureX + width) * f, (textureY + height) * f1);
tessellator.addVertexWithUV(x + width, y + 0, z, (textureX + width) * f, (textureY + 0) * f1);
tessellator.addVertexWithUV(x + 0, y + 0, z, (textureX + 0) * f, (textureY + 0) * f1);
tessellator.draw();
}
@@ -249,4 +250,15 @@ public final class RenderHelper {
return key;
}
public static void renderIcon(int x, int y, IIcon icon, int width, int height, int brightness) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setBrightness(brightness);
tessellator.addVertexWithUV(x, y + height, 0, icon.getMinU(), icon.getMaxV());
tessellator.addVertexWithUV(x + width, y + height, 0, icon.getMaxU(), icon.getMaxV());
tessellator.addVertexWithUV(x + width, y, 0, icon.getMaxU(), icon.getMinV());
tessellator.addVertexWithUV(x, y, 0, icon.getMinU(), icon.getMinV());
tessellator.draw();
}
}
@@ -124,7 +124,6 @@ import vazkii.botania.client.render.tile.RenderTileTerraPlate;
import vazkii.botania.client.render.tile.RenderTileTeruTeruBozu;
import vazkii.botania.client.render.tile.RenderTileTinyPotato;
import vazkii.botania.client.render.world.SkyblockRenderEvents;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.TileAlfPortal;
import vazkii.botania.common.block.tile.TileAltar;
@@ -384,7 +383,8 @@ public class ClientProxy extends CommonProxy {
super.setExtraReach(entity, reach);
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
if(entity == player) {
// Player object might have changed, need to check the UUID.
if(entity.worldObj.isRemote && entity.getUniqueID().equals(player.getUniqueID())) {
if(!(mc.playerController instanceof IExtendedPlayerController)) {
GameType type = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.CURRENT_GAME_TYPE);
NetHandlerPlayClient net = ReflectionHelper.getPrivateValue(PlayerControllerMP.class, mc.playerController, LibObfuscation.NET_CLIENT_HANDLER);
@@ -31,8 +31,8 @@ public class FXSparkle extends EntityFX {
public static final ResourceLocation particles = new ResourceLocation(LibResources.MISC_PARTICLES);
public static Queue<FXSparkle> queuedRenders = new ArrayDeque();
public static Queue<FXSparkle> queuedCorruptRenders = new ArrayDeque();
public static Queue<FXSparkle> queuedRenders = new ArrayDeque<>();
public static Queue<FXSparkle> queuedCorruptRenders = new ArrayDeque<>();
// Queue values
float f;
@@ -162,85 +162,96 @@ public class FXSparkle extends EntityFX {
particleGravity = value;
}
protected boolean pushOutOfBlocks(double par1, double par3, double par5) {
int var7 = MathHelper.floor_double(par1);
int var8 = MathHelper.floor_double(par3);
int var9 = MathHelper.floor_double(par5);
double var10 = par1 - var7;
double var12 = par3 - var8;
double var14 = par5 - var9;
protected boolean pushOutOfBlocks(double x, double y, double z) {
int blockX = MathHelper.floor_double(x);
int blockY = MathHelper.floor_double(y);
int blockZ = MathHelper.floor_double(z);
double dx = x - blockX;
double dy = y - blockY;
double dz = z - blockZ;
if (!worldObj.isAirBlock(var7, var8, var9)) {
boolean var16 = !worldObj.isBlockNormalCubeDefault(var7 - 1, var8, var9, false);
boolean var17 = !worldObj.isBlockNormalCubeDefault(var7 + 1, var8, var9, false);
boolean var18 = !worldObj.isBlockNormalCubeDefault(var7, var8 - 1, var9, false);
boolean var19 = !worldObj.isBlockNormalCubeDefault(var7, var8 + 1, var9, false);
boolean var20 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 - 1, false);
boolean var21 = !worldObj.isBlockNormalCubeDefault(var7, var8, var9 + 1, false);
byte var22 = -1;
double var23 = 9999.0D;
if (!worldObj.isAirBlock(blockX, blockY, blockZ)) {
boolean westFree = !worldObj.isBlockNormalCubeDefault(blockX - 1, blockY, blockZ, false);
boolean eastFree = !worldObj.isBlockNormalCubeDefault(blockX + 1, blockY, blockZ, false);
boolean downFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY - 1, blockZ, false);
boolean upFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY + 1, blockZ, false);
boolean northFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY, blockZ - 1, false);
boolean southFree = !worldObj.isBlockNormalCubeDefault(blockX, blockY, blockZ + 1, false);
byte direction = -1;
double minDist = 9999.0D;
if (var16 && var10 < var23) {
var23 = var10;
var22 = 0;
if (westFree && dx < minDist) {
minDist = dx;
direction = 0;
}
if (var17 && 1.0D - var10 < var23) {
var23 = 1.0D - var10;
var22 = 1;
if (eastFree && (1.0D - dx) < minDist) {
minDist = 1.0D - dx;
direction = 1;
}
if (var18 && var12 < var23) {
var23 = var12;
var22 = 2;
if (downFree && dy < minDist) {
minDist = dy;
direction = 2;
}
if (var19 && 1.0D - var12 < var23) {
var23 = 1.0D - var12;
var22 = 3;
if (upFree && (1.0D - dy) < minDist) {
minDist = 1.0D - dy;
direction = 3;
}
if (var20 && var14 < var23) {
var23 = var14;
var22 = 4;
if (northFree && dz < minDist) {
minDist = dz;
direction = 4;
}
if (var21 && 1.0D - var14 < var23) {
var23 = 1.0D - var14;
var22 = 5;
if (southFree && (1.0D - dz) < minDist) {
minDist = 1.0D - dz;
direction = 5;
}
float var25 = rand.nextFloat() * 0.05F + 0.025F;
float var26 = (rand.nextFloat() - rand.nextFloat()) * 0.1F;
float mainVel = rand.nextFloat() * 0.05F + 0.025F;
float sideVel1 = (rand.nextFloat() - rand.nextFloat()) * 0.1F;
float sideVel2 = (rand.nextFloat() - rand.nextFloat()) * 0.1F;
if (var22 == 0) {
motionX = -var25;
motionY=motionZ=var26;
}
switch(direction) {
case 0 -> {
motionX = -mainVel;
motionY = sideVel1;
motionZ = sideVel2;
}
if (var22 == 1) {
motionX = var25;
motionY=motionZ=var26;
}
case 1 -> {
motionX = mainVel;
motionY = sideVel1;
motionZ = sideVel2;
}
if (var22 == 2) {
motionY = -var25;
motionX=motionZ=var26;
}
case 2 -> {
motionY = -mainVel;
motionX = sideVel1;
motionZ = sideVel2;
}
if (var22 == 3) {
motionY = var25;
motionX=motionZ=var26;
}
case 3 -> {
motionY = mainVel;
motionX = sideVel1;
motionZ = sideVel2;
}
if (var22 == 4) {
motionZ = -var25;
motionY=motionX=var26;
}
case 4 -> {
motionZ = -mainVel;
motionY = sideVel1;
motionX = sideVel2;
}
if (var22 == 5) {
motionZ = var25;
motionY=motionX=var26;
case 5 -> {
motionZ = mainVel;
motionY = sideVel1;
motionX = sideVel2;
}
default -> {}
}
return true;
@@ -31,8 +31,8 @@ public class FXWisp extends EntityFX {
public static final ResourceLocation particles = new ResourceLocation(LibResources.MISC_WISP_LARGE);
public static Queue<FXWisp> queuedRenders = new ArrayDeque();
public static Queue<FXWisp> queuedDepthIgnoringRenders = new ArrayDeque();
public static Queue<FXWisp> queuedRenders = new ArrayDeque<>();
public static Queue<FXWisp> queuedDepthIgnoringRenders = new ArrayDeque<>();
// Queue values
float f;
@@ -20,7 +20,7 @@ import cpw.mods.fml.client.config.GuiConfig;
public class GuiBotaniaConfig extends GuiConfig {
public GuiBotaniaConfig(GuiScreen parentScreen) {
super(parentScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), LibMisc.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
super(parentScreen, new ConfigElement<>(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), LibMisc.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
}
}
@@ -17,17 +17,17 @@ import net.minecraft.item.ItemStack;
public class SlotLocked extends Slot {
public SlotLocked(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
public SlotLocked(IInventory inventory, int slotIndex, int xPos, int yPos) {
super(inventory, slotIndex, xPos, yPos);
}
@Override
public boolean canTakeStack(EntityPlayer p_82869_1_) {
public boolean canTakeStack(EntityPlayer player) {
return false;
}
@Override
public boolean isItemValid(ItemStack p_75214_1_) {
public boolean isItemValid(ItemStack stack) {
return false;
}
@@ -51,15 +51,15 @@ public abstract class ContainerMagicPlantBag extends Container {
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack itemstack = null;
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
Slot slot = (Slot)inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if(p_82846_2_ < 16) {
if(index < 16) {
if(!mergeItemStack(itemstack1, 16, 52, true))
return null;
} else {
@@ -78,7 +78,7 @@ public abstract class ContainerMagicPlantBag extends Container {
if(itemstack1.stackSize == itemstack.stackSize)
return null;
slot.onPickupFromSlot(p_82846_1_, itemstack1);
slot.onPickupFromSlot(player, itemstack1);
}
return itemstack;
@@ -24,14 +24,14 @@ public abstract class GuiMagicPlantBag extends GuiContainer {
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
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_) {
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(texture);
int k = (width - xSize) / 2;
@@ -55,7 +55,7 @@ public abstract class GuiMagicPlantBag extends GuiContainer {
}
@Override
protected boolean checkHotbarKeys(int p_146983_1_) {
protected boolean checkHotbarKeys(int keyCode) {
return false;
}
@@ -5,7 +5,6 @@ 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 {
@@ -22,6 +22,6 @@ public class GuiFlowerBag extends GuiMagicPlantBag {
@Override
protected String getLocalizedNameKey() {
return "item.botania:flowerBag.name";
return "botania.gui.flowerBag.title";
}
}
@@ -22,6 +22,6 @@ public class GuiShroomBag extends GuiMagicPlantBag {
@Override
protected String getLocalizedNameKey() {
return "item.botania:shroomBag.name";
return "botania.gui.shroomBag.title";
}
}
@@ -83,22 +83,22 @@ public class ContainerBaubleBox extends Container {
}
@Override
public void putStacksInSlots(ItemStack[] p_75131_1_) {
public void putStacksInSlots(ItemStack[] stacks) {
baubles.blockEvents = true;
super.putStacksInSlots(p_75131_1_);
super.putStacksInSlots(stacks);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack itemstack = null;
Slot slot = (Slot)inventorySlots.get(p_82846_2_);
Slot slot = (Slot)inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
System.out.println(p_82846_2_ + " " + itemstack);
if(p_82846_2_ < 28) {
System.out.println(index + " " + itemstack);
if(index < 28) {
if(!mergeItemStack(itemstack1, 28, 64, true))
return null;
} else {
@@ -113,7 +113,7 @@ public class ContainerBaubleBox extends Container {
if(itemstack1.stackSize == itemstack.stackSize)
return null;
slot.onPickupFromSlot(p_82846_1_, itemstack1);
slot.onPickupFromSlot(player, itemstack1);
}
return itemstack;
@@ -29,12 +29,12 @@ public class GuiBaubleBox extends InventoryEffectRenderer {
}
@Override
protected boolean checkHotbarKeys(int p_146983_1_) {
protected boolean checkHotbarKeys(int keyCode) {
return false;
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(texture);
int k = (width - xSize) / 2;
@@ -47,7 +47,7 @@ public class GuiBaubleBox extends InventoryEffectRenderer {
drawTexturedModalRect(k+slot.xDisplayPosition, l+slot.yDisplayPosition, 200, 0, 16, 16);
}
GuiInventory.func_147046_a(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - p_146976_2_, guiTop + 45 - 30 - p_146976_3_, mc.thePlayer);
GuiInventory.func_147046_a(guiLeft + 43, guiTop + 61, 20, guiLeft + 43 - mouseX, guiTop + 45 - 30 - mouseY, mc.thePlayer);
}
}
@@ -57,7 +57,7 @@ public class ContainerCraftingHalo extends ContainerWorkbench {
}
@Override
public boolean canInteractWith(EntityPlayer p_75145_1_) {
public boolean canInteractWith(EntityPlayer player) {
return true;
}
}
@@ -28,13 +28,13 @@ public class GuiCraftingHalo extends GuiContainer {
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 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_) {
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(craftingTableGuiTextures);
int k = (width - xSize) / 2;
@@ -70,7 +70,7 @@ public class GuiLexicon extends GuiScreen {
public static GuiLexicon currentOpenLexicon = new GuiLexicon();
public static ItemStack stackUsed;
public static HashMap<String, String> notes = new HashMap();
public static HashMap<String, String> notes = new HashMap<>();
private static final String TAG_TYPE = "type";
@@ -79,11 +79,11 @@ public class GuiLexicon extends GuiScreen {
public static final int BOOKMARK_START = 1337;
public static final int NOTES_BUTTON_ID = 1336; // random button tho
public static final int MAX_BOOKMARK_COUNT = 8;
public static List<GuiLexicon> bookmarks = new ArrayList();
public static List<String> bookmarkKeys = new ArrayList();
public static List<GuiLexicon> bookmarks = new ArrayList<>();
public static List<String> bookmarkKeys = new ArrayList<>();
boolean bookmarksNeedPopulation = false;
public static Queue<LexiconEntry> tutorial = new ArrayDeque();
public static Queue<LexiconEntry> tutorial = new ArrayDeque<>();
public static final ResourceLocation texture = new ResourceLocation(LibResources.GUI_LEXICON);
public static final ResourceLocation textureToff = new ResourceLocation(LibResources.GUI_TOFF);
@@ -130,7 +130,7 @@ public class GuiLexicon extends GuiScreen {
}
public void onInitGui() {
allCategories = new ArrayList(BotaniaAPI.getAllCategories());
allCategories = new ArrayList<>(BotaniaAPI.getAllCategories());
Collections.sort(allCategories);
lastTime = ClientTickHandler.ticksInGame;
@@ -193,15 +193,15 @@ public class GuiLexicon extends GuiScreen {
}
@Override
public void drawScreen(int par1, int par2, float par3) {
float time = ClientTickHandler.ticksInGame + par3;
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
float time = ClientTickHandler.ticksInGame + partialTicks;
timeDelta = time - lastTime;
lastTime = time;
partialTicks = par3;
this.partialTicks = partialTicks;
GL11.glColor4f(1F, 1F, 1F, 1F);
mc.renderEngine.bindTexture(texture);
drawNotes(par3);
drawNotes(partialTicks);
GL11.glColor4f(1F, 1F, 1F, 1F);
mc.renderEngine.bindTexture(texture);
@@ -227,7 +227,7 @@ public class GuiLexicon extends GuiScreen {
GL11.glColor4f(1F, 1F, 1F, 1F);
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(left - 19, top + 42, 67, 180, 19, 26);
if(par1 >= left - 19 && par1 < left && par2 >= top + 62 && par2 < top + 88) {
if(mouseX >= left - 19 && mouseX < left && mouseY >= top + 62 && mouseY < top + 88) {
mc.renderEngine.bindTexture(textureToff);
GL11.glPushMatrix();
GL11.glScalef(0.5F, 0.5F, 0.5F);
@@ -237,24 +237,24 @@ public class GuiLexicon extends GuiScreen {
int w = 256;
int h = 152;
int x = (int) ((ClientTickHandler.ticksInGame + par3) * 6) % (width + w) - w;
int y = (int) (top + guiHeight / 2 - h / 4 + Math.sin((ClientTickHandler.ticksInGame + par3) / 6.0) * 40);
int x = (int) ((ClientTickHandler.ticksInGame + partialTicks) * 6) % (width + w) - w;
int y = (int) (top + guiHeight / 2 - h / 4 + Math.sin((ClientTickHandler.ticksInGame + partialTicks) / 6.0) * 40);
drawTexturedModalRect(x * 2, y * 2, 0, 0, w, h);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
RenderHelper.renderTooltip(par1, par2, Arrays.asList(EnumChatFormatting.GOLD + "#goldfishchris", EnumChatFormatting.AQUA + "IT SAYS MANUAL"));
RenderHelper.renderTooltip(mouseX, mouseY, Arrays.asList(EnumChatFormatting.GOLD + "#goldfishchris", EnumChatFormatting.AQUA + "IT SAYS MANUAL"));
}
}
super.drawScreen(par1, par2, par3);
super.drawScreen(mouseX, mouseY, partialTicks);
if(hasTutorialArrow) {
mc.renderEngine.bindTexture(texture);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, 0.7F + (float) (Math.sin((ClientTickHandler.ticksInGame + par3) * 0.3F) + 1) * 0.15F);
GL11.glColor4f(1F, 1F, 1F, 0.7F + (float) (Math.sin((ClientTickHandler.ticksInGame + partialTicks) * 0.3F) + 1) * 0.15F);
drawTexturedModalRect(tutorialArrowX, tutorialArrowY, 20, 200, TUTORIAL_ARROW_WIDTH, TUTORIAL_ARROW_HEIGHT);
GL11.glDisable(GL11.GL_BLEND);
}
@@ -284,7 +284,7 @@ public class GuiLexicon extends GuiScreen {
boolean unicode = fontRendererObj.getUnicodeFlag();
fontRendererObj.setUnicodeFlag(true);
PageText.renderText(x + 5, y - 3, 92, 120, 0, noteDisplay);
PageText.renderText(x + 5, y - 3, 92, 0, noteDisplay);
fontRendererObj.setUnicodeFlag(unicode);
}
@@ -349,20 +349,20 @@ public class GuiLexicon extends GuiScreen {
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
if(par1GuiButton.id >= BOOKMARK_START) {
if(par1GuiButton.id >= BOOKMARK_START + MAX_BOOKMARK_COUNT) {
if(par1GuiButton instanceof GuiButtonChallengeInfo)
protected void actionPerformed(GuiButton button) {
if(button.id >= BOOKMARK_START) {
if(button.id >= BOOKMARK_START + MAX_BOOKMARK_COUNT) {
if(button instanceof GuiButtonChallengeInfo)
mc.displayGuiScreen(new GuiLexiconEntry(LexiconData.challenges, this));
else mc.displayGuiScreen(new GuiLexiconHistory());
ClientTickHandler.notifyPageChange();
} else handleBookmark(par1GuiButton);
} else if(par1GuiButton instanceof GuiButtonCategory) {
LexiconCategory category = ((GuiButtonCategory) par1GuiButton).getCategory();
} else handleBookmark(button);
} else if(button instanceof GuiButtonCategory) {
LexiconCategory category = ((GuiButtonCategory) button).getCategory();
mc.displayGuiScreen(new GuiLexiconIndex(category));
ClientTickHandler.notifyPageChange();
} else switch(par1GuiButton.id) {
} else switch(button.id) {
case -1 :
mc.displayGuiScreen(new GuiBotaniaConfig(this));
break;
@@ -383,8 +383,8 @@ public class GuiLexicon extends GuiScreen {
} else {
PersistentVariableHelper.lastBotaniaVersion = LibMisc.VERSION;
PersistentVariableHelper.saveSafe();
par1GuiButton.visible = false;
par1GuiButton.enabled = false;
button.visible = false;
button.enabled = false;
}
break;
@@ -394,9 +394,9 @@ public class GuiLexicon extends GuiScreen {
}
}
public void handleBookmark(GuiButton par1GuiButton) {
public void handleBookmark(GuiButton button) {
boolean modified = false;
int i = par1GuiButton.id - BOOKMARK_START;
int i = button.id - BOOKMARK_START;
String key = getNotesKey();
if(i == bookmarks.size()) {
if(!bookmarkKeys.contains(key)) {
@@ -483,7 +483,7 @@ public class GuiLexicon extends GuiScreen {
}
void populateBookmarks() {
List remove = new ArrayList();
List<GuiButton> remove = new ArrayList<>();
List<GuiButton> buttons = buttonList;
for(GuiButton button : buttons)
if(button.id >= BOOKMARK_START)
@@ -561,15 +561,15 @@ public class GuiLexicon extends GuiScreen {
}
@Override
protected void keyTyped(char par1, int par2) {
handleNoteKey(par1, par2);
protected void keyTyped(char typedChar, int keyCode) {
handleNoteKey(typedChar, keyCode);
if(!notesEnabled && closeScreenOnInvKey() && mc.gameSettings.keyBindInventory.getKeyCode() == par2) {
if(!notesEnabled && closeScreenOnInvKey() && mc.gameSettings.keyBindInventory.getKeyCode() == keyCode) {
mc.displayGuiScreen(null);
mc.setIngameFocus();
}
if(par2 == KONAMI_CODE[konamiIndex]) {
if(keyCode == KONAMI_CODE[konamiIndex]) {
konamiIndex++;
if(konamiIndex >= KONAMI_CODE.length) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(new ResourceLocation("botania:way")));
@@ -577,15 +577,15 @@ public class GuiLexicon extends GuiScreen {
}
} else konamiIndex = 0;
super.keyTyped(par1, par2);
super.keyTyped(typedChar, keyCode);
}
public void handleNoteKey(char par1, int par2) {
public void handleNoteKey(char typedChar, int keyCode) {
if(notesEnabled) {
Keyboard.enableRepeatEvents(true);
boolean changed = false;
if(par2 == 14 && note.length() > 0) {
if(keyCode == 14 && note.length() > 0) {
if(isCtrlKeyDown())
note = "";
else {
@@ -596,8 +596,8 @@ public class GuiLexicon extends GuiScreen {
changed = true;
}
if((ChatAllowedCharacters.isAllowedCharacter(par1) || par2 == 28) && note.length() < 250) {
note += par2 == 28 ? "<br>" : par1;
if((ChatAllowedCharacters.isAllowedCharacter(typedChar) || keyCode == 28) && note.length() < 250) {
note += keyCode == 28 ? "<br>" : typedChar;
changed = true;
}
@@ -60,8 +60,8 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented {
}
@Override
public void drawScreen(int par1, int par2, float par3) {
super.drawScreen(par1, par2, par3);
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@@ -83,37 +83,37 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented {
}
@Override
protected void keyTyped(char par1, int par2) {
if(par2 == 14 && !notesEnabled) // Backspace
protected void keyTyped(char typedChar, int keyCode) {
if(keyCode == 14 && !notesEnabled) // Backspace
back();
else if(par2 == 199) { // Home
else if(keyCode == 199) { // Home
mc.displayGuiScreen(new GuiLexicon());
ClientTickHandler.notifyPageChange();
}
super.keyTyped(par1, par2);
super.keyTyped(typedChar, keyCode);
}
@Override
protected void mouseClicked(int par1, int par2, int par3) {
super.mouseClicked(par1, par2, par3);
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
if(par3 == 1)
if(mouseButton == 1)
back();
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
if(par1GuiButton.id >= BOOKMARK_START)
super.actionPerformed(par1GuiButton);
else if(par1GuiButton.id == 12) {
protected void actionPerformed(GuiButton button) {
if(button.id >= BOOKMARK_START)
super.actionPerformed(button);
else if(button.id == 12) {
mc.displayGuiScreen(parent);
ClientTickHandler.notifyPageChange();
} else if(par1GuiButton.id == 13) {
} else if(button.id == 13) {
challenge.complete = !challenge.complete;
setCompleteButtonTitle();
PersistentVariableHelper.saveSafe();
} else if(par1GuiButton.id == NOTES_BUTTON_ID)
} else if(button.id == NOTES_BUTTON_ID)
notesEnabled = !notesEnabled;
}
@@ -54,8 +54,8 @@ public class GuiLexiconChallengesList extends GuiLexicon implements IParented {
}
@Override
public void drawScreen(int par1, int par2, float par3) {
super.drawScreen(par1, par2, par3);
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
boolean unicode = fontRendererObj.getUnicodeFlag();
fontRendererObj.setUnicodeFlag(true);
@@ -72,36 +72,36 @@ public class GuiLexiconChallengesList extends GuiLexicon implements IParented {
}
@Override
protected void keyTyped(char par1, int par2) {
if(par2 == 14 && !notesEnabled) // Backspace
protected void keyTyped(char typedChar, int keyCode) {
if(keyCode == 14 && !notesEnabled) // Backspace
back();
else if(par2 == 199) { // Home
else if(keyCode == 199) { // Home
mc.displayGuiScreen(new GuiLexicon());
ClientTickHandler.notifyPageChange();
}
super.keyTyped(par1, par2);
super.keyTyped(typedChar, keyCode);
}
@Override
protected void mouseClicked(int par1, int par2, int par3) {
super.mouseClicked(par1, par2, par3);
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
if(par3 == 1)
if(mouseButton == 1)
back();
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
if(par1GuiButton.id >= BOOKMARK_START)
super.actionPerformed(par1GuiButton);
else if(par1GuiButton.id == 12) {
protected void actionPerformed(GuiButton button) {
if(button.id >= BOOKMARK_START)
super.actionPerformed(button);
else if(button.id == 12) {
mc.displayGuiScreen(parent);
ClientTickHandler.notifyPageChange();
} else if(par1GuiButton instanceof GuiButtonChallengeIcon) {
GuiButtonChallengeIcon cbutton = (GuiButtonChallengeIcon) par1GuiButton;
} else if(button instanceof GuiButtonChallengeIcon) {
GuiButtonChallengeIcon cbutton = (GuiButtonChallengeIcon) button;
mc.displayGuiScreen(new GuiLexiconChallenge(this, cbutton.challenge));
} else if(par1GuiButton.id == NOTES_BUTTON_ID)
} else if(button.id == NOTES_BUTTON_ID)
notesEnabled = !notesEnabled;
}
@@ -129,16 +129,16 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
protected void actionPerformed(GuiButton button) {
LexiconPage currentPage = entry.pages.get(page);
LexiconPage newPage;
if(par1GuiButton.id >= BOOKMARK_START)
handleBookmark(par1GuiButton);
else if(par1GuiButton.id == NOTES_BUTTON_ID)
if(button.id >= BOOKMARK_START)
handleBookmark(button);
else if(button.id == NOTES_BUTTON_ID)
notesEnabled = !notesEnabled;
else
switch(par1GuiButton.id) {
switch(button.id) {
case 0 :
currentPage.onClosed(this);
mc.displayGuiScreen(GuiScreen.isShiftKeyDown() ? new GuiLexicon() : parent);
@@ -177,7 +177,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
}
updatePageButtons();
currentPage.onActionPerformed(this, par1GuiButton);
currentPage.onActionPerformed(this, button);
}
public GuiLexiconEntry setFirstEntry() {
@@ -193,11 +193,11 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
}
@Override
public void drawScreen(int par1, int par2, float par3) {
super.drawScreen(par1, par2, par3);
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
LexiconPage page = entry.pages.get(this.page);
page.renderScreen(this, par1, par2);
page.renderScreen(this, mouseX, mouseY);
}
@Override
@@ -280,11 +280,11 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
}
@Override
protected void mouseClicked(int par1, int par2, int par3) {
super.mouseClicked(par1, par2, par3);
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
fx = par1;
switch(par3) {
fx = mouseX;
switch(mouseButton) {
case 1:
back();
break;
@@ -312,22 +312,22 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
}
@Override
protected void keyTyped(char par1, int par2) {
handleNoteKey(par1, par2);
protected void keyTyped(char typedChar, int keyCode) {
handleNoteKey(typedChar, keyCode);
LexiconPage page = entry.pages.get(this.page);
page.onKeyPressed(par1, par2);
page.onKeyPressed(typedChar, keyCode);
if(par2 == 1) {
if(keyCode == 1) {
mc.displayGuiScreen((GuiScreen)null);
mc.setIngameFocus();
} else if(par2 == 203 || par2 == 200 || par2 == 201) // Left, Up, Page Up
} else if(keyCode == 203 || keyCode == 200 || keyCode == 201) // Left, Up, Page Up
prevPage();
else if(par2 == 205 || par2 == 208 || par2 == 209) // Right, Down Page Down
else if(keyCode == 205 || keyCode == 208 || keyCode == 209) // Right, Down Page Down
nextPage();
if(par2 == 14 && !notesEnabled) // Backspace
if(keyCode == 14 && !notesEnabled) // Backspace
back();
else if(par2 == 199) { // Home
else if(keyCode == 199) { // Home
mc.displayGuiScreen(new GuiLexicon());
ClientTickHandler.notifyPageChange();
}
@@ -20,7 +20,7 @@ import vazkii.botania.api.lexicon.LexiconEntry;
public class GuiLexiconHistory extends GuiLexiconIndex {
public static List<LexiconEntry> history = new ArrayList();
public static List<LexiconEntry> history = new ArrayList<>();
public GuiLexiconHistory() {
super(null);
@@ -57,7 +57,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
LexiconEntry currentEntry;
float infoTime;
List<LexiconEntry> entriesToDisplay = new ArrayList();
List<LexiconEntry> entriesToDisplay = new ArrayList<>();
public GuiLexiconIndex() {
parent = new GuiLexicon();
@@ -177,8 +177,8 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
}
@Override
public void drawScreen(int par1, int par2, float par3) {
super.drawScreen(par1, par2, par3);
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
if(!searchField.getText().isEmpty()) {
drawBookmark(left + 138, top + guiHeight - 24, " " + searchField.getText(), false);
@@ -209,8 +209,8 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
infoTime = Math.max(0, infoTime - timeDelta);
if(currentButton != null && infoTime == 0) {
int x = par1 + 10;
int y = par2;
int x = mouseX + 10;
int y = mouseY;
x = currentButton.xPosition - 20;
y = currentButton.yPosition;
@@ -293,13 +293,13 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
}
@Override
protected void actionPerformed(GuiButton par1GuiButton) {
if(par1GuiButton.id >= BOOKMARK_START)
handleBookmark(par1GuiButton);
else if(par1GuiButton.id == NOTES_BUTTON_ID)
protected void actionPerformed(GuiButton button) {
if(button.id >= BOOKMARK_START)
handleBookmark(button);
else if(button.id == NOTES_BUTTON_ID)
notesEnabled = !notesEnabled;
else
switch(par1GuiButton.id) {
switch(button.id) {
case 12 :
mc.displayGuiScreen(parent);
ClientTickHandler.notifyPageChange();
@@ -317,10 +317,10 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
ClientTickHandler.notifyPageChange();
break;
default :
if(par1GuiButton instanceof GuiButtonInvisible && ((GuiButtonInvisible) par1GuiButton).dog)
((GuiButtonInvisible) par1GuiButton).click();
if(button instanceof GuiButtonInvisible && ((GuiButtonInvisible) button).dog)
((GuiButtonInvisible) button).click();
else {
int index = par1GuiButton.id + page * 12;
int index = button.id + page * 12;
openEntry(index);
}
}
@@ -364,12 +364,12 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
}
@Override
protected void mouseClicked(int par1, int par2, int par3) {
super.mouseClicked(par1, par2, par3);
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
super.mouseClicked(mouseX, mouseY, mouseButton);
searchField.mouseClicked(par1, par2, par3);
fx = par1;
switch(par3) {
searchField.mouseClicked(mouseX, mouseY, mouseButton);
fx = mouseX;
switch(mouseButton) {
case 1:
back();
break;
@@ -402,27 +402,27 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
}
@Override
protected void keyTyped(char par1, int par2) {
if(par2 == 203 || par2 == 200 || par2 == 201) // Left, Up, Page Up
protected void keyTyped(char typedChar, int keyCode) {
if(keyCode == 203 || keyCode == 200 || keyCode == 201) // Left, Up, Page Up
prevPage();
else if(par2 == 205 || par2 == 208 || par2 == 209) // Right, Down Page Down
else if(keyCode == 205 || keyCode == 208 || keyCode == 209) // Right, Down Page Down
nextPage();
else if(par2 == 14 && !notesEnabled && searchField.getText().isEmpty()) // Backspace
else if(keyCode == 14 && !notesEnabled && searchField.getText().isEmpty()) // Backspace
back();
else if(par2 == 199) { // Home
else if(keyCode == 199) { // Home
mc.displayGuiScreen(new GuiLexicon());
ClientTickHandler.notifyPageChange();
} else if(par2 == 28 && entriesToDisplay.size() == 1) // Enter
} else if(keyCode == 28 && entriesToDisplay.size() == 1) // Enter
openEntry(0);
if(!notesEnabled) {
String search = searchField.getText();
searchField.textboxKeyTyped(par1, par2);
searchField.textboxKeyTyped(typedChar, keyCode);
if(!searchField.getText().equalsIgnoreCase(search))
updateAll();
}
super.keyTyped(par1, par2);
super.keyTyped(typedChar, keyCode);
}
void back() {
@@ -29,20 +29,20 @@ public class GuiButtonAchievement extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 109 : 98, 191, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.YELLOW + StatCollector.translateToLocal("botaniamisc.achievements"));
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -23,24 +23,24 @@ import vazkii.botania.client.gui.lexicon.GuiLexicon;
public class GuiButtonBack extends GuiButtonLexicon {
public GuiButtonBack(int par1, int par2, int par3) {
super(par1, par2, par3, 18, 9, "");
public GuiButtonBack(int id, int xPos, int yPos) {
super(id, xPos, yPos, 18, 9, "");
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if(enabled) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, 36, k == 2 ? 180 : 189, 18, 9);
List<String> tooltip = getTooltip();
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -18,8 +18,8 @@ import net.minecraft.util.StatCollector;
public class GuiButtonBackWithShift extends GuiButtonBack {
public GuiButtonBackWithShift(int par1, int par2, int par3) {
super(par1, par2, par3);
public GuiButtonBackWithShift(int id, int xPos, int yPos) {
super(id, xPos, yPos);
}
@Override
@@ -13,18 +13,18 @@ public class GuiButtonBookmark extends GuiButtonLexicon {
GuiLexicon gui;
public GuiButtonBookmark(int par1, int par2, int par3, GuiLexicon gui, String str) {
super(par1, par2, par3, gui.bookmarkWidth(str) + 5, 11, str);
public GuiButtonBookmark(int id, int xPos, int yPos, GuiLexicon gui, String text) {
super(id, xPos, yPos, gui.bookmarkWidth(text) + 5, 11, text);
this.gui = gui;
}
@Override
public void drawButton(Minecraft mc, int par2, int par3) {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
gui.drawBookmark(xPosition, yPosition, displayString, false);
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
if(displayString.equals("+"))
tooltip.add(StatCollector.translateToLocal("botaniamisc.clickToAdd"));
else {
@@ -35,7 +35,7 @@ public class GuiButtonBookmark extends GuiButtonLexicon {
int tooltipY = (tooltip.size() + 1) * 5;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -72,8 +72,8 @@ public class GuiButtonCategory extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft mc, int mx, int my) {
boolean inside = mx >= xPosition && my >= yPosition && mx < xPosition + width && my < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
boolean inside = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
if(inside)
ticksHovered = Math.min(time, ticksHovered + gui.timeDelta);
else ticksHovered = Math.max(0F, ticksHovered - gui.timeDelta);
@@ -34,30 +34,30 @@ public class GuiButtonChallengeIcon extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, challenge.icon, xPosition, yPosition);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, challenge.icon, xPosition, yPosition);
RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_BLEND);
if(challenge.complete) {
GL11.glDisable(GL11.GL_DEPTH_TEST);
par1Minecraft.fontRenderer.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 9, 0x004C00);
par1Minecraft.fontRenderer.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 8, 0x0BD20D);
mc.fontRenderer.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 9, 0x004C00);
mc.fontRenderer.drawStringWithShadow("\u2714", xPosition + 10, yPosition + 8, 0x0BD20D);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal(challenge.unlocalizedName));
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
vazkii.botania.client.core.helper.RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
vazkii.botania.client.core.helper.RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -22,23 +22,23 @@ public class GuiButtonChallengeInfo extends GuiButtonLexicon {
GuiLexicon gui;
public GuiButtonChallengeInfo(int par1, int par2, int par3, String str, GuiLexicon gui) {
super(par1, par2, par3, gui.bookmarkWidth(str) + 5, 11, str);
public GuiButtonChallengeInfo(int id, int xPos, int yPos, String text, GuiLexicon gui) {
super(id, xPos, yPos, gui.bookmarkWidth(text) + 5, 11, text);
this.gui = gui;
}
@Override
public void drawButton(Minecraft mc, int par2, int par3) {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
gui.drawBookmark(xPosition, yPosition, displayString, false);
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(StatCollector.translateToLocal("botaniamisc.challengeInfo"));
int tooltipY = (tooltip.size() + 1) * 5;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -29,20 +29,20 @@ public class GuiButtonChallenges extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 131 : 120, 180, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.YELLOW + StatCollector.translateToLocal("botaniamisc.challenges"));
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -34,19 +34,19 @@ public class GuiButtonDoot extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(TextureMap.locationItemsTexture);
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
GL11.glColor4f(1F, 1F, 1F, 1F);
RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, new ItemStack(ModItems.cacophonium), xPosition, yPosition);
RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, new ItemStack(Items.fireworks), xPosition + 8, yPosition + 2);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(ModItems.cacophonium), xPosition, yPosition);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, new ItemStack(Items.fireworks), xPosition + 8, yPosition + 2);
GL11.glDisable(GL11.GL_LIGHTING);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(EnumChatFormatting.LIGHT_PURPLE + "Happy Birthday Vazkii!");
tooltip.add(EnumChatFormatting.GRAY + "doot doot");
@@ -23,24 +23,24 @@ public class GuiButtonHistory extends GuiButtonLexicon {
GuiLexicon gui;
public GuiButtonHistory(int par1, int par2, int par3, String str, GuiLexicon gui) {
super(par1, par2, par3, gui.bookmarkWidth(str) + 5, 11, str);
public GuiButtonHistory(int id, int xPos, int yPos, String text, GuiLexicon gui) {
super(id, xPos, yPos, gui.bookmarkWidth(text) + 5, 11, text);
this.gui = gui;
}
@Override
public void drawButton(Minecraft mc, int par2, int par3) {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
gui.drawBookmark(xPosition, yPosition, displayString, false);
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
tooltip.add(StatCollector.translateToLocal("botaniamisc.historyLong"));
tooltip.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("botaniamisc.historyDesc"));
int tooltipY = (tooltip.size() + 1) * 5;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -39,8 +39,8 @@ public class GuiButtonInvisible extends GuiButtonLexicon {
boolean enableDog = false;
double dogPos = 0;
public GuiButtonInvisible(GuiLexiconIndex gui, int par1, int par2, int par3, int par4, int par5, String par6Str) {
super(par1, par2, par3, par4, par5, par6Str);
public GuiButtonInvisible(GuiLexiconIndex gui, int id, int xPos, int yPos, int width, int height, String text) {
super(id, xPos, yPos, width, height, text);
this.gui = gui;
}
@@ -51,11 +51,11 @@ public class GuiButtonInvisible extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if(enableDog) {
dogPos += ClientTickHandler.delta * 10;
par1Minecraft.renderEngine.bindTexture(dogResource);
mc.renderEngine.bindTexture(dogResource);
float f = 1F / 64F;
GL11.glTranslated(dogPos, 0, 0);
GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -65,7 +65,7 @@ public class GuiButtonInvisible extends GuiButtonLexicon {
GL11.glTranslated(-dogPos, 0, 0);
}
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
boolean showStack = displayStack != null && !displayString.isEmpty();
@@ -100,16 +100,16 @@ public class GuiButtonInvisible extends GuiButtonLexicon {
drawRect(xPosition - 5, yPosition, (int) (xPosition - 5 + timeHover * 24), yPosition + height, alpha << 24 | color);
GL11.glEnable(GL11.GL_ALPHA_TEST);
boolean unicode = par1Minecraft.fontRenderer.getUnicodeFlag();
par1Minecraft.fontRenderer.setUnicodeFlag(true);
par1Minecraft.fontRenderer.drawString(displayString, xPosition + (showStack ? 7 : 0), yPosition + (height - 8) / 2, 0);
par1Minecraft.fontRenderer.setUnicodeFlag(unicode);
boolean unicode = mc.fontRenderer.getUnicodeFlag();
mc.fontRenderer.setUnicodeFlag(true);
mc.fontRenderer.drawString(displayString, xPosition + (showStack ? 7 : 0), yPosition + (height - 8) / 2, 0);
mc.fontRenderer.setUnicodeFlag(unicode);
if(showStack) {
GL11.glScalef(0.5F, 0.5F, 0.5F);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
RenderItem.getInstance().renderItemIntoGUI(par1Minecraft.fontRenderer, par1Minecraft.renderEngine, displayStack, xPosition * 2 - 6, yPosition * 2 + 4);
RenderItem.getInstance().renderItemIntoGUI(mc.fontRenderer, mc.renderEngine, displayStack, xPosition * 2 - 6, yPosition * 2 + 4);
RenderHelper.disableStandardItemLighting();
GL11.glEnable(GL11.GL_BLEND);
}
@@ -17,13 +17,13 @@ import net.minecraft.util.ResourceLocation;
public class GuiButtonLexicon extends GuiButton {
public GuiButtonLexicon(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_, int p_i1021_4_, int p_i1021_5_, String p_i1021_6_) {
super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, p_i1021_6_);
public GuiButtonLexicon(int id, int xPos, int yPos, int width, int height, String text) {
super(id, xPos, yPos, width, height, text);
}
@Override
public void func_146113_a(SoundHandler p_146113_1_) {
p_146113_1_.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("botania:lexiconPage"), 1.0F));
public void func_146113_a(SoundHandler soundHandlerIn) {
soundHandlerIn.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("botania:lexiconPage"), 1.0F));
}
}
@@ -32,15 +32,15 @@ public class GuiButtonNotes extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 130 : 120, 191, 10, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
if(GuiLexicon.notesEnabled)
tooltip.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("botaniamisc.hideNotes"));
else {
@@ -51,7 +51,7 @@ public class GuiButtonNotes extends GuiButtonLexicon {
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -29,21 +29,21 @@ public class GuiButtonOptions extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 109 : 98, 180, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
for(int i = 0; i < 3; i++)
tooltip.add((i == 0 ? EnumChatFormatting.RED : EnumChatFormatting.GRAY) + StatCollector.translateToLocal("botaniamisc.lexiconOptions" + i));
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -24,23 +24,23 @@ public class GuiButtonPage extends GuiButtonLexicon {
boolean right;
public GuiButtonPage(int par1, int par2, int par3, boolean right) {
super(par1, par2, par3, 18, 10, "");
public GuiButtonPage(int id, int xPos, int yPos, boolean right) {
super(id, xPos, yPos, 18, 10, "");
this.right = right;
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if(enabled) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 18 : 0, right ? 180 : 190, 18, 10);
if(k == 2)
RenderHelper.renderTooltip(par2, par3, Arrays.asList(StatCollector.translateToLocal(right ? "botaniamisc.nextPage" : "botaniamisc.prevPage")));
RenderHelper.renderTooltip(mouseX, mouseY, Arrays.asList(StatCollector.translateToLocal(right ? "botaniamisc.nextPage" : "botaniamisc.prevPage")));
}
}
@@ -24,23 +24,23 @@ import vazkii.botania.client.gui.lexicon.GuiLexicon;
public class GuiButtonShare extends GuiButtonLexicon {
public GuiButtonShare(int par1, int par2, int par3) {
super(par1, par2, par3, 10, 12, "");
public GuiButtonShare(int id, int xPos, int yPos) {
super(id, xPos, yPos, 10, 12, "");
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 10 : 0 , 200, 10, 12);
List<String> tooltip = getTooltip();
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
public List<String> getTooltip() {
@@ -31,20 +31,20 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if(!visible || !enabled)
return;
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
boolean red = k == 2 || ClientTickHandler.ticksInGame % 10 < 5;
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, red ? 153 : 142, 180, 11, 11);
List<String> tooltip = new ArrayList();
List<String> tooltip = new ArrayList<>();
String version = PersistentVariableHelper.lastBotaniaVersion;
for(int i = 0; i < 6; i++) {
tooltip.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocal("botaniamisc.changes" + i), version).replaceAll("&", "\u00a7"));
@@ -54,7 +54,7 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon {
int tooltipY = (tooltip.size() - 1) * 10 - 25;
if(k == 2)
RenderHelper.renderTooltip(par2 - 125, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX - 125, mouseY + tooltipY, tooltip);
}
}
@@ -29,18 +29,18 @@ public class GuiButtonViewOnline extends GuiButtonLexicon {
}
@Override
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
field_146123_n = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
int k = getHoverState(field_146123_n);
par1Minecraft.renderEngine.bindTexture(GuiLexicon.texture);
mc.renderEngine.bindTexture(GuiLexicon.texture);
GL11.glColor4f(1F, 1F, 1F, 1F);
drawTexturedModalRect(xPosition, yPosition, k == 2 ? 41 : 30, 200, 11, 11);
List<String> tooltip = Arrays.asList(EnumChatFormatting.AQUA + StatCollector.translateToLocal("botaniamisc.viewOnline"));
int tooltipY = (tooltip.size() - 1) * 10;
if(k == 2)
RenderHelper.renderTooltip(par2, par3 + tooltipY, tooltip);
RenderHelper.renderTooltip(mouseX, mouseY + tooltipY, tooltip);
}
}
@@ -16,7 +16,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import codechicken.nei.LayoutManager;
import codechicken.nei.NEIClientConfig;
import codechicken.nei.guihook.GuiContainerManager;
@@ -39,11 +38,11 @@ public class NEIInputHandler implements IContainerInputHandler {
if(stack != null && stack.getItem() != null) {
int count = 1;
int max = stack.getMaxStackSize();
if(gui.isShiftKeyDown()) {
if(GuiScreen.isShiftKeyDown()) {
count = max;
if(gui.isCtrlKeyDown())
if(GuiScreen.isCtrlKeyDown())
count /= 4;
} else if(gui.isCtrlKeyDown())
} else if(GuiScreen.isCtrlKeyDown())
count = max / 2;
if(count > 0) {
@@ -25,7 +25,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
public class CachedBreweryRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public int mana;
@@ -28,7 +28,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler {
public class CachedElvenTradeRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public CachedElvenTradeRecipe(RecipeElvenTrade recipe) {
@@ -19,7 +19,7 @@ public class RecipeHandlerFloatingFlowers extends TemplateRecipeHandler {
public class CachedFloatingFlowerRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public CachedFloatingFlowerRecipe(ItemStack floatingFlower, ItemStack specialFlower, ItemStack output) {
@@ -18,36 +18,19 @@ import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.oredict.OreDictionary;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.KnowledgeType;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerManaPool.CachedManaPoolRecipe;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.render.tile.RenderTilePool;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TilePool;
import vazkii.botania.common.core.helper.InventoryHelper;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lexicon.page.PageRecipe;
import vazkii.botania.common.lexicon.page.PageText;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe;
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
public class RecipeHandlerLexicaBotania extends TemplateRecipeHandler {
@@ -55,7 +38,7 @@ public class RecipeHandlerLexicaBotania extends TemplateRecipeHandler {
public LexiconEntry entry;
public PositionedStack item;
public List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
public List<PositionedStack> otherStacks = new ArrayList<>();
public CachedLexicaBotaniaRecipe(ItemStack stack, LexiconEntry entry) {
otherStacks.add(new PositionedStack(new ItemStack(ModItems.lexicon), 51, 5));
@@ -2,7 +2,6 @@ package vazkii.botania.client.integration.nei.recipe;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.minecraft.client.Minecraft;
@@ -23,7 +22,6 @@ import vazkii.botania.client.render.tile.RenderTilePool;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TilePool;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import vazkii.botania.common.core.helper.ItemNBTHelper;
@@ -32,9 +30,9 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler {
public class CachedManaPoolRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
public List<PositionedStack> otherStacks = new ArrayList<>();
public int mana;
public CachedManaPoolRecipe(RecipeManaInfusion recipe) {
@@ -25,7 +25,7 @@ public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler {
public class CachedPetalApothecaryRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public CachedPetalApothecaryRecipe(RecipePetals recipe, boolean addCenterItem) {
@@ -2,7 +2,6 @@ package vazkii.botania.client.integration.nei.recipe;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.minecraft.block.Block;
@@ -19,7 +18,6 @@ import vazkii.botania.common.core.helper.ItemNBTHelper;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
import codechicken.lib.gui.GuiDraw;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
@@ -27,9 +25,9 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler {
public class CachedPureDaisyRecipe extends CachedRecipe {
public List<PositionedStack> inputs = new ArrayList<PositionedStack>();
public List<PositionedStack> inputs = new ArrayList<>();
public PositionedStack output;
public List<PositionedStack> otherStacks = new ArrayList<PositionedStack>();
public List<PositionedStack> otherStacks = new ArrayList<>();
public CachedPureDaisyRecipe(RecipePureDaisy recipe) {
if(recipe == null)
@@ -17,10 +17,10 @@ import net.minecraft.client.model.ModelRenderer;
public class ModelPump extends ModelBase{
private ArrayList<ModelRenderer> parts = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> parts = new ArrayList<>();
private ArrayList<ModelRenderer> innerRing = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> outerRing = new ArrayList<ModelRenderer>();
private ArrayList<ModelRenderer> innerRing = new ArrayList<>();
private ArrayList<ModelRenderer> outerRing = new ArrayList<>();
public ModelPump() {
textureWidth = 64;
@@ -27,32 +27,30 @@ public class RenderDoubleFlower implements ISimpleBlockRenderingHandler {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int p_147774_2_, int p_147774_3_, int p_147774_4_, Block block, int modelId, RenderBlocks renderer) {
BlockDoublePlant p_147774_1_ = (BlockDoublePlant) block;
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
BlockDoublePlant flower = (BlockDoublePlant) block;
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(p_147774_1_.getMixedBrightnessForBlock(world, p_147774_2_, p_147774_3_, p_147774_4_));
tessellator.setBrightness(flower.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1F, 1F, 1F);
long j1 = p_147774_2_ * 3129871 ^ p_147774_4_ * 116129781L;
j1 = j1 * j1 * 42317861L + j1 * 11L;
int i1 = world.getBlockMetadata(p_147774_2_, p_147774_3_, p_147774_4_);
boolean flag1 = BlockDoublePlant.func_149887_c(i1);
if (flag1)
int meta = world.getBlockMetadata(x, y, z);
boolean isTopHalf = BlockDoublePlant.func_149887_c(meta);
if (isTopHalf)
{
if (world.getBlock(p_147774_2_, p_147774_3_ - 1, p_147774_4_) != p_147774_1_)
if (world.getBlock(x, y - 1, z) != flower)
{
return false;
}
BlockDoublePlant.func_149890_d(world.getBlockMetadata(p_147774_2_, p_147774_3_ - 1, p_147774_4_));
BlockDoublePlant.func_149890_d(world.getBlockMetadata(x, y - 1, z));
}
else
{
BlockDoublePlant.func_149890_d(i1);
BlockDoublePlant.func_149890_d(meta);
}
// Only change here, to use xyz rather than side/meta
IIcon icon = renderer.getBlockIcon(block, world, p_147774_2_, p_147774_3_, p_147774_4_, 0);
RenderSpecialFlower.drawCrossedSquares(world, block, icon, p_147774_2_, p_147774_3_, p_147774_4_, p_147774_2_, p_147774_3_, p_147774_4_, 1F, renderer);
IIcon icon = renderer.getBlockIcon(block, world, x, y, z, 0);
RenderSpecialFlower.drawCrossedSquares(world, block, icon, x, y, z, x, y, z, 1F, renderer);
return true;
}
@@ -63,17 +63,17 @@ public class RenderPixie extends RenderLiving {
ShaderHelper.releaseShader();
}
protected int setPixieBrightness(EntityPixie par1EntityPixie, int par2, float par3) {
protected int setPixieBrightness(EntityPixie pixie, int par2, float par3) {
if (par2 != 0)
return -1;
else {
bindTexture(getEntityTexture(par1EntityPixie));
bindTexture(getEntityTexture(pixie));
float f1 = 1.0F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
if (par1EntityPixie.isInvisible())
if (pixie.isInvisible())
GL11.glDepthMask(false);
else
GL11.glDepthMask(true);
@@ -89,7 +89,7 @@ public class RenderPixie extends RenderLiving {
}
@Override
protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) {
return setPixieBrightness((EntityPixie)par1EntityLivingBase, par2, par3);
protected int shouldRenderPass(EntityLivingBase entity, int par2, float par3) {
return setPixieBrightness((EntityPixie)entity, par2, par3);
}
}
@@ -20,20 +20,21 @@ import net.minecraft.util.IIcon;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.block.BlockAlfPortal;
import vazkii.botania.common.block.tile.TileAlfPortal;
public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileAlfPortal portal = (TileAlfPortal) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
TileAlfPortal portal = (TileAlfPortal) tileEntity;
int meta = portal.getBlockMetadata();
if(meta == 0)
return;
GL11.glPushMatrix();
GL11.glTranslated(d0, d1, d2);
GL11.glTranslated(x, y, z);
GL11.glTranslatef(-1F, 1F, 0.25F);
GL11.glEnable(GL11.GL_BLEND);
@@ -41,7 +42,7 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_CULL_FACE);
float alpha = (float) Math.min(1F, (Math.sin((ClientTickHandler.ticksInGame + f) / 8D) + 1D) / 7D + 0.6D) * (Math.min(60, portal.ticksOpen) / 60F) * 0.5F;
float alpha = (float) Math.min(1F, (Math.sin((ClientTickHandler.ticksInGame + partialTicks) / 8D) + 1D) / 7D + 0.6D) * (Math.min(60, portal.ticksOpen) / 60F) * 0.5F;
GL11.glColor4f(1F, 1F, 1F, alpha);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
@@ -53,11 +54,11 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING);
renderIcon(0, 0, BlockAlfPortal.portalTex, 3, 3, 240);
RenderHelper.renderIcon(0, 0, BlockAlfPortal.portalTex, 3, 3, 240);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslated(0F, 0F, 0.5F);
renderIcon(0, 0, BlockAlfPortal.portalTex, 3, 3, 240);
RenderHelper.renderIcon(0, 0, BlockAlfPortal.portalTex, 3, 3, 240);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_ALPHA_TEST);
@@ -66,16 +67,4 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glPopMatrix();
}
public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setBrightness(brightness);
tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV());
tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV());
tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV());
tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV());
tessellator.draw();
}
}
@@ -57,13 +57,13 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
public static int forceMeta = -1;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) {
TileAltar altar = (TileAltar) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float partialTicks) {
TileAltar altar = (TileAltar) tileEntity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : textures[Math.min(textures.length - 1, forceMeta == -1 ? tileentity.getBlockMetadata() : forceMeta)]);
Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : textures[Math.min(textures.length - 1, forceMeta == -1 ? tileEntity.getBlockMetadata() : forceMeta)]);
GL11.glTranslated(d0 + 0.5, d1 + 1.5, d2 + 0.5);
GL11.glScalef(1F, -1F, -1F);
@@ -93,7 +93,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
final float radiusBase = 1.2F;
final float radiusMod = 0.1F;
double ticks = (ClientTickHandler.ticksInGame + pticks) * 0.5;
double ticks = (ClientTickHandler.ticksInGame + partialTicks) * 0.5;
float offsetPerPetal = 360 / petals;
GL11.glPushMatrix();
@@ -42,13 +42,13 @@ public class RenderTileAvatar extends TileEntitySpecialRenderer {
private static final ModelAvatar model = new ModelAvatar();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float pticks) {
TileAvatar avatar = (TileAvatar) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
TileAvatar avatar = (TileAvatar) tileEntity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
GL11.glTranslated(x, y, z);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int meta = avatar.getWorldObj() != null ? avatar.getBlockMetadata() : 0;
@@ -32,13 +32,13 @@ public class RenderTileBellows extends TileEntitySpecialRenderer {
private static final ModelBellows model = new ModelBellows();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileBellows bellows = (TileBellows) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
TileBellows bellows = (TileBellows) tileEntity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
GL11.glTranslated(x, y, z);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int meta = bellows.getWorldObj() != null ? bellows.getBlockMetadata() : 0;
@@ -46,7 +46,7 @@ public class RenderTileBellows extends TileEntitySpecialRenderer {
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
GL11.glScalef(1F, -1F, -1F);
GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F);
model.render(Math.max(0.1F, 1F - (bellows.movePos + bellows.moving * f + 0.1F)));
model.render(Math.max(0.1F, 1F - (bellows.movePos + bellows.moving * partialTicks + 0.1F)));
GL11.glColor3f(1F, 1F, 1F);
GL11.glScalef(1F, -1F, -1F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@@ -43,18 +43,18 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer {
public static boolean rotate = true;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
brewery = (TileBrewery) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
brewery = (TileBrewery) tileEntity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
GL11.glTranslated(x, y, z);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GL11.glScalef(1F, -1F, -1F);
GL11.glTranslatef(0.5F, -1.5F, -0.5F);
double time = ClientTickHandler.ticksInGame + f;
double time = ClientTickHandler.ticksInGame + partialTicks;
if(!rotate)
time = -1;
@@ -28,15 +28,15 @@ public class RenderTileCocoon extends TileEntitySpecialRenderer {
ModelCocoon model = new ModelCocoon();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileCocoon cocoon = (TileCocoon) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
TileCocoon cocoon = (TileCocoon) tileEntity;
float rot = 0F;
float modval = 60F - (float) cocoon.timePassed / (float) TileCocoon.TOTAL_TIME * 30F;
if(cocoon.timePassed % modval < 10) {
float mod = (cocoon.timePassed + f) % modval;
float mod = (cocoon.timePassed + partialTicks) % modval;
float v = mod / 5 * (float) Math.PI * 2;
rot = (float) Math.sin(v) * (float) Math.log(cocoon.timePassed + f);
rot = (float) Math.sin(v) * (float) Math.log(cocoon.timePassed + partialTicks);
}
GL11.glPushMatrix();
@@ -44,7 +44,7 @@ public class RenderTileCocoon extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
GL11.glTranslated(x, y, z);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glTranslatef(0.5F, -0.5F - 3F / 16F, -0.5F + 1F / 16F);
@@ -36,8 +36,8 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
EntityItem entity = null;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
TileCorporeaCrystalCube cube = (TileCorporeaCrystalCube) tileEntity;
if(entity == null)
entity = new EntityItem(cube.getWorldObj(), cube.xCoord, cube.yCoord, cube.zCoord, new ItemStack(Blocks.stone));
@@ -46,8 +46,8 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
ItemStack stack = cube.getRequestTarget();
entity.setEntityItemStack(stack);
double time = ClientTickHandler.ticksInGame + f;
double worldTicks = tileentity.getWorldObj() == null ? 0 : time;
double time = ClientTickHandler.ticksInGame + partialTicks;
double worldTicks = tileEntity.getWorldObj() == null ? 0 : time;
Minecraft mc = Minecraft.getMinecraft();
GL11.glPushMatrix();
@@ -55,7 +55,7 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
GL11.glTranslated(x, y, z);
mc.renderEngine.bindTexture(texture);
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
GL11.glScalef(1F, -1F, -1F);
@@ -67,7 +67,7 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer {
GL11.glTranslatef(0F, 0.8F, 0F);
GL11.glScalef(s, s, s);
GL11.glRotatef(180F, 0F, 0F, 1F);
((Render) RenderManager.instance.entityRenderMap.get(EntityItem.class)).doRender(entity, 0, 0, 0, 1F, f);
((Render) RenderManager.instance.entityRenderMap.get(EntityItem.class)).doRender(entity, 0, 0, 0, 1F, partialTicks);
GL11.glPopMatrix();
mc.renderEngine.bindTexture(texture);
}
@@ -29,15 +29,15 @@ public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer {
public static boolean move = true;
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partticks) {
TileCorporeaIndex index = (TileCorporeaIndex) tile;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
TileCorporeaIndex index = (TileCorporeaIndex) tileEntity;
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y, z + 0.5);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
float translation = move ? (float) ((Math.cos((index.ticksWithCloseby + (index.hasCloseby ? partticks : 0)) / 10F) * 0.5 + 0.5) * 0.25) : 0F;
float rotation = move ? index.ticks * 2 + partticks : 0F;
float translation = move ? (float) ((Math.cos((index.ticksWithCloseby + (index.hasCloseby ? partialTicks : 0)) / 10F) * 0.5 + 0.5) * 0.25) : 0F;
float rotation = move ? index.ticks * 2 + partialTicks : 0F;
float scale = 0.6F;
GL11.glScalef(scale, scale, scale);
crystal.render(null, 0F, rotation, translation, 0F, 0F, 1F / 16F);
@@ -45,8 +45,8 @@ public class RenderTileCorporeaIndex extends TileEntitySpecialRenderer {
if(index.closeby > 0F) {
float starScale = 0.02F;
float starRadius = (float) TileCorporeaIndex.RADIUS * index.closeby + (index.closeby == 1F ? 0F : index.hasCloseby ? partticks : -partticks) * 0.2F;
double rads = (index.ticksWithCloseby + partticks) * 2 * Math.PI / 180;
float starRadius = (float) TileCorporeaIndex.RADIUS * index.closeby + (index.closeby == 1F ? 0F : index.hasCloseby ? partialTicks : -partialTicks) * 0.2F;
double rads = (index.ticksWithCloseby + partialTicks) * 2 * Math.PI / 180;
double starX = Math.cos(rads) * starRadius;
double starZ = Math.sin(rads) * starRadius;
int color = 0xFF00FF;
@@ -25,6 +25,7 @@ import net.minecraft.util.IIcon;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.mana.BlockEnchanter;
import vazkii.botania.common.block.tile.TileEnchanter;
@@ -35,8 +36,8 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
EntityItem item;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileEnchanter enchanter = (TileEnchanter) tileentity;
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) {
TileEnchanter enchanter = (TileEnchanter) tileEntity;
float alphaMod = 0F;
if(enchanter.stage == 2)
@@ -55,12 +56,12 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslatef(0.5F, 1.25F, 0.5F);
((Render) RenderManager.instance.entityRenderMap.get(EntityItem.class)).doRender(item, d0, d1, d2, 1F, f);
((Render) RenderManager.instance.entityRenderMap.get(EntityItem.class)).doRender(item, x, y, z, 1F, partialTicks);
GL11.glTranslatef(-0.5F, -1.25F, -0.5F);
}
GL11.glPushMatrix();
GL11.glTranslated(d0, d1, d2);
GL11.glTranslated(x, y, z);
GL11.glRotated(90F, 1F, 0F, 0F);
GL11.glTranslatef(-2F, -2F, -0.001F);
@@ -69,7 +70,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
float alpha = (float) ((Math.sin((ClientTickHandler.ticksInGame + f) / 8D) + 1D) / 5D + 0.4D) * alphaMod;
float alpha = (float) ((Math.sin((ClientTickHandler.ticksInGame + partialTicks) / 8D) + 1D) / 5D + 0.4D) * alphaMod;
if(alpha > 0) {
if(ShaderHelper.useShaders())
@@ -79,7 +80,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
int lightmapX = light % 65536;
int lightmapY = light / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
GL11.glColor4f(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + f) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha);
GL11.glColor4f(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + partialTicks) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha);
}
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
@@ -97,7 +98,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
}
ShaderHelper.useShader(ShaderHelper.enchanterRune);
renderIcon(0, 0, BlockEnchanter.overlay, 5, 5, 240);
RenderHelper.renderIcon(0, 0, BlockEnchanter.overlay, 5, 5, 240);
ShaderHelper.releaseShader();
}
@@ -106,16 +107,4 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glPopMatrix();
}
public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setBrightness(brightness);
tessellator.addVertexWithUV(par1 + 0, par2 + par5, 0, par3Icon.getMinU(), par3Icon.getMaxV());
tessellator.addVertexWithUV(par1 + par4, par2 + par5, 0, par3Icon.getMaxU(), par3Icon.getMaxV());
tessellator.addVertexWithUV(par1 + par4, par2 + 0, 0, par3Icon.getMaxU(), par3Icon.getMinV());
tessellator.addVertexWithUV(par1 + 0, par2 + 0, 0, par3Icon.getMinU(), par3Icon.getMinV());
tessellator.draw();
}
}
Loaded 100 of 1595 files, more files were not shown because too many files have changed in this diff. Show more