Compare commits

...
18 Commits
Author SHA1 Message Date
Martin Robertz 1a6e6b3c2c update 2024-02-18 10:54:02 +01:00
Jason Mitchell e5dfcc7942 No more restriction by player name (#44)
* Remove the ability to lock a bee to a specific person, and instead give them acknowledgement.

* Restrict to feb 29th - effectively not allowed unless you're a real chad :trollface: and still gives mentions to the people
2024-02-17 16:27:57 -08:00
Raven Szewczyk ea78ca8069 [ci skip] upgraded build system 2024-02-04 19:57:04 +00:00
Martin Robertz 29814550bb update deps+bs 2024-01-25 10:42:36 +01:00
ghostflyby 15769b9ee9 fix no tooltip in some Gui (#42) 2024-01-24 21:44:37 +01:00
Martin Robertz 1253271111 update bs+deps 2024-01-11 22:55:32 +01:00
Raven Szewczyk d18be7848d [ci skip] upgraded build system 2024-01-08 21:24:08 +00:00
Martin Robertz ef4dd3710a update gradle+bs+deps 2023-12-11 11:41:14 +01:00
ghostflyby 190693ad68 Fix double layers tooltip with NEI (#41)
* Fix double layers tooltip with nei

* Remove wildcard imports
2023-12-11 08:43:58 +01:00
Martin Robertz 3dc2806b36 update bs+deps 2023-11-15 10:13:07 +01:00
Pelotrio a609f5dce5 Optimized flower color enumeration array retrieval (#40) 2023-11-15 00:19:42 +00:00
Martin Robertz 00c214ee5d update deps 2023-10-21 12:22:30 +02:00
miozune e497b9505a Optimize PlankType$ExtraBiomesPlank.getStack() (#39) 2023-10-21 10:55:44 +02:00
Martin Robertz b5ac446e55 update bs+deps 2023-10-11 23:14:28 +02:00
ghostflyby c00e1b39da NEI item manager overlay integration (#38)
* New: NEI item manager overly integration

* update buildscript

* apply spotless

* Making nei really optional

* Fix wildcard

* Stream chain simplify

* Fix: NPE when events outside the Gui

* Fix: drag and mouse event

* Fix: call mouse event
2023-10-11 14:35:28 +09:00
Lyfts 6e6e806476 fix incubator for real this time (#37) 2023-09-06 19:48:53 +02:00
miozuneandMartin Robertz ef877e2f7d Fix NPE with Lumbermill (#35)
* Remove outdated script

* updateBuildScript

* Update dependencies

* Fix NPE with Lumbermill

---------

Co-authored-by: Martin Robertz <[email protected]>
2023-08-19 12:34:10 +02:00
miozune 669aee5ba6 Fix typo: cooper -> copper (#34) 2023-08-12 15:31:22 +02:00
42 changed files with 405 additions and 1774 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
+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
+2 -1602
View File
File diff suppressed because it is too large. Load diff
+5 -5
View File
@@ -1,12 +1,12 @@
// Add your dependencies here
dependencies {
implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev')
compile('com.github.GTNewHorizons:ForestryMC:4.6.13:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.76-GTNH:dev')
api('com.github.GTNewHorizons:ForestryMC:4.8.2:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.2.4:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.34:api')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.5.18-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.39:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly('curse.maven:cofh-lib-220333:2388748')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
}
+112 -36
View File
@@ -1,65 +1,104 @@
# ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable.
# LOCAL to test local config updates.
gtnh.settings.blowdryerTag = 0.2.0
# Human-readable mod name, available for mcmod.info population.
modName = Binnie Core
# This is a case-sensitive string to identify your mod. Convention is to use lower case.
# Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation.
# Conventionally lowercase.
modId = BinnieCore
# Root package of the mod, used to find various classes in other properties,
# mcmod.info substitution, enabling assertions in run tasks, etc.
modGroup = binnie
# WHY is there no version field?
# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the
# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/
# Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods.
useModGroupForPublishing = false
# Will update your build.gradle automatically whenever an update is available
# Updates your build.gradle and settings.gradle automatically whenever an update is available.
autoUpdateBuildScript = false
# Version of Minecraft to target
minecraftVersion = 1.7.10
# Version of Minecraft Forge to target
forgeVersion = 10.13.4.1614
# Specify a MCP channel and mappings version for dependency deobfuscation and the deobfParams task.
# Specify an MCP channel for dependency deobfuscation and the deobfParams task.
channel = stable
# Specify an MCP mappings version for dependency deobfuscation and the deobfParams task.
mappingsVersion = 12
# Define other MCP mappings for dependency deobfuscation
remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Defines other MCP mappings for dependency deobfuscation.
remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/
# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you
# restart Minecraft in development. Choose this dependent on your mod:
# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name
# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty
# Select a default username for testing your mod. You can always override this per-run by running
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer
# Define a source file of your project with:
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = false
# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
enableGenericInjection = false
# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
generateGradleTokenClass =
# Name of the token containing the project's current version to generate/replace.
gradleTokenVersion = GRADLETOKEN_VERSION
# [DEPRECATED] Mod ID replacement token.
gradleTokenModId =
# [DEPRECATED] Mod name replacement token.
gradleTokenModName =
# [DEPRECATED] Mod Group replacement token.
gradleTokenGroupName =
# [DEPRECATED]
# Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java
# public static final String VERSION = "GRADLETOKEN_VERSION";
# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's
# version in @Mod([...], version = VERSION, [...])
# Leave these properties empty to skip individual token replacements
# version in @Mod([...], version = VERSION, [...]).
# Leave these properties empty to skip individual token replacements.
replaceGradleTokenInFile = BinnieCore.java
gradleTokenModId =
gradleTokenModName =
gradleTokenVersion = GRADLETOKEN_VERSION
gradleTokenGroupName =
# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can
# leave this property empty.
# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api
# Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api
apiPackage =
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
# Example value: mymodid_at.cfg
# There can be multiple files in a space-separated list.
# Example value: mymodid_at.cfg nei_at.cfg
accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = false
# Adds some debug arguments like verbose output and export
# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
# This parameter is for legacy compatibility only
# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin
# Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin
coreModClass =
# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class
# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false!
containsMixinsAndOrCoreModOnly = false
@@ -67,15 +106,32 @@ containsMixinsAndOrCoreModOnly = false
# Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins.
forceEnableMixins = false
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated in your jar. It is your
# responsibility check the licence and request permission for distribution, if required.
# If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your
# responsibility to check the license and request permission for distribution if required.
usesShadowedDependencies = false
# If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access
# their own classes, making the minimization unreliable.
minimizeShadowedDependencies = true
# Publishing to modrinth requires you to set the MODRINTH_TOKEN environment variable to your current modrinth API token.
# If disabled, won't rename the shadowed classes.
relocateShadowedDependencies = true
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
includeWellKnownRepositories = true
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
usesMavenPublishing = true
# Maven repository to publish the mod to.
# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/
# Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token.
#
# The project's ID on Modrinth. Can be either the slug or the ID.
# Leave this empty if you don't want to publish on Modrinth.
# Leave this empty if you don't want to publish to Modrinth.
modrinthProjectId =
# The project's relations on Modrinth. You can use this to refer to other projects on Modrinth.
@@ -87,9 +143,8 @@ modrinthProjectId =
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
#
# The project's numeric ID on CurseForge. You can find this in the About Project box.
# Leave this empty if you don't want to publish on CurseForge.
curseForgeProjectId =
@@ -99,18 +154,39 @@ curseForgeProjectId =
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
# and the name is the CurseForge project slug of the other mod.
# Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
curseForgeRelations =
# Optional parameter to customize the produced artifacts. Use this to preserver artifact naming when migrating older
# Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older
# projects. New projects should not use this parameter.
customArchiveBaseName = binnie-mods
# Optional parameter to prevent the source code from being published
# noPublishedSources =
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
# Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+
# versionPattern =
# Uncomment this to disable spotless checks
# Uncomment to prevent the source code from being published.
# noPublishedSources = true
# Uncomment this to disable Spotless checks.
# This should only be uncommented to keep it easier to sync with upstream/other forks.
# That is, if there is no other active fork/upstream, NEVER change this.
# disableSpotless = true
# disableSpotless = true
# Uncomment this to disable Checkstyle checks (currently wildcard import check).
# disableCheckstyle = true
# Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle"
# (force use delegated build).
# This is meant to be set in $HOME/.gradle/gradle.properties.
# e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build.
# WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want!
# Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you.
# ideaOverrideBuildType = idea
# Whether IDEA should run spotless checks when pressing the Build button.
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true
Binary file not shown.
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+17 -12
View File
@@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -144,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -152,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Vendored
+10 -10
View File
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
-22
View File
@@ -1,26 +1,4 @@
// Add any additional repositories for your dependencies here
repositories {
maven {
name 'GTNH Maven'
url 'http://jenkins.usrv.eu:8081/nexus/content/groups/public/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'http://maven.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
content {
includeGroup 'curse.maven'
}
}
maven {
url 'https://jitpack.io'
}
}
+5 -10
View File
@@ -4,10 +4,10 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
url "https://nexus.gtnewhorizons.com/repository/public/"
mavenContent {
includeGroup("com.gtnewhorizons.retrofuturagradle")
includeGroup("com.gtnewhorizons")
includeGroupByRegex("com\\.gtnewhorizons\\..+")
}
}
gradlePluginPortal()
@@ -17,12 +17,7 @@ pluginManagement {
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
}
blowdryerSetup {
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
}
@@ -88,7 +88,7 @@ public class ItemInsulatedTube extends Item {
enum Material {
Copper(0xe3b78e, "cooper"),
Copper(0xe3b78e, "copper"),
Tin(0xe1eef4, "tin"),
Bronze(0xddc276, "bronze"),
Iron(0xd8d8d8, "iron");
@@ -92,6 +92,7 @@ public enum EnumFlowerColor implements IFlowerColor {
YELLOW("yellow", 0xffff00),
YELLOW_GREEN("yellowGreen", 0x9acd32);
private static final EnumFlowerColor[] ALL_VALUES = values();
private int color;
private int colorDis;
private String name;
@@ -2963,7 +2964,7 @@ public enum EnumFlowerColor implements IFlowerColor {
}
public static EnumFlowerColor get(int i) {
return values()[Math.max(0, i) % values().length];
return ALL_VALUES[Math.max(0, i) % ALL_VALUES.length];
}
@Override
+2
View File
@@ -12,6 +12,7 @@ public class Mods {
public static Mod forestry;
public static Mod ic2;
public static Mod botania;
public static Mod extraBiomes;
private static Item findItem(String modId, String name) {
Item stack = GameRegistry.findItem(modId, name);
@@ -41,6 +42,7 @@ public class Mods {
Mods.forestry = new Mod("Forestry");
Mods.ic2 = new Mod("IC2");
Mods.botania = new Mod("Botania");
Mods.extraBiomes = new Mod("ExtrabiomesXL");
}
public static class Mod {
@@ -30,6 +30,8 @@ import binnie.core.craftgui.events.EventMouse;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.IBorder;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.minecraft.control.ControlSlotBase;
import binnie.core.nei.NEIHook;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -76,6 +78,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override
public void drawScreen(int mouseX, int mouseY, float par3) {
NEIHook.preDraw();
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
drawDefaultBackground();
@@ -89,6 +93,9 @@ public class GuiCraftGUI extends GuiContainer {
window.render();
RenderHelper.enableGUIStandardItemLighting();
NEIHook.renderObjects(window, mouseX, mouseY);
GL11.glPushMatrix();
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
@@ -109,10 +116,13 @@ public class GuiCraftGUI extends GuiContainer {
} else {
tooltip.setType(Tooltip.Type.STANDARD);
window.getTooltip(tooltip);
NEIHook.renderToolTips(mouseX, mouseY);
}
if (tooltip.exists()) {
renderTooltip(new IPoint(mouseX, mouseY), tooltip);
} else {
NEIHook.renderToolTips(mouseX, mouseY);
}
zLevel = 0.0f;
GL11.glEnable(GL11.GL_LIGHTING);
@@ -219,6 +229,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override
protected void mouseClicked(int x, int y, int button) {
NEIHook.mouseClicked(x, y, button);
IWidget origin = window;
if (window.getMousedOverWidget() != null) {
origin = window.getMousedOverWidget();
@@ -228,6 +240,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override
protected void keyTyped(char c, int key) {
NEIHook.lastKeyTyped(key, c);
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
mc.thePlayer.closeScreen();
}
@@ -241,6 +255,7 @@ public class GuiCraftGUI extends GuiContainer {
if (button != -1) {
window.callEvent(new EventMouse.Up(origin, x, y, button));
}
NEIHook.mouseUp(x, y, button);
}
@Override
@@ -250,6 +265,8 @@ public class GuiCraftGUI extends GuiContainer {
if (dWheel != 0) {
window.callEvent(new EventMouse.Wheel(window, dWheel));
}
NEIHook.handleMouseWheel();
}
@Override
@@ -506,4 +523,13 @@ public class GuiCraftGUI extends GuiContainer {
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
public ItemStack getStackUnderMouse(int x, int y) {
for (IWidget widget : window.calculateMousedOverWidgets()) {
if (widget instanceof ControlSlotBase && widget.isVisible()) {
return ((ControlSlotBase) widget).getItemStack();
}
}
return null;
}
}
@@ -29,6 +29,7 @@ import binnie.core.craftgui.minecraft.control.ControlHelp;
import binnie.core.craftgui.minecraft.control.ControlInfo;
import binnie.core.craftgui.minecraft.control.ControlPowerSystem;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.craftgui.minecraft.control.ControlSlotBase;
import binnie.core.craftgui.minecraft.control.ControlUser;
import binnie.core.craftgui.minecraft.control.EnumHighlighting;
import binnie.core.craftgui.renderer.Renderer;
@@ -40,6 +41,7 @@ import binnie.core.machines.Machine;
import binnie.core.machines.inventory.IInventoryMachine;
import binnie.core.machines.network.INetwork;
import binnie.core.machines.power.PowerSystem;
import binnie.core.nei.NEIHook;
import binnie.core.network.packet.MessageCraftGUI;
import binnie.core.resource.BinnieResource;
import binnie.core.resource.ResourceType;
@@ -118,6 +120,9 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
if (!widget.calculateIsMouseOver()) {
continue;
}
if (NEIHook.enabled && widget instanceof ControlSlotBase) {
return;
}
if (widget instanceof ITooltip) {
((ITooltip) widget).getTooltip(tooltip);
if (tooltip.exists()) {
@@ -13,6 +13,7 @@ import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.minecraft.Window;
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
import binnie.core.nei.NEIHook;
public abstract class ControlSlotBase extends Control implements ITooltip {
@@ -60,6 +61,7 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
@Override
public void getTooltip(Tooltip tooltip) {
if (NEIHook.enabled) return;
ItemStack item = getItemStack();
if (item == null) {
return;
@@ -122,7 +122,7 @@ public class TransferRequest {
|| ((IInventorySlots) destination).getSlot(slot) == null
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
if (destination.getStackInSlot(slot) != null) {
if (item.isStackable()) {
if (item.isStackable() && destination.getInventoryStackLimit() > 1) {
ItemStack merged = destination.getStackInSlot(slot).copy();
ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
item = newStacks[0];
@@ -158,8 +158,9 @@ public class TransferRequest {
if (item.stackSize <= 0) {
item = null;
}
return item;
}
return item;
return null;
}
}
}
@@ -0,0 +1,49 @@
package binnie.core.nei;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import binnie.core.craftgui.minecraft.GuiCraftGUI;
import codechicken.nei.guihook.IContainerObjectHandler;
import cpw.mods.fml.common.Optional;
@Optional.Interface(
iface = "codechicken.nei.guihook.IContainerObjectHandler",
modid = "NotEnoughItems",
striprefs = true)
public final class ContainerObjectHandler implements IContainerObjectHandler {
@Override
public void guiTick(GuiContainer gui) {
}
@Override
public void refresh(GuiContainer gui) {
}
@Override
public void load(GuiContainer gui) {
}
@Override
public ItemStack getStackUnderMouse(GuiContainer gui, int mousex, int mousey) {
if (gui instanceof GuiCraftGUI) {
return ((GuiCraftGUI) gui).getStackUnderMouse(mousex, mousey);
} else {
return null;
}
}
@Override
public boolean objectUnderMouse(GuiContainer gui, int mousex, int mousey) {
return false;
}
@Override
public boolean shouldShowTooltip(GuiContainer gui) {
return true;
}
}
+107
View File
@@ -0,0 +1,107 @@
package binnie.core.nei;
import org.lwjgl.opengl.GL11;
import binnie.core.craftgui.minecraft.Window;
import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public final class NEIHook {
public static boolean enabled = false;
static {
if (Loader.isModLoaded("NotEnoughItems")) {
enabled = true;
addHandler();
}
}
@Optional.Method(modid = "NotEnoughItems")
private static void addHandler() {
GuiContainerManager.addObjectHandler(new ContainerObjectHandler());
}
@Optional.Method(modid = "NotEnoughItems")
private static GuiContainerManager getManager() {
return GuiContainerManager.getManager();
}
@Optional.Method(modid = "NotEnoughItems")
private static void preDrawImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.preDraw();
}
public static void preDraw() {
if (enabled) preDrawImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderObjectsImpl(Window window, int mouseX, int mouseY) {
GL11.glPushMatrix();
GL11.glTranslatef(window.x(), window.y(), 0.0f);
GuiContainerManager manager = getManager();
if (manager != null) manager.renderObjects(mouseX, mouseY);
GL11.glTranslatef(-window.x(), -window.y(), 0.0f);
GL11.glPopMatrix();
}
public static void renderObjects(Window window, int mouseX, int mouseY) {
if (enabled) renderObjectsImpl(window, mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderToolTipsImpl(int mouseX, int mouseY) {
GuiContainerManager manager = getManager();
if (manager != null) manager.renderToolTips(mouseX, mouseY);
}
public static void renderToolTips(int mouseX, int mouseY) {
if (enabled) renderToolTipsImpl(mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseClickedImpl(int x, int y, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseClicked(x, y, button);
}
public static void mouseClicked(int x, int y, int button) {
if (enabled) mouseClickedImpl(x, y, button);
}
@Optional.Method(modid = "NotEnoughItems")
private static void lastKeyTypedImpl(int k, char c) {
GuiContainerManager manager = getManager();
if (manager != null) manager.lastKeyTyped(k, c);
}
public static void lastKeyTyped(int k, char c) {
if (enabled) lastKeyTypedImpl(k, c);
}
@Optional.Method(modid = "NotEnoughItems")
private static void handleMouseWheelImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.handleMouseWheel();
}
public static void handleMouseWheel() {
if (enabled) handleMouseWheelImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseUpImpl(int mouseX, int mouseY, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseUp(mouseX, mouseY, button);
}
public static void mouseUp(int mouseX, int mouseY, int button) {
if (enabled) mouseUpImpl(mouseX, mouseY, button);
}
}
+5 -1
View File
@@ -2,7 +2,11 @@ package binnie.core.nei;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.*;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fluids.IFluidContainerItem;
public class NEIUtils {
@@ -1,6 +1,7 @@
package binnie.core.nei;
import java.awt.*;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.core.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,7 @@
package binnie.core.nei;
import java.awt.*;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1673,7 +1673,10 @@ public enum ExtraBeeDefinition implements IBeeDefinition {
@Override
protected void registerMutations() {
registerMutation(BeeDefinition.CULTIVATED, CELEBRATORY, 5).restrictPerson(
final ExtraBeeMutation mutation = registerMutation(BeeDefinition.CULTIVATED, CELEBRATORY, 5);
mutation.restrictDateRange(2, 29, 2, 29);
mutation.requireDay();
mutation.restrictPerson(
new RequirementPerson().add(
name -> "" + EnumChatFormatting.DARK_RED
+ EnumChatFormatting.BOLD
@@ -4,7 +4,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import binnie.extrabees.genetics.requirements.*;
import binnie.extrabees.genetics.requirements.DummyMutationCondition;
import binnie.extrabees.genetics.requirements.IMutationRequirement;
import binnie.extrabees.genetics.requirements.RequirementPerson;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBeeGenome;
@@ -57,7 +57,6 @@ public class RequirementPerson implements IMutationRequirement {
@Override
public boolean fufilled(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
String ownerName = housing.getOwner().getName();
return ownerName != null && names.contains(ownerName);
return true;
}
}
@@ -8,13 +8,12 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import com.google.common.base.Optional;
import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata;
import binnie.core.util.I18N;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager;
import extrabiomes.api.Stuff;
public class PlankType {
@@ -267,13 +266,10 @@ public class PlankType {
@Override
public ItemStack getStack() {
try {
Class clss = Class.forName("extrabiomes.api.Stuff");
Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
return new ItemStack(block, 1, ordinal());
} catch (Exception e) {
if (!Mods.extraBiomes.active()) {
return null;
}
return Stuff.planks.transform(block -> new ItemStack(block, 1, ordinal())).orNull();
}
@Override
@@ -8,6 +8,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager;
@@ -17,6 +18,8 @@ import binnie.extratrees.block.decor.FenceType;
public class WoodManager {
private static List<IPlankType> allPlankTypes;
public static IPlankType getPlankType(int index) {
IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
if (wood instanceof IPlankType) {
@@ -97,16 +100,18 @@ public class WoodManager {
}
public static List<IPlankType> getAllPlankTypes() {
if (allPlankTypes != null) {
return allPlankTypes;
}
List<IPlankType> list = new ArrayList<>();
Collections.addAll(list, PlankType.ExtraTreePlanks.values());
Collections.addAll(list, PlankType.ForestryPlanks.values());
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
if (type.getStack() != null) {
list.add(type);
}
if (Mods.extraBiomes.active()) {
Collections.addAll(list, PlankType.ExtraBiomesPlank.values());
}
Collections.addAll(list, PlankType.VanillaPlanks.values());
allPlankTypes = list;
return list;
}
@@ -29,19 +29,18 @@ public class Lumbermill {
public static Map<ItemStack, ItemStack> recipes = new HashMap<>();
public static ItemStack getPlankProduct(ItemStack item) {
ItemStack stack = null;
if (Lumbermill.recipes.isEmpty()) {
calculateLumbermillProducts();
}
for (Map.Entry<ItemStack, ItemStack> entry : Lumbermill.recipes.entrySet()) {
if (entry.getKey().isItemEqual(item)) {
stack = entry.getValue().copy();
break;
ItemStack stack = entry.getValue().copy();
stack.stackSize = 6;
return stack;
}
}
stack.stackSize = 6;
return stack;
return null;
}
public static void calculateLumbermillProducts() {
@@ -1,6 +1,6 @@
package binnie.extratrees.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -366,7 +366,7 @@ for.binnie.circuit.garden.damp.neutral=Garden (Damp, Neutral)
for.binnie.circuit.garden.damp.alkaline=Garden (Damp, Alkaline)
botany.tube.name=Insulated Tube
botany.tube.cooper=Cooper
botany.tube.copper=Copper
botany.tube.tin=Tin
botany.tube.bronze=Bronze
botany.tube.iron=Iron
@@ -366,7 +366,7 @@ for.binnie.circuit.garden.damp.neutral=Сад (влажный, нейтраль
for.binnie.circuit.garden.damp.alkaline=Сад (влажный, щелочной)
botany.tube.name=изолирующая лампа
botany.tube.cooper=Медная
botany.tube.copper=Медная
botany.tube.tin=Оловяная
botany.tube.bronze=Бронзовая
botany.tube.iron=Железная
@@ -364,7 +364,7 @@ for.binnie.circuit.garden.damp.neutral=花土(潮湿,中性)
for.binnie.circuit.garden.damp.alkaline=花土(潮湿,碱性)
botany.tube.name=恒温管
botany.tube.cooper=铜
botany.tube.copper=铜
botany.tube.tin=锡
botany.tube.bronze=青铜
botany.tube.iron=铁
@@ -256,7 +256,7 @@ extrabees.genetics.allele.caveDwelling=Cave Dwelling
extrabees.genetics.allele.tolerantFlyer=Rainfall
extrabees.genetics.corrupted=Corrupted
extrabees.genetics.requirements.user=Can only be bred by %s
extrabees.genetics.requirements.user=Inspired by %s
for.genus.bees.barren=Barren
for.genus.bees.barren.description=Although initially these bees are considerably useless due to their meagre combs, they can lead onto greater things.
@@ -253,7 +253,7 @@ extrabees.genetics.allele.caveDwelling=пещерности
extrabees.genetics.allele.tolerantFlyer=дождливости
extrabees.genetics.corrupted=повреждено
extrabees.genetics.requirements.user=Может быть выведено только игроком %s
extrabees.genetics.requirements.user=Inspired by %s
# КЛАССЫ ПЧЁЛ
@@ -253,7 +253,7 @@ extrabees.genetics.allele.caveDwelling=穴居性
extrabees.genetics.allele.tolerantFlyer=耐雨飞行性
extrabees.genetics.corrupted=肮脏的
extrabees.genetics.requirements.user=Can only be bred by %s
extrabees.genetics.requirements.user=Inspired by %s
for.genus.bees.barren=荒芜
for.genus.bees.barren.description=人们因其贫瘠的蜂窝而小看这些蜜蜂,但它们仍能引发巨大的变动。
@@ -515,4 +515,4 @@ extrabees.gui.database.tab.species.further=次代突变
extrabees.gui.database.tab.branches.overview=概述
extrabees.gui.database.tab.branches.species=种
extrabees.gui.database.tab.breeder=杂交路线
extrabees.gui.database.tab.breeder=杂交路线