Compare commits

..
112 Commits
Author SHA1 Message Date
Alexander Kornilov aeb03873d8 Merge pull request #250 from KorDum/feature/lang
Added some lang zh_CN
2017-08-05 19:34:47 +03:00
kordum 25241cb7e9 Added some lang zh_CN 2017-08-05 19:31:51 +03:00
Alexander Kornilov 97e808394f Merge pull request #249 from KorDum/bugfix/issue-247
#247
2017-08-05 11:32:42 +03:00
kordum 3de24b0647 #247
Fix database doesn't show species name
Fix layout of breeder page
2017-08-05 11:28:21 +03:00
Alexander Kornilov cf518d19fb Merge pull request #242 from SeraphJACK/master-MC1.7.10
Fix #238
2017-08-04 11:02:05 +03:00
Seraph_JACK 7a3ef5ecb2 Update ItemSerum.java 2017-08-04 15:27:42 +08:00
Seraph_JACK 14459ad991 Update ItemSerumArray.java 2017-08-04 15:21:18 +08:00
Seraph_JACK 2c6273c2d9 Update ItemSerum.java 2017-08-04 15:20:36 +08:00
Seraph_JACK 186a136d9d Update en_US.lang 2017-08-04 15:16:42 +08:00
Seraph_JACK 05b0532c05 Update ItemSerumArray.java 2017-08-04 15:11:20 +08:00
Seraph_JACK 045b228020 Update en_US.lang 2017-08-04 15:10:52 +08:00
Seraph_JACK 0a08927302 Update ItemSerum.java 2017-08-04 15:10:48 +08:00
Alexander Kornilov ab0122dda2 Merge pull request #241 from KorDum/feature/readme
Feature/readme
2017-08-04 10:02:02 +03:00
SeraphJACK c0bba17d08 Fix #238 2017-08-04 14:58:05 +08:00
kordum 28869a08df Fix mine version in README 2017-08-04 09:57:09 +03:00
kordum ec2bb33ea0 Improve README.md 2017-08-04 09:56:07 +03:00
mezz 008d290136 Make gradlew executable 2017-07-28 21:19:01 -07:00
Alexander Kornilov 08404a3dd2 Merge pull request #195 from dwarfmiguo/patch-1
Update zh_CN.lang
2017-07-18 09:49:57 +03:00
Alexander Kornilov 5378ff34bf Merge pull request #219 from KorDum/bugfix/issue-218
Fix #218
2017-07-15 20:38:02 +03:00
kordum 33573ba463 Fix #218
Fix translation key
2017-07-15 20:29:11 +03:00
Alexander Kornilov 84b120e89d Merge pull request #217 from SihenZhang/master-MC1.7.10
Update zh_CN.lang, add missed l10n, and fix a typo
2017-07-15 19:44:39 +03:00
SihenZhang add9f4685d Update zh_CN.lang 2017-07-16 00:40:42 +08:00
SihenZhang 75d745b7a0 Added missing l10n & Fixed a typo 2017-07-16 00:38:47 +08:00
Alexander Kornilov e5bf29dd95 Merge pull request #215 from KorDum/bugfix/issue-212
Fix #212
2017-07-15 16:58:59 +03:00
Alexander Kornilov de5d902139 Merge pull request #214 from SihenZhang/master-MC1.7.10
Added missed l10n
2017-07-15 16:52:22 +03:00
SihenZhang f3c4551f8a Added missed l10n 2017-07-15 21:29:49 +08:00
SihenZhang 00dfeac8cb Add missing l10n 2017-07-15 21:29:06 +08:00
kordum e443efcc5a Fix #212
Fix wrong localization for Registry and Analyst
2017-07-15 16:14:40 +03:00
Alexander Kornilov f3c067f503 Merge pull request #213 from AnrDaemon/fix-bukkets
Fix misspelled buckets.
2017-07-15 15:49:13 +03:00
AnrDaemon 46567817e8 Fix misspelled buckets. 2017-07-15 15:43:03 +03:00
Alexander Kornilov 23742eab03 Merge pull request #209 from SihenZhang/master-MC1.7.10
Update zh_CN.lang
2017-07-15 09:22:27 +03:00
SihenZhang 958a76247d Update zh_CN.lang 2017-07-15 13:17:49 +08:00
SihenZhang 31803aa092 Update zh_CN.lang 2017-07-15 12:38:16 +08:00
Alexander Kornilov 766c0d5fd3 Merge pull request #206 from KorDum/feature/cleanup
[1.7.10] Code analyze and cleanup
2017-07-14 10:08:02 +03:00
kordum 6a411bb607 Code analyze and cleanup 2017-07-14 10:03:32 +03:00
Alexander Kornilov 0aa95b495a Merge pull request #205 from KorDum/bugfix/issue-204
Fix #204
2017-07-14 10:00:21 +03:00
kordum 86274906eb Fix #204
Fixed endless use of a mutagen
2017-07-14 09:55:31 +03:00
Alexander Kornilov fc7dc2c14d Merge pull request #202 from KorDum/feature/issue-78
Feature #78
2017-07-13 11:14:48 +03:00
kordum 807a8e24ed #78
Added Vanilla wood fences
2017-07-13 11:11:26 +03:00
CombatZAK 2e74ed4645 Rolled [More Binnie Fixes] changes into official mod. Crash protection against running with Butterflies disabled. Refactored Registry and Analyst recipes for performance. (#201) 2017-07-12 21:44:48 -07:00
Alexander Kornilov ebdb282c6b Merge pull request #199 from KorDum/feature/icons
[1.7.10] Redraw gears textures (thx Faerdan)
2017-07-12 12:53:18 +03:00
kordum d60f070e75 Redraw gears textures (thx Faerdan) 2017-07-12 12:50:13 +03:00
Alexander Kornilov 0b2e47d88d Merge pull request #196 from KorDum/bugfix/issue-167-2
Fix #167 (2)
2017-07-12 12:40:16 +03:00
Alexander Kornilov 6be0719a9f Merge pull request #198 from KorDum/bugfix/issue-197
Fix #197
2017-07-12 12:35:59 +03:00
kordum e9ad1bda8e Fix #197
Fix wrong name for flowers
2017-07-12 12:30:19 +03:00
kordum a15d297f8a Fix #167
Fix Binnie's machines is not animated
2017-07-12 09:56:33 +03:00
dwarfmiguo 2883900b1e Update zh_CN.lang
All lines had transl to chinese
2017-07-12 13:52:14 +08:00
Alexander Kornilov 0444201f7a Automatically remove unnecessary ground blocks from farm (#191) 2017-07-11 20:42:52 -07:00
marcin212 3e9965b750 Fixed GenepoolComponentFX 2017-07-11 12:26:27 +02:00
Alexander Kornilov e8d843eb89 Merge pull request #190 from KorDum/feature/refactoring
[1.7.10] Code impovement
2017-07-11 10:52:52 +03:00
kordum 555f44889d Fix not commited changes 2017-07-11 10:50:02 +03:00
kordum 4bca0f042d GardenLogic code impovement 2017-07-11 10:46:12 +03:00
Alexander Kornilov dc288141ac Merge pull request #189 from KorDum/bugfix/issue-188
Fix #188
2017-07-11 10:04:47 +03:00
kordum d26f4816e1 Fix #188
Removed block shrub leaves game register
2017-07-11 10:01:22 +03:00
Alexander Kornilov 79b8e3e6a4 Merge pull request #187 from KorDum/bugfix/issue-186
Fix #186
2017-07-10 19:07:16 +03:00
kordum 5e21a29d3f Fix #186
Fix crash when analyze flower in FieldKit
2017-07-10 19:03:17 +03:00
Alexander Kornilov f6e2eec09c Merge pull request #183 from KorDum/bugfix/locaization
[1.7.10] Added missing localization
2017-07-09 18:55:40 +03:00
kordum 031b077a4b Fix ru_RU lang 2017-07-09 18:52:30 +03:00
kordum 49f4c84b5d Added missing localization 2017-07-09 18:49:31 +03:00
Alexander Kornilov 09b4d5a207 Merge pull request #182 from KorDum/bugfix/weed-sound
[1.7.10] Fix weed sound on growth and break
2017-07-07 22:40:59 +03:00
kordum 68f226e07e Fix weed sound on growth and break 2017-07-07 22:36:55 +03:00
Alexander Kornilov da6ea7048a Merge pull request #179 from KorDum/bugfix/opengl
Fix 178
2017-07-06 15:36:34 +03:00
kordum d721a7e98f Fix wrong OpenGL in renderItem 2017-07-06 15:27:55 +03:00
Alexander Kornilov ce050eaa63 Merge pull request #177 from KorDum/feature/refactoring
Some small refactoring
2017-07-06 14:55:46 +03:00
kordum 0133d143f8 Some small refactoring 2017-07-06 14:35:41 +03:00
Alexander Kornilov 7cc917ae76 Merge pull request #176 from KorDum/bugfix/design-block-localization
Fix wrong wood design block localization
2017-07-06 14:33:34 +03:00
kordum 6f1d00e4f5 Fix wrong wood design block localization 2017-07-06 14:29:37 +03:00
Alexander Kornilov 2aa0b9bb8c Merge pull request #175 from KorDum/bugfix/issue-173
Fix #173
2017-07-06 13:43:59 +03:00
kordum d5d8885850 Fix #173
Fix Insulated Tube craft with shift+click stacks different tubes in one slot
2017-07-06 13:38:52 +03:00
Alexander Kornilov cb6cb3a01f Merge pull request #174 from KorDum/feature/soil-recipes
[1.7.10] Added shapeless recipe for dirt with loam, flowerbed, soil
2017-07-06 13:32:23 +03:00
kordum cd5c2b3406 Added shapeless recipe for dirt with loam, flowerbed, soil 2017-07-06 13:28:25 +03:00
Alexander Kornilov b1b06753ad Fix flower sound (#172) 2017-07-05 22:17:04 -07:00
Alexander Kornilov 5846f59d64 Fix decaying shrub leaves Fix #165 (#171) 2017-07-05 22:16:46 -07:00
Alexander Kornilov ec790c9333 Merge pull request #169 from KorDum/feature/refactoring
[1.7.10] Some code improvement
2017-07-04 19:21:42 +03:00
kordum 784fa0ad30 Some code improvement 2017-07-04 19:11:23 +03:00
Alexander Kornilov 3bd8c53273 Merge pull request #168 from KorDum/bugfix/issue-166
Fix #166
2017-07-04 11:57:57 +03:00
kordum bc10e65feb Fix wrong tree generators
Refactoring and code improvement of tree generators
2017-07-04 11:47:52 +03:00
Alexander Kornilov 3eaf99a4d1 Merge pull request #164 from 3TUSK/zh_cn_update_2nd
Update zh_CN.lang for extrabees, extratrees and genetics
2017-07-03 10:15:27 +03:00
3TUSK 7910cff956 Update zh_CN.lang for extrabees, extratrees and genetics 2017-07-03 13:20:59 +08:00
Alexander Kornilov 4ef9cd6a28 Merge pull request #161 from KorDum/bugfix/issue-25
Fix #25
2017-07-02 10:17:02 +03:00
kordum 60b881810d Merge remote-tracking branch 'binnie/master-MC1.7.10' into bugfix/issue-25 2017-07-01 10:20:00 +03:00
Alexander Kornilov c854f9b489 Merge pull request #163 from KorDum/feature/refactoring
[1.7.10] Feature/refactoring
2017-07-01 10:19:25 +03:00
kordum 4e9624daab Some refactoring and code improvement 2017-07-01 10:16:08 +03:00
kordum fac2008f14 Fix wrong OpenGL in item draw method 2017-06-29 13:40:36 +03:00
kordum 2475710a6a Refactoring custom GUI components 2017-06-29 11:25:44 +03:00
mezz e83d0e3fa6 Merge pull request #159 from KorDum/bugfix/issue-154
Fix #154
2017-06-28 00:12:03 -07:00
kordum 052997cb09 Fix #154
Fix door disappears if breaks block below
2017-06-27 12:56:37 +03:00
Alexander Kornilov ef372d4f84 Merge pull request #158 from KorDum/bugfix/localization
[1.7.10 Fix missed localization
2017-06-27 11:43:49 +03:00
kordum f215990d8a Fix wrong produce time in analyst 2017-06-27 11:40:07 +03:00
kordum f5a83016f5 Fix time format 2017-06-27 11:34:17 +03:00
kordum eab09635e9 Added missed localization 2017-06-27 11:34:07 +03:00
kordum 767ec08795 Added missed localization 2017-06-26 18:26:16 +03:00
kordum 5928473316 Added missed localization 2017-06-26 18:15:35 +03:00
kordum b5989356ce Added missed localization 2017-06-26 18:02:14 +03:00
kordum 4d1d3d1cca Added missed localization 2017-06-26 17:43:39 +03:00
kordum 0b9b0c0068 Added missed localization 2017-06-26 17:21:44 +03:00
Alexander Kornilov dccaf6d7d4 Merge pull request #156 from KorDum/bugfix/issue-155
Fix #155
2017-06-26 12:31:30 +03:00
kordum 73edb413f5 Bump version 2017-06-26 12:25:43 +03:00
kordum 303c98e443 Fix #155
Fix large lags in ContainerCraftGUI
2017-06-26 12:25:36 +03:00
mezz 868ef735b0 Fix changelog text 2017-06-24 01:23:10 -07:00
Alexander Kornilov 1d4b5f791d Merge pull request #142 from KorDum/feature/refactoring
[1.7.10] Some refactoring
2017-06-24 11:18:13 +03:00
kordum 46140e2e66 Move FieldKit from botany to genetics module 2017-06-24 10:59:51 +03:00
Alexander Kornilov c2481365b9 Merge pull request #141 from KorDum/bugfix/issue-140
Fix #140
2017-06-24 10:57:07 +03:00
kordum cc76acbf3d #140
Fix invalid allele color
2017-06-24 10:47:29 +03:00
Alexander Kornilov 8fabf206d9 Merge pull request #138 from KorDum/bugfix/issue-135
Fix #135
2017-06-22 14:58:56 +03:00
kordum dcd08c4d37 #135
Fix NPE if root is null
2017-06-22 14:53:53 +03:00
Alexander Kornilov 7d269684da Merge pull request #134 from 3TUSK/zh_cn-update
Update zh_CN.lang(s)
2017-06-21 12:38:17 +03:00
3TUSK 81210e67df Update zh_CN.lang for extrabees and genetics 2017-06-21 14:20:46 +08:00
3TUSK a66ca598af Update zh_CN.lang for binniecore and genetics 2017-06-20 21:31:38 +08:00
3TUSK a6faf817f9 Update zh_CN.lang for extrabees and genetics 2017-06-20 21:17:44 +08:00
3TUSK 1992d6e333 Update zh_CN.lang for binniecore, botany, extrabees, extratrees and genetics 2017-06-20 21:01:28 +08:00
mezz f4c6c5612a Add changelog gradle task 2017-06-18 21:16:26 -07:00
242 changed files with 4522 additions and 4215 deletions

No files matched your search

+2
View File
@@ -14,3 +14,5 @@
/saves
/options.txt
/usernamecache.json
changelog.html
+37 -4
View File
@@ -1,13 +1,46 @@
## Binnie mods
[Binnie mods](https://minecraft.curseforge.com/projects/binnies-mods/files)
====================================
This is an official fork of mod.
All builds can be found on [Jenkins](https://ci.bymarcin.com/job/Binnie-Mods-MC1.7.10/)
### What is it?
Binnie’s Mods is a suite of mods designed to expand the [Forestry](https://github.com/ForestryMC/ForestryMC) mod.
It both extends the bee and tree breeding aspect by adding many new species with varied products,
along with new features such as fully breedable flowers and genetic manipulation.
### Homepage
[Wiki](https://binnie.mods.wiki/wiki/Main_Page)
[Latest Builds for 1.7.10](https://ci.bymarcin.com/job/Binnie-Mods-MC1.7.10/)
### Mods
[![](https://binnie.mods.wiki/w/images/binnie/9/91/Extra_Bees_Header.png)](https://binnie.mods.wiki/wiki/Extra_Bees)
Extra Bees expands upon the bee breeding of Forestry by adding 107 new bee species to forestry. These bees cover a large spectrum of different effects and products, giving you the ability to produce everything from dyes to rare metal dusts purely from bees. It also adds the Apiarist Database, a tool to keep track of discovered species, mutations and traits. There are also new alveary components which help improve and streamline bee production.
[![](https://binnie.mods.wiki/w/images/binnie/5/59/Extra_Trees_Header.png)](https://binnie.mods.wiki/wiki/Extra_Trees)
Extra Trees both increases the number of tree species and adds many new aesthetic uses. There are 96 new tree species, such as Banana, Brazil nut and Douglas-fir. This comes with many new fruits as well as 35 new wooden planks. Extra Trees allows these, as well as Forestry and vanilla planks, to be combined to give doors, gates and various designs of fences. The woodworker allows planks to be combined to give patterned tiles, allowing you to build beautiful wooden floors, and the same can be done with stained glass. A group of machines such as the brewery and distillery allow you to use the fruits you grow to make a variety of wines, ciders and spirits.
[![](https://binnie.mods.wiki/w/images/binnie/3/34/Botany_Header.png)](https://binnie.mods.wiki/wiki/Botany)
Botany adds an entirely new breeding system to Forestry: flowers. There are 46 different species that can be bred, including both vanilla flowers and new ones such as Fuschia and Lilies. The colour of the flowers can be transferred and selectively bred, meaning that each flower can be one of a possible 80 different colours. These new flowers can be bred manually in small gardens using a trowel and fertiliser, with careful care taken to maintain the desired pH or moisture, or grown on the large scale in Forestry farms.
[![](https://binnie.mods.wiki/w/images/binnie/4/4e/Genetics_Header.png)](https://binnie.mods.wiki/wiki/Genetics)
Genetics is for those who want to eschew conventional breeding, and want to enter the realm of genetic manipulation. Here, genes can be isolated, sequenced and then inoculated back into different species, making it easier to obtain the perfect genome. Bees, trees, butterflies and flowers can all be manipulated in this way. They can also be acclimatised to different environments to build tolerance to hostile climates.
[![](https://binnie.mods.wiki/w/images/binnie/d/d7/Binnie_Core_Header.png)](https://binnie.mods.wiki/wiki/Binnie_Core)
Binnie Core is a mod which contains a lot of the core functionality such as networking and GUI's for the other mods. The only in game features it currently contains are the Compartments
### Warning
Removed unused (unfinished) items and blocks: Honey Crystal, Alcohol, etc.
#### Build
### Building
The master branch will always contain the latest released version with possibly some bug fixes for that version that will eventually be released.
New versions will be created in branched named like {mc_version}-{mod_version}
+14 -1
View File
@@ -9,15 +9,20 @@ buildscript {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
classpath "gradle.plugin.se.bjurr.gitchangelog:git-changelog-gradle-plugin:1.47"
}
}
apply plugin: "se.bjurr.gitchangelog.git-changelog-gradle-plugin"
apply plugin: 'forge'
version = "2.0.15"
version = "2.0.21"
if (System.getenv("BUILD_NUMBER") != null) {
version = version + "-" + System.getenv("BUILD_NUMBER")
}
@@ -53,3 +58,11 @@ processResources {
exclude 'mcmod.info'
}
}
task gitChangelogTask(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
filePath = "changelog.html"
untaggedName = "Current release ${project.version}"
fromCommit = "dbc5c1a564c39e4a9c042411d1bdbe450985ce2c"
toRef = "HEAD"
templateContent = file('changelog.mustache').getText('UTF-8')
}
+8
View File
@@ -0,0 +1,8 @@
{{#tags}}
<h3>{{name}}</h3>
<ul>
{{#commits}}
<li>{{{message}}} - {{authorName}}</li>
{{/commits}}
</ul>
{{/tags}}
Vendored Regular → Executable
View File
File mode changed.
@@ -31,8 +31,8 @@ public class ControlColorDisplay extends Control implements IControlValue<IFlowe
@Override
public void onRenderBackground() {
IArea area = getArea();
CraftGUI.Render.solid(area, -1);
CraftGUI.Render.solid(area.inset(1), 0xff000000 + getValue().getColor(false));
CraftGUI.render.solid(area, -1);
CraftGUI.render.solid(area.inset(1), 0xff000000 + getValue().getColor(false));
}
@Override
@@ -19,7 +19,7 @@ public class ControlColorOption extends ControlTextOption<IFlowerColor> {
addAttribute(WidgetAttribute.MOUSE_OVER);
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
int th = (int) CraftGUI.render.textHeight(textWidget.getValue(), textWidget.getSize().x());
int height = Math.max(20, th + 6);
setSize(new IPoint(size().x(), height));
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
@@ -31,9 +31,9 @@ public class ControlColourMixSymbol extends Control implements ITooltip {
public void onRenderBackground() {
super.onRenderBackground();
if (type == 0) {
CraftGUI.Render.texture(ControlColourMixSymbol.MutationPlus, IPoint.ZERO);
CraftGUI.render.texture(ControlColourMixSymbol.MutationPlus, IPoint.ZERO);
} else {
CraftGUI.Render.texture(ControlColourMixSymbol.MutationArrow, IPoint.ZERO);
CraftGUI.render.texture(ControlColourMixSymbol.MutationArrow, IPoint.ZERO);
}
}
@@ -13,11 +13,11 @@ import binnie.core.util.I18N;
import java.util.ArrayList;
import java.util.List;
public class PageColourMix extends PageAbstract<IFlowerColor> {
public class PageColorMix extends PageAbstract<IFlowerColor> {
ControlText title;
ControlColorMixBox list;
public PageColourMix(IWidget parent, DatabaseTab tab) {
public PageColorMix(IWidget parent, DatabaseTab tab) {
super(parent, tab);
title = new ControlTextCentered(this, 8.0f, I18N.localise("botany.gui.controls.pageColorFurtherTitle"));
list = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Further);
@@ -47,7 +47,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.species"));
createMode(FlowerMode.COLOR, new ColorModeWidget());
new PageColorMixResultant(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.resultant"));
new PageColourMix(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.further"));
new PageColorMix(getInfoPages(FlowerMode.COLOR), new DatabaseTab(Botany.instance, "colour.further"));
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(Botany.instance, "breeder"));
}
@@ -68,7 +68,7 @@ public class CircuitGarden extends BinnieCircuit {
if (info.length() > 0) {
info = " (" + info + EnumChatFormatting.RESET + ")";
}
addTooltipString("Flowers" + info);
addTooltipString(I18N.localise("botany.circuit.flowers") + info);
}
@Override
@@ -89,10 +89,28 @@ public class GardenLogic extends FarmLogic {
return stack.getItem() == Item.getItemFromBlock(Blocks.dirt);
}
private boolean maintainSoil(int x2, int y2, int z2, FarmDirection direction, int extent) {
private boolean maintainSoil(int x, int y, int z, FarmDirection direction, int extent) {
for (int i = 0; i < extent; ++i) {
Vect position = translateWithOffset(x2, y2, z2, direction, i);
if (fertilised && Gardening.isSoil(world.getBlock(position.x, position.y, position.z))) {
Vect position = translateWithOffset(x, y, z, direction, i);
boolean isSoil = Gardening.isSoil(world.getBlock(position.x, position.y, position.z));
// remove unnecessary blocks
if (!isManual && !isSoil && !isAirBlock(position)) {
Block block = world.getBlock(position.x, position.y, position.z);
if (moisture == EnumMoisture.DAMP) {
if (block != Blocks.water) {
dropBlockAsProduction(position);
}
} else if (moisture == EnumMoisture.DRY) {
if (block != Blocks.sand) {
dropBlockAsProduction(position);
}
} else {
dropBlockAsProduction(position);
}
}
if (fertilised && isSoil) {
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
if (soil.fertilise(world, position.x, position.y, position.z, EnumSoilType.FLOWERBED)) {
continue;
@@ -101,55 +119,56 @@ public class GardenLogic extends FarmLogic {
if (world.getBlock(position.x, position.y + 1, position.z) == Botany.plant) {
world.setBlockToAir(position.x, position.y + 1, position.z);
} else {
if (acidity != null && Gardening.isSoil(world.getBlock(position.x, position.y, position.z))) {
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
EnumAcidity pH = soil.getPH(world, position.x, position.y, position.z);
if (pH.ordinal() < acidity.ordinal()) {
ItemStack stack = getAvailableAlkaline();
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
continue;
}
}
continue;
}
if (pH.ordinal() > acidity.ordinal()) {
ItemStack stack = getAvailableAcid();
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
continue;
}
if (acidity != null && isSoil) {
IBlockSoil soil = (IBlockSoil) world.getBlock(position.x, position.y, position.z);
EnumAcidity pH = soil.getPH(world, position.x, position.y, position.z);
if (pH.ordinal() < acidity.ordinal()) {
ItemStack stack = getAvailableAlkaline();
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
continue;
}
}
if (!isAirBlock(position) && !world.getBlock(position.x, position.y, position.z).isReplaceable(world, position.x, position.y, position.z)) {
ItemStack block = getAsItemStack(position);
ItemStack loam = getAvailableLoam();
if (isWaste(block) && loam != null) {
produce.addAll(Blocks.dirt.getDrops(world, position.x, position.y, position.z, block.getItemDamage(), 0));
setBlock(position, Blocks.air, 0);
return trySetSoil(position, loam);
if (pH.ordinal() > acidity.ordinal()) {
ItemStack stack = getAvailableAcid();
if (stack != null && soil.setPH(world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
continue;
}
} else if (!isManual) {
if (!isWaterBlock(position)) {
if (i % 2 == 0) {
return trySetSoil(position);
}
}
}
FarmDirection cclock = FarmDirection.EAST;
if (direction == FarmDirection.EAST) {
cclock = FarmDirection.SOUTH;
} else if (direction == FarmDirection.SOUTH) {
cclock = FarmDirection.EAST;
} else if (direction == FarmDirection.WEST) {
cclock = FarmDirection.SOUTH;
}
if (!isAirBlock(position) && !world.getBlock(position.x, position.y, position.z).isReplaceable(world, position.x, position.y, position.z)) {
ItemStack block = getAsItemStack(position);
ItemStack loam = getAvailableLoam();
if (isWaste(block) && loam != null) {
produce.addAll(Blocks.dirt.getDrops(world, position.x, position.y, position.z, block.getItemDamage(), 0));
setBlock(position, Blocks.air, 0);
return trySetSoil(position, loam);
}
} else if (!isManual) {
if (!isWaterBlock(position)) {
if (i % 2 == 0) {
return trySetSoil(position);
}
Vect previous = translateWithOffset(position.x, position.y, position.z, cclock, 1);
ItemStack soil2 = getAsItemStack(previous);
if (!Gardening.isSoil(soil2.getItem())) {
trySetSoil(position);
}
FarmDirection cclock = FarmDirection.EAST;
if (direction == FarmDirection.EAST) {
cclock = FarmDirection.SOUTH;
} else if (direction == FarmDirection.SOUTH) {
cclock = FarmDirection.EAST;
} else if (direction == FarmDirection.WEST) {
cclock = FarmDirection.SOUTH;
}
Vect previous = translateWithOffset(position.x, position.y, position.z, cclock, 1);
ItemStack soil2 = getAsItemStack(previous);
if (!Gardening.isSoil(soil2.getItem())) {
trySetSoil(position);
}
}
}
@@ -278,10 +297,19 @@ public class GardenLogic extends FarmLogic {
return true;
}
private void dropBlockAsProduction(Vect position) {
ItemStack stack = new ItemStack(world.getBlock(position.x, position.y, position.z));
if (stack.getItem() == null) {
return;
}
produce.add(stack);
world.setBlockToAir(position.x, position.y, position.z);
}
@Override
public boolean isAcceptedGermling(ItemStack itemstack) {
public boolean isAcceptedGermling(ItemStack stack) {
for (IFarmable farmable : farmables) {
if (farmable.isGermling(itemstack)) {
if (farmable.isGermling(stack)) {
return true;
}
}
@@ -340,7 +368,7 @@ public class GardenLogic extends FarmLogic {
try {
IOwnable housing2 = (IOwnable) housing;
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
GameProfile prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2);
((TileEntityFlower) tile).setOwner(prof);
} catch (Exception ex) {
// ignored
@@ -36,6 +36,12 @@ public class BlockFlower extends BlockContainer {
setBlockBounds(0.5f - f, 0.0f, 0.5f - f, 0.5f + f, f * 3.0f, 0.5f + f);
setTickRandomly(true);
setBlockName("flower");
setStepSound(Block.soundTypeGrass);
}
@Override
public String getUnlocalizedName() {
return "botany.flower";
}
@Override
@@ -217,4 +223,10 @@ public class BlockFlower extends BlockContainer {
}
return hasBeenBroken;
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int meta, int side) {
return Blocks.yellow_flower.getIcon(0, 0);
}
}
@@ -22,6 +22,7 @@ public class ItemInsulatedTube extends Item {
icons = new IIcon[3];
setUnlocalizedName("insulatedTube");
setCreativeTab(CreativeTabBotany.instance);
setHasSubtypes(true);
}
public static ItemStack getInsulateStack(ItemStack stack) {
@@ -52,9 +53,9 @@ public class ItemInsulatedTube extends Item {
if (pass == 0) {
return 0xffffff;
}
return (pass == 1) ?
Material.get(stack.getItemDamage()).getColor() :
Insulate.get(stack.getItemDamage()).getColor();
return (pass == 1)
? Material.get(stack.getItemDamage()).getColor()
: Insulate.get(stack.getItemDamage()).getColor();
}
@Override
@@ -26,6 +26,7 @@ public class BlockPlant extends BlockBush {
setBlockName("plant");
setCreativeTab(CreativeTabBotany.instance);
setTickRandomly(true);
setStepSound(Block.soundTypeGrass);
}
public static boolean isWeed(IBlockAccess world, int x, int y, int z) {
@@ -111,7 +111,7 @@ public class ModuleGardening implements IInitializable {
if (fertilised) {
insulate += 3;
}
new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 0 + 128 * insulate), icon);
new CircuitGarden(moist, null, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 128 * insulate), icon);
new CircuitGarden(moist, EnumAcidity.ACID, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 1 + 128 * insulate), icon);
new CircuitGarden(moist, EnumAcidity.NEUTRAL, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 2 + 128 * insulate), icon);
new CircuitGarden(moist, EnumAcidity.ALKALINE, manual, fertilised, new ItemStack(Botany.insulatedTube, 1, 3 + 128 * insulate), icon);
@@ -132,6 +132,13 @@ public class ModuleGardening implements IInitializable {
}
}
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.soil, 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.loam, 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbed, 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.soilNoWeed, 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.loamNoWeed, 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addShapelessRecipe(new ItemStack(Blocks.dirt), new ItemStack(Botany.flowerbedNoWeed, 1, OreDictionary.WILDCARD_VALUE));
GameRegistry.addRecipe(new ShapedOreRecipe(
Botany.trowelWood,
new Object[]{
@@ -193,6 +200,7 @@ public class ModuleGardening implements IInitializable {
new ItemStack(Items.wheat_seeds),
new ItemStack(Items.wheat_seeds)
);
GameRegistry.addShapelessRecipe(BotanyItems.AshPowder.get(4), Mods.forestry.stack("ash"));
GameRegistry.addShapelessRecipe(BotanyItems.MulchPowder.get(4), Mods.forestry.stack("mulch"));
GameRegistry.addShapelessRecipe(BotanyItems.CompostPowder.get(4), Mods.forestry.stack("fertilizerBio"));
@@ -202,6 +210,7 @@ public class ModuleGardening implements IInitializable {
BotanyItems.SulphurPowder.get(4),
new Object[]{"dustSulphur"}
));
GameRegistry.addRecipe(new ShapelessOreRecipe(
new ItemStack(Botany.pigment, 2, EnumFlowerColor.BLACK.ordinal()),
new Object[]{
@@ -210,6 +219,7 @@ public class ModuleGardening implements IInitializable {
"dyeBlack"
}
));
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.SulphurPowder.get(1), 1);
ModuleGardening.queuedAcidFertilisers.put(BotanyItems.MulchPowder.get(1), 1);
ModuleGardening.queuedAcidFertilisers.put(new ItemStack(GameRegistry.findItem("Forestry", "mulch")), 2);
@@ -245,6 +255,7 @@ public class ModuleGardening implements IInitializable {
'c', Items.clay_ball,
'g', Blocks.gravel
);
for (EnumFlowerColor c : EnumFlowerColor.values()) {
ItemStack clay = new ItemStack(Botany.clay, 1, c.ordinal());
ItemStack pigment = new ItemStack(Botany.pigment, 1, c.ordinal());
@@ -252,8 +263,14 @@ public class ModuleGardening implements IInitializable {
GameRegistry.addSmelting(clay, TileEntityMetadata.getItemStack(Botany.ceramic, c.ordinal()), 0.0f);
ItemStack glass = TileEntityMetadata.getItemStack(Botany.stained, c.ordinal());
glass.stackSize = 4;
GameRegistry.addShapedRecipe(glass, " g ", "gpg", " g ", 'g', Blocks.glass, 'p', pigment);
GameRegistry.addShapedRecipe(
glass,
" g ", "gpg", " g ",
'g', Blocks.glass,
'p', pigment
);
}
GameRegistry.addRecipe(new PigmentRecipe());
}
@@ -4,6 +4,7 @@ import binnie.botany.api.IFlowerColor;
import binnie.botany.core.BotanyCore;
import binnie.core.util.I18N;
import forestry.api.genetics.IAlleleInteger;
import org.apache.commons.lang3.StringUtils;
import java.util.Locale;
@@ -97,7 +98,7 @@ public enum EnumFlowerColor implements IFlowerColor {
EnumFlowerColor(String name, int color) {
this.name = name;
this.color = color;
allele = new AlleleColor(this, "botany.color" + name(), color);
allele = new AlleleColor(this, "botany.color" + StringUtils.capitalize(name), color);
int r = color >> 16 & 0xFF;
r = (int) (0.45 * (r + 214));
int g = (int) (0.45 * (r + 174));
+1 -1
View File
@@ -1,7 +1,6 @@
package binnie.core;
import binnie.Binnie;
import binnie.botany.items.ItemFieldKit;
import binnie.core.block.MultipassBlockRenderer;
import binnie.core.block.TileEntityMetadata;
import binnie.core.craftgui.minecraft.ModuleCraftGUI;
@@ -24,6 +23,7 @@ import binnie.core.network.IPacketID;
import binnie.core.proxy.BinnieProxy;
import binnie.core.proxy.IBinnieProxy;
import binnie.core.triggers.ModuleTrigger;
import binnie.genetics.item.ItemFieldKit;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
@@ -36,10 +36,11 @@ public class ItemMetadataRenderer implements IItemRenderer {
if (type == IItemRenderer.ItemRenderType.EQUIPPED_FIRST_PERSON) {
GL11.glTranslated(0.5, 0.5, 0.5);
}
if (type == IItemRenderer.ItemRenderType.INVENTORY && block.getRenderBlockPass() != 0) {
GL11.glAlphaFunc(516, 0.1f);
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
}
GL11.glPushMatrix();
((RenderBlocks) data[0]).renderBlockAsItem(block, TileEntityMetadata.getItemDamage(item), 1.0f);
@@ -15,11 +15,11 @@ public class MultipassItemRenderer implements IItemRenderer {
GL11.glEnable(3008);
if (block.getRenderBlockPass() != 0) {
GL11.glAlphaFunc(516, 0.1f);
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
} else {
GL11.glAlphaFunc(516, 0.5f);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_BLEND);
}
MultipassBlockRenderer.instance.renderInventoryBlock(block, TileEntityMetadata.getItemDamage(item), 0, renderer);
@@ -4,6 +4,6 @@ import binnie.core.craftgui.renderer.Renderer;
import binnie.core.craftgui.resource.minecraft.CraftGUIResourceManager;
public class CraftGUI {
public static CraftGUIResourceManager ResourceManager;
public static Renderer Render;
public static CraftGUIResourceManager resourceManager;
public static Renderer render;
}
@@ -104,7 +104,7 @@ public interface IWidget {
void setCroppedZone(IWidget relative, IArea area);
boolean isCroppedWidet();
boolean isCroppedWidget();
IWidget getCropWidget();
@@ -173,7 +173,7 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
private Collection<IWidget> getQueuedWidgets(IWidget widget) {
List<IWidget> widgets = new ArrayList<>();
boolean addChildren = true;
if (widget.isCroppedWidet()) {
if (widget.isCroppedWidget()) {
addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
}
+8 -13
View File
@@ -265,7 +265,7 @@ public class Widget implements IWidget {
}
@Override
public boolean isCroppedWidet() {
public boolean isCroppedWidget() {
return cropped;
}
@@ -280,21 +280,18 @@ public class Widget implements IWidget {
return;
}
CraftGUI.Render.preRender(this);
CraftGUI.render.preRender(this);
onRender(RenderStage.PreChildren);
for (IWidget widget : getWidgets()) {
widget.render();
}
for (IWidget widget : getWidgets()) {
CraftGUI.Render.preRender(widget);
CraftGUI.render.preRender(widget);
widget.onRender(RenderStage.PostSiblings);
CraftGUI.Render.postRender(widget);
CraftGUI.render.postRender(widget);
}
onRender(RenderStage.PostChildren);
CraftGUI.Render.postRender(this);
CraftGUI.render.postRender(this);
}
@Override
@@ -308,7 +305,7 @@ public class Widget implements IWidget {
}
onUpdateClient();
List<IWidget> deletedWidgets = new ArrayList<IWidget>();
List<IWidget> deletedWidgets = new ArrayList<>();
for (IWidget widget : getWidgets()) {
if (widget.hasAttribute(WidgetAttribute.NEEDS_DELETION)) {
deletedWidgets.add(widget);
@@ -419,11 +416,9 @@ public class Widget implements IWidget {
public void onRender(RenderStage stage) {
if (stage == RenderStage.PreChildren) {
onRenderBackground();
}
if (stage == RenderStage.PostChildren) {
} else if (stage == RenderStage.PostChildren) {
onRenderForeground();
}
if (stage == RenderStage.PostSiblings) {
} else if (stage == RenderStage.PostSiblings) {
onRenderOverlay();
}
}
@@ -110,7 +110,7 @@ public class WindowFieldKit extends Window {
@Override
public void initialiseClient() {
setTitle(getName());
CraftGUI.Render.stylesheet(new StyleSheetPunnett());
CraftGUI.render.stylesheet(new StyleSheetPunnett());
getWindowInventory().createSlot(0);
getWindowInventory().createSlot(1);
setupValidators();
@@ -274,7 +274,12 @@ public class WindowFieldKit extends Window {
return;
}
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(getWindowInventory().getStackInSlot(0)));
ItemStack stack = getWindowInventory().getStackInSlot(0);
if (stack == null) {
return;
}
getWindowInventory().setInventorySlotContents(0, Analyser.analyse(stack));
getWindowInventory().decrStackSize(1, 1);
}
@@ -54,7 +54,7 @@ public class ControlButton extends Control {
} else if (isEnabled()) {
texture = CraftGUITexture.Button;
}
CraftGUI.Render.texture(texture, getArea());
CraftGUI.render.texture(texture, getArea());
}
public String getText() {
@@ -44,7 +44,7 @@ public class ControlCheckbox extends Control implements IControlValue<Boolean> {
if (isMouseOver()) {
texture = (getValue() ? CraftGUITexture.CheckboxCheckedHighlighted : CraftGUITexture.CheckboxHighlighted);
}
CraftGUI.Render.texture(texture, IPoint.ZERO);
CraftGUI.render.texture(texture, IPoint.ZERO);
}
protected void onValueChanged(boolean value) {
@@ -28,7 +28,7 @@ public class ControlText extends Control implements IControlValue<String> {
@Override
public void onRenderBackground() {
CraftGUI.Render.text(getArea(), align, text, getColor());
CraftGUI.render.text(getArea(), align, text, getColor());
}
@Override
@@ -71,7 +71,7 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.Slot, getArea());
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
renderTextField();
}
@@ -15,7 +15,7 @@ public class ControlListBox<T> extends ControlScrollableContent<ControlList<T>>
@Override
public void initialise() {
setScrollableContent(new ControlList<T>(this, 1.0f, 1.0f, w() - 2.0f - scrollBarSize, h() - 2.0f));
setScrollableContent(new ControlList<>(this, 1.0f, 1.0f, w() - 2.0f - scrollBarSize, h() - 2.0f));
addEventHandler(new EventKey.Down.Handler() {
@Override
public void onEvent(EventKey.Down event) {
@@ -46,7 +46,7 @@ public class ControlOption<T> extends Control implements IControlValue<T> {
@Override
public void onRenderForeground() {
if (isCurrentSelection()) {
CraftGUI.Render.texture(CraftGUITexture.Outline, getArea());
CraftGUI.render.texture(CraftGUITexture.Outline, getArea());
}
}
@@ -61,7 +61,7 @@ public class ControlScrollBar extends Control {
} else if (isEnabled()) {
texture = CraftGUITexture.Scroll;
}
CraftGUI.Render.texture(texture, renderArea);
CraftGUI.render.texture(texture, renderArea);
}
@Override
@@ -43,7 +43,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
texture = CraftGUITexture.Tab;
}
Texture lTexture = CraftGUI.Render.getTexture(texture);
Texture lTexture = CraftGUI.render.getTexture(texture);
Position position = getTabPosition();
Texture iTexture = lTexture.crop(position, 8.0f);
IArea area = getArea();
@@ -56,7 +56,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
}
}
CraftGUI.Render.texture(iTexture, area);
CraftGUI.render.texture(iTexture, area);
if (this instanceof ControlTabIcon) {
ControlTabIcon icon = (ControlTabIcon) this;
ControlItemDisplay item = (ControlItemDisplay) getWidgets().get(0);
@@ -67,10 +67,10 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
}
if (icon.hasOutline()) {
iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
iTexture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline);
iTexture = iTexture.crop(position, 8.0f);
CraftGUI.Render.color(icon.getOutlineColor());
CraftGUI.Render.texture(iTexture, area.inset(2));
CraftGUI.render.color(icon.getOutlineColor());
CraftGUI.render.texture(iTexture, area.inset(2));
}
}
}
@@ -25,10 +25,10 @@ class ControlBreedingProgress extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
CraftGUI.render.texture(CraftGUITexture.PanelBlack, getArea());
IArea area = getArea().inset(1);
area.setSize(new IPoint(area.size().x() * percentage, area.size().y()));
CraftGUI.Render.color(colour);
CraftGUI.Render.texture(ControlBreedingProgress.Progress, area);
CraftGUI.render.color(colour);
CraftGUI.render.texture(ControlBreedingProgress.Progress, area);
}
}
@@ -81,7 +81,7 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
break;
}
if (icon != null) {
CraftGUI.Render.iconItem(IPoint.ZERO, icon);
CraftGUI.render.iconItem(IPoint.ZERO, icon);
}
}
@@ -93,11 +93,8 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
switch (discovered) {
case SHOW:
tooltip.add(species.getName());
break;
case DISCOVERED:
tooltip.add(I18N.localise("binniecore.gui.database.discovered.discovered"));
tooltip.add(species.getName());
break;
case UNDISCOVERED:
@@ -22,7 +22,7 @@ public class ControlItemStackOption extends ControlTextOption<ItemStack> {
addAttribute(WidgetAttribute.MOUSE_OVER);
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
int th = (int) CraftGUI.render.textHeight(textWidget.getValue(), textWidget.getSize().x());
int height = Math.max(20, th + 6);
setSize(new IPoint(size().x(), height));
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
@@ -26,9 +26,9 @@ class ControlMutationSymbol extends Control implements ITooltip {
public void onRenderBackground() {
super.onRenderBackground();
if (type == 0) {
CraftGUI.Render.texture(ControlMutationSymbol.MutationPlus, IPoint.ZERO);
CraftGUI.render.texture(ControlMutationSymbol.MutationPlus, IPoint.ZERO);
} else {
CraftGUI.Render.texture(ControlMutationSymbol.MutationArrow, IPoint.ZERO);
CraftGUI.render.texture(ControlMutationSymbol.MutationArrow, IPoint.ZERO);
}
}
@@ -29,7 +29,7 @@ class ControlSpeciesBoxOption extends ControlTextOption<IAlleleSpecies> {
CraftGUIUtil.moveWidget(textWidget, new IPoint(22.0f, 0.0f));
textWidget.setSize(textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
int th = (int) CraftGUI.Render.textHeight(textWidget.getValue(), textWidget.getSize().x());
int th = (int) CraftGUI.render.textHeight(textWidget.getValue(), textWidget.getSize().x());
int height = Math.max(20, th + 6);
setSize(new IPoint(size().x(), height));
textWidget.setSize(new IPoint(textWidget.getSize().x(), height));
@@ -56,7 +56,7 @@ public class PageBranchOverview extends PageBranch {
StringBuilder line = new StringBuilder();
List<String> descLines = new ArrayList<>();
for (String str : desc.split(" ")) {
if (CraftGUI.Render.textWidth(line + " " + str) > 134) {
if (CraftGUI.render.textWidth(line + " " + str) > 134) {
descLines.add(EnumChatFormatting.ITALIC + line.toString() + EnumChatFormatting.RESET);
line = new StringBuilder();
}
@@ -31,11 +31,11 @@ public class PageBreeder extends ControlPage<DatabaseTab> {
);
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.species.count", system.discoveredSpeciesCount, system.totalSpeciesCount));
new ControlBreedingProgress(this, 20, 87, 102, 14, system, system.discoveredSpeciesPercentage);
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.branch.count", system.discoveredBranchCount, system.totalBranchCount));
new ControlTextCentered(this, 115.0f, I18N.localise("binniecore.gui.database.branch.count", system.discoveredBranchCount, system.totalBranchCount));
new ControlBreedingProgress(this, 20, 127, 102, 14, system, system.discoveredBranchPercentage);
if (system.discoveredSecretCount > 0) {
new ControlTextCentered(this, 75.0f, I18N.localise("binniecore.gui.database.species.secretCount", system.discoveredSecretCount, system.totalSecretCount));
new ControlTextCentered(this, 155.0f, I18N.localise("binniecore.gui.database.species.secretCount", system.discoveredSecretCount, system.totalSecretCount));
}
new ControlTextCentered(this, 32.0f, player.getName());
@@ -64,7 +64,7 @@ public class PageSpeciesOverview extends PageSpecies {
controlDescription.setValue(descBody + EnumChatFormatting.RESET);
controlSignature.setValue(descSig + EnumChatFormatting.RESET);
float descHeight = CraftGUI.Render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
float descHeight = CraftGUI.render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0f));
}
}
@@ -119,7 +119,7 @@ public abstract class WindowAbstractDatabase extends Window {
widgets.listBox.setValidator(new IValidator<IWidget>() {
@Override
public boolean isValid(IWidget object) {
return event.getValue() == "" || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
return event.getValue().isEmpty() || ((ControlTextOption) object).getText().toLowerCase().contains(event.getValue().toLowerCase());
}
});
}
@@ -143,7 +143,9 @@ public class ContainerCraftGUI extends Container {
@Override
public boolean canInteractWith(EntityPlayer player) {
if (player instanceof EntityPlayerMP) {
crafters.add(player);
if (!crafters.contains(player)) {
crafters.add(player);
}
sentNBT.clear();
}
IInventory inventory = window.getInventory();
@@ -26,9 +26,9 @@ public abstract class Dialog extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.gradientRect(getArea().outset(400), -1442840576, -1442840576);
CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, getArea().inset(4));
CraftGUI.render.gradientRect(getArea().outset(400), -1442840576, -1442840576);
CraftGUI.render.texture(CraftGUITexture.Window, getArea());
CraftGUI.render.texture(CraftGUITexture.TabOutline, getArea().inset(4));
}
@Override
@@ -1,7 +1,6 @@
package binnie.core.craftgui.minecraft;
import binnie.core.BinnieCore;
import binnie.core.craftgui.CraftGUI;
import binnie.core.craftgui.IWidget;
import binnie.core.craftgui.Tooltip;
import binnie.core.craftgui.events.EventKey;
@@ -77,10 +76,10 @@ public class GuiCraftGUI extends GuiContainer {
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
drawDefaultBackground();
GL11.glDisable(32826);
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2896);
GL11.glDisable(2929);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
zLevel = 10.0f;
GuiScreen.itemRender.zLevel = zLevel;
@@ -88,18 +87,18 @@ public class GuiCraftGUI extends GuiContainer {
RenderHelper.enableGUIStandardItemLighting();
GL11.glPushMatrix();
GL11.glEnable(32826);
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
InventoryPlayer playerInventory = mc.thePlayer.inventory;
draggedItem = playerInventory.getItemStack();
if (draggedItem != null) {
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, 200, false);
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, 200, false);
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
}
GL11.glDisable(32826);
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
GL11.glPopMatrix();
GL11.glDisable(2896);
GL11.glDisable(2929);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
MinecraftTooltip tooltip = new MinecraftTooltip();
if (isHelpMode()) {
tooltip.setType(Tooltip.Type.HELP);
@@ -108,24 +107,26 @@ public class GuiCraftGUI extends GuiContainer {
tooltip.setType(Tooltip.Type.STANDARD);
window.getTooltip(tooltip);
}
if (tooltip.exists()) {
renderTooltip(new IPoint(mouseX, mouseY), tooltip);
}
zLevel = 0.0f;
GL11.glEnable(2896);
GL11.glEnable(2929);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
public void renderTooltip(IPoint mousePosition, MinecraftTooltip tooltip) {
int mouseX = (int) mousePosition.x();
int mouseY = (int) mousePosition.y();
FontRenderer font = getFontRenderer();
GL11.glDisable(32826);
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2896);
GL11.glDisable(2929);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
int k = 0;
List<String> strings = new ArrayList<String>();
List<String> strings = new ArrayList<>();
for (String string : tooltip.getList()) {
if (string != null) {
if (!string.contains("~~~")) {
@@ -135,6 +136,7 @@ public class GuiCraftGUI extends GuiContainer {
}
}
}
for (String s : strings) {
int l = font.getStringWidth(s);
if (s.contains("~~~")) {
@@ -144,6 +146,7 @@ public class GuiCraftGUI extends GuiContainer {
k = l;
}
}
int i1 = mouseX + 12;
int j1 = mouseY - 12;
int k2 = 8;
@@ -158,9 +161,10 @@ public class GuiCraftGUI extends GuiContainer {
}
zLevel = 300.0f;
GuiScreen.itemRender.zLevel = 300.0f;
int l2 = -267386864;
int l2 = 0xf0100010;
int j2;
int i2 = j2 = 1342177280 + MinecraftTooltip.getOutline(tooltip.getType());
int i2 = j2 = 0x50000000 + MinecraftTooltip.getOutline(tooltip.getType());
drawGradientRect(i1 - 3, j1 - 4, i1 + k + 3, j1 - 3, l2, l2);
drawGradientRect(i1 - 3, j1 + k2 + 3, i1 + k + 3, j1 + k2 + 4, l2, l2);
drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 + k2 + 3, l2, l2);
@@ -170,6 +174,7 @@ public class GuiCraftGUI extends GuiContainer {
drawGradientRect(i1 + k + 2, j1 - 3 + 1, i1 + k + 3, j1 + k2 + 3 - 1, i2, j2);
drawGradientRect(i1 - 3, j1 - 3, i1 + k + 3, j1 - 3 + 1, i2, i2);
drawGradientRect(i1 - 3, j1 + k2 + 2, i1 + k + 3, j1 + k2 + 3, j2, j2);
for (int k3 = 0; k3 < strings.size(); ++k3) {
String s2 = strings.get(k3);
if (k3 == 0) {
@@ -177,6 +182,7 @@ public class GuiCraftGUI extends GuiContainer {
} else {
s2 = MinecraftTooltip.getBody(tooltip.getType()) + s2;
}
if (s2.contains("~~~")) {
String split = s2.split("~~~")[1];
try {
@@ -192,18 +198,20 @@ public class GuiCraftGUI extends GuiContainer {
}
s2 = " " + s2.replaceAll("~~~(.*?)~~~", "");
}
font.drawStringWithShadow(s2, i1, j1, -1);
if (k3 == 0) {
j1 += 2;
}
j1 += 10;
}
zLevel = 0.0f;
GuiScreen.itemRender.zLevel = 0.0f;
GL11.glEnable(2896);
GL11.glEnable(2929);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
RenderHelper.enableStandardItemLighting();
GL11.glEnable(32826);
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
}
@Override
@@ -215,10 +223,6 @@ public class GuiCraftGUI extends GuiContainer {
window.callEvent(new EventMouse.Down(origin, x, y, button));
}
public boolean isShiftDown() {
return Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode());
}
@Override
protected void keyTyped(char c, int key) {
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
@@ -231,10 +235,7 @@ public class GuiCraftGUI extends GuiContainer {
@Override
protected void mouseMovedOrUp(int x, int y, int button) {
IWidget origin = (window.getMousedOverWidget() == null) ? window : window.getMousedOverWidget();
if (button == -1) {
float dx = Mouse.getEventDX() * width / (float) mc.displayWidth;
float dy = -(Mouse.getEventDY() * height / (float) mc.displayHeight);
} else {
if (button != -1) {
window.callEvent(new EventMouse.Up(origin, x, y, button));
}
}
@@ -243,7 +244,6 @@ public class GuiCraftGUI extends GuiContainer {
public void handleMouseInput() {
super.handleMouseInput();
int dWheel = Mouse.getDWheel();
IWidget origin = (window.getFocusedWidget() == null) ? window : window.getFocusedWidget();
if (dWheel != 0) {
window.callEvent(new EventMouse.Wheel(window, dWheel));
}
@@ -254,16 +254,15 @@ public class GuiCraftGUI extends GuiContainer {
window.onClose();
}
public void renderTexturedRect(float x, float y, float u, float v, float w, float h) {
drawTexturedModalRect((int) x, (int) y, (int) u, (int) v, (int) w, (int) h);
}
public void renderTexture(IPoint position, IArea textureArea) {
drawTexturedModalRect((int) position.x(), (int) position.y(), (int) textureArea.pos().x(), (int) textureArea.pos().y(), (int) textureArea.size().x(), (int) textureArea.size().y());
}
private void renderTexturedRect(IArea area, IPoint uv) {
renderTexturedRect(area.pos().x(), area.pos().y(), uv.x(), uv.y(), area.size().x(), area.size().y());
drawTexturedModalRect(
(int) position.x(),
(int) position.y(),
(int) textureArea.pos().x(),
(int) textureArea.pos().y(),
(int) textureArea.size().x(),
(int) textureArea.size().y()
);
}
public void renderTexturePadded(IArea area, IArea texture, IBorder padding) {
@@ -279,19 +278,22 @@ public class GuiCraftGUI extends GuiContainer {
int textHeight = (int) texture.h();
int u = (int) texture.x();
int v = (int) texture.y();
if (borderTop + borderBottom > height) {
borderTop = height / 2;
borderBottom = height / 2;
}
if (borderLeft + borderRight > width) {
borderLeft = width / 2;
borderRight = width / 2;
}
IPoint origin = area.pos();
drawTexturedModalRect(posX, posY, u, v, borderLeft, borderTop);
drawTexturedModalRect(posX + width - borderRight, posY, u + textWidth - borderRight, v, borderRight, borderTop);
drawTexturedModalRect(posX, posY + height - borderBottom, u, v + textHeight - borderBottom, borderLeft, borderBottom);
drawTexturedModalRect(posX + width - borderRight, posY + height - borderBottom, u + textWidth - borderRight, v + textHeight - borderBottom, borderRight, borderBottom);
int texturingWidth;
for (int currentXPos = borderLeft; currentXPos < width - borderRight; currentXPos += texturingWidth) {
int distanceXRemaining = width - borderRight - currentXPos;
@@ -299,9 +301,11 @@ public class GuiCraftGUI extends GuiContainer {
if (texturingWidth > distanceXRemaining) {
texturingWidth = distanceXRemaining;
}
if (texturingWidth <= 0) {
break;
}
drawTexturedModalRect(posX + currentXPos, posY, u + borderLeft, v, texturingWidth, borderTop);
drawTexturedModalRect(posX + currentXPos, posY + height - borderBottom, u + borderLeft, v + textHeight - borderBottom, texturingWidth, borderBottom);
int texturingHeight;
@@ -317,6 +321,7 @@ public class GuiCraftGUI extends GuiContainer {
drawTexturedModalRect(posX + currentXPos, posY + currentYPos, u + borderLeft, v + borderTop, texturingWidth, texturingHeight);
}
}
int texturingHeight2;
for (int currentYPos2 = borderTop; currentYPos2 < height - borderBottom; currentYPos2 += texturingHeight2) {
int distanceYRemaining2 = height - borderBottom - currentYPos2;
@@ -324,6 +329,7 @@ public class GuiCraftGUI extends GuiContainer {
if (texturingHeight2 > distanceYRemaining2) {
texturingHeight2 = distanceYRemaining2;
}
if (texturingHeight2 <= 0) {
break;
}
@@ -332,86 +338,84 @@ public class GuiCraftGUI extends GuiContainer {
}
}
public void drawGradientArea(float p_73733_1_, float p_73733_2_, float p_73733_3_, float p_73733_4_, int p_73733_5_, int p_73733_6_) {
float f = (p_73733_5_ >> 24 & 0xFF) / 255.0f;
float f2 = (p_73733_5_ >> 16 & 0xFF) / 255.0f;
float f3 = (p_73733_5_ >> 8 & 0xFF) / 255.0f;
float f4 = (p_73733_5_ & 0xFF) / 255.0f;
float f5 = (p_73733_6_ >> 24 & 0xFF) / 255.0f;
float f6 = (p_73733_6_ >> 16 & 0xFF) / 255.0f;
float f7 = (p_73733_6_ >> 8 & 0xFF) / 255.0f;
float f8 = (p_73733_6_ & 0xFF) / 255.0f;
GL11.glDisable(3553);
GL11.glEnable(3042);
GL11.glDisable(3008);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glShadeModel(7425);
public void drawGradientArea(float x, float y, float width, float height, int color1, int color2) {
float alpha1 = (color1 >> 24 & 0xFF) / 255.0f;
float r1 = (color1 >> 16 & 0xFF) / 255.0f;
float b1 = (color1 >> 8 & 0xFF) / 255.0f;
float g1 = (color1 & 0xFF) / 255.0f;
float alpha2 = (color2 >> 24 & 0xFF) / 255.0f;
float r2 = (color2 >> 16 & 0xFF) / 255.0f;
float g2 = (color2 >> 8 & 0xFF) / 255.0f;
float b2 = (color2 & 0xFF) / 255.0f;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorRGBA_F(f2, f3, f4, f);
tessellator.addVertex(p_73733_3_, p_73733_2_, zLevel);
tessellator.addVertex(p_73733_1_, p_73733_2_, zLevel);
tessellator.setColorRGBA_F(f6, f7, f8, f5);
tessellator.addVertex(p_73733_1_, p_73733_4_, zLevel);
tessellator.addVertex(p_73733_3_, p_73733_4_, zLevel);
tessellator.setColorRGBA_F(r1, b1, g1, alpha1);
tessellator.addVertex(width, y, zLevel);
tessellator.addVertex(x, y, zLevel);
tessellator.setColorRGBA_F(r2, g2, b2, alpha2);
tessellator.addVertex(x, height, zLevel);
tessellator.addVertex(width, height, zLevel);
tessellator.draw();
GL11.glShadeModel(7424);
GL11.glDisable(3042);
GL11.glEnable(3008);
GL11.glEnable(3553);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
public void renderItem(IPoint pos, ItemStack item, boolean rotating) {
renderItem(pos, item, (int) zLevel + 3, rotating);
}
private void renderItem(IPoint pos, ItemStack item, int zLevel, boolean rotating) {
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
GL11.glPushMatrix();
GL11.glPushAttrib(8256);
RenderHelper.enableGUIStandardItemLighting();
GL11.glEnable(32826);
GL11.glEnable(2929);
GL11.glEnable(GL11.GL_DEPTH_TEST);
FontRenderer font = item.getItem().getFontRenderer(item);
if (font == null) {
font = getFontRenderer();
}
if (item != null) {
BinnieCore.proxy.getMinecraftInstance();
float phase = Minecraft.getSystemTime() / 20.0f;
BinnieCore.proxy.getMinecraftInstance();
float phase = Minecraft.getSystemTime() / 20.0f;
if (rotating) {
GL11.glPushMatrix();
if (rotating) {
GL11.glTranslatef(8.0f, 8.0f, 0.0f);
GL11.glRotatef(phase, 0.0f, -0.866f, 0.5f);
GL11.glTranslatef(-8.0f, -8.0f, -67.1f);
}
GuiScreen.itemRender.renderItemAndEffectIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y());
GL11.glPopMatrix();
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
GL11.glTranslatef(8.0f, 8.0f, 0.0f);
GL11.glRotatef(phase, 0.0f, -0.866f, 0.5f);
GL11.glTranslatef(-8.0f, -8.0f, -67.1f);
}
GuiScreen.itemRender.renderItemAndEffectIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y());
if (rotating) {
GL11.glPopMatrix();
}
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
GL11.glClear(256);
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
RenderHelper.disableStandardItemLighting();
CraftGUI.Render.color(-1);
GL11.glEnable(32826);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
public void renderIcon(IPoint pos, IIcon icon, ResourceLocation map) {
if (icon == null) {
return;
}
GL11.glPushMatrix();
GL11.glEnable(32826);
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
BinnieCore.proxy.bindTexture(map);
GuiScreen.itemRender.zLevel = zLevel;
GuiScreen.itemRender.renderIcon((int) pos.x(), (int) pos.y(), icon, 16, 16);
GL11.glEnable(32826);
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
GL11.glPopMatrix();
}
public boolean isHelpMode() {
return Keyboard.isKeyDown(15);
return Keyboard.isKeyDown(Keyboard.KEY_TAB);
}
public FontRenderer getFontRenderer() {
@@ -432,47 +436,42 @@ public class GuiCraftGUI extends GuiContainer {
float w = area.size().x();
float h = area.size().y();
y = height - (y + h);
float k = xSize;
float scaleX = width / (float) mc.displayWidth;
float scaleY = height / (float) mc.displayHeight;
x += 0.0f;
y += 0.0f;
w += 0.0f;
h += 0.0f;
GL11.glScissor((int) (x / scaleX), (int) (y / scaleY), (int) (w / scaleX), (int) (h / scaleY));
}
public int getZLevel() {
return (int) zLevel;
}
public void drawRect(float x, float y, float width, float height, int color) {
if (x < width) {
float temp = x;
x = width;
width = temp;
}
public void drawRect(float p_73734_0_, float p_73734_1_, float p_73734_2_, float p_73734_3_, int p_73734_4_) {
if (p_73734_0_ < p_73734_2_) {
float j1 = p_73734_0_;
p_73734_0_ = p_73734_2_;
p_73734_2_ = j1;
if (y < height) {
float temp = y;
y = height;
height = temp;
}
if (p_73734_1_ < p_73734_3_) {
float j1 = p_73734_1_;
p_73734_1_ = p_73734_3_;
p_73734_3_ = j1;
}
float f3 = (p_73734_4_ >> 24 & 0xFF) / 255.0f;
float f4 = (p_73734_4_ >> 16 & 0xFF) / 255.0f;
float f5 = (p_73734_4_ >> 8 & 0xFF) / 255.0f;
float f6 = (p_73734_4_ & 0xFF) / 255.0f;
float alpha = (color >> 24 & 0xFF) / 255.0f;
float r = (color >> 16 & 0xFF) / 255.0f;
float g = (color >> 8 & 0xFF) / 255.0f;
float b = (color & 0xFF) / 255.0f;
Tessellator tessellator = Tessellator.instance;
GL11.glEnable(3042);
GL11.glDisable(3553);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glColor4f(f4, f5, f6, f3);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GL11.glColor4f(r, g, b, alpha);
tessellator.startDrawingQuads();
tessellator.addVertex(p_73734_0_, p_73734_3_, 0.0);
tessellator.addVertex(p_73734_2_, p_73734_3_, 0.0);
tessellator.addVertex(p_73734_2_, p_73734_1_, 0.0);
tessellator.addVertex(p_73734_0_, p_73734_1_, 0.0);
tessellator.addVertex(x, height, 0.0);
tessellator.addVertex(width, height, 0.0);
tessellator.addVertex(width, y, 0.0);
tessellator.addVertex(x, y, 0.0);
tessellator.draw();
GL11.glEnable(3553);
GL11.glDisable(3042);
GL11.glColor4f(1, 1, 1, 255);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
}
@@ -11,7 +11,7 @@ class ListMap<T> implements List<T> {
private LinkedHashMap<Integer, T> map;
ListMap() {
map = new LinkedHashMap<Integer, T>();
map = new LinkedHashMap<>();
}
@Override
@@ -78,8 +78,8 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
ControlSlot.highlighting.put(h, new ArrayList<>());
}
CraftGUI.Render = new Renderer(gui);
CraftGUI.Render.stylesheet(StyleSheetManager.getDefault());
CraftGUI.render = new Renderer(gui);
CraftGUI.render.stylesheet(StyleSheetManager.getDefault());
titleButtonLeft = -14.0f;
if (showHelpButton()) {
@@ -211,15 +211,15 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
@Override
public void onRenderBackground() {
CraftGUI.Render.color(0xffffff);
CraftGUI.render.color(0xffffff);
if (getBackground1() != null) {
CraftGUI.Render.texture(getBackground1(), IPoint.ZERO);
CraftGUI.render.texture(getBackground1(), IPoint.ZERO);
}
if (getBackground2() != null) {
CraftGUI.Render.texture(getBackground2(), new IPoint(256.0f, 0.0f));
CraftGUI.render.texture(getBackground2(), new IPoint(256.0f, 0.0f));
}
CraftGUI.Render.color(getColor());
CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
CraftGUI.render.color(getColor());
CraftGUI.render.texture(CraftGUITexture.Window, getArea());
}
@Override
@@ -85,9 +85,9 @@ public class ControlEnergyBar extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarBack, getArea());
float percentage = getPercentage() / 100.0f;
CraftGUI.Render.color(getColourFromPercentage(percentage));
CraftGUI.render.color(getColourFromPercentage(percentage));
IArea area = getArea();
switch (direction) {
@@ -106,27 +106,27 @@ public class ControlEnergyBar extends Control implements ITooltip {
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
} else if (ControlEnergyBar.isError) {
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR);
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
}
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlow, area);
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlow, area);
GL11.glColor3d(1.0, 1.0, 1.0);
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlass, getArea());
}
@Override
public void onRenderForeground() {
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
IArea area = getArea();
CraftGUI.Render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
} else if (ControlEnergyBar.isError) {
IArea area = getArea();
CraftGUI.Render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
}
@@ -32,7 +32,7 @@ public class ControlErrorState extends Control implements ITooltip {
} else if (type == 0) {
texture = CraftGUITexture.StateError;
}
CraftGUI.Render.texture(texture, IPoint.ZERO);
CraftGUI.render.texture(texture, IPoint.ZERO);
super.onRenderBackground();
}
@@ -17,7 +17,7 @@ public class ControlHelp extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.HelpButton, getArea());
CraftGUI.render.texture(CraftGUITexture.HelpButton, getArea());
}
@Override
@@ -16,6 +16,6 @@ public class ControlIconDisplay extends Control {
@Override
public void onRenderForeground() {
CraftGUI.Render.iconItem(IPoint.ZERO, icon);
CraftGUI.render.iconItem(IPoint.ZERO, icon);
}
}
@@ -16,6 +16,6 @@ public class ControlImage extends Control {
@Override
public void onRenderForeground() {
CraftGUI.Render.texture(key, IPoint.ZERO);
CraftGUI.render.texture(key, IPoint.ZERO);
}
}
@@ -20,7 +20,7 @@ public class ControlInfo extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.InfoButton, getArea());
CraftGUI.render.texture(CraftGUITexture.InfoButton, getArea());
}
@Override
@@ -60,10 +60,10 @@ public class ControlItemDisplay extends Control implements ITooltip {
GL11.glScalef(scale, scale, 1.0f);
BinnieCore.proxy.getMinecraftInstance();
float phase = Minecraft.getSystemTime() / 20.0f;
CraftGUI.Render.item(IPoint.ZERO, itemStack, rotating);
CraftGUI.render.item(IPoint.ZERO, itemStack, rotating);
GL11.glPopMatrix();
} else {
CraftGUI.Render.item(IPoint.ZERO, itemStack, rotating);
CraftGUI.render.item(IPoint.ZERO, itemStack, rotating);
}
}
@@ -72,18 +72,18 @@ public class ControlLiquidTank extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
CraftGUI.render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
int c = 0xaa000000 + MinecraftTooltip.getOutline(Tooltip.Type.HELP);
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
} else if (ControlLiquidTank.tankError.contains(tankID)) {
int c = 0xaa000000 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR);
CraftGUI.Render.gradientRect(getArea().inset(1), c, c);
CraftGUI.render.gradientRect(getArea().inset(1), c, c);
} else if (getSuperParent().getMousedOverWidget() == this) {
if (Window.get(this).getGui().getDraggedItem() != null) {
CraftGUI.Render.gradientRect(getArea().inset(1), 0xaaff9999, 0xaaff9999);
CraftGUI.render.gradientRect(getArea().inset(1), 0xaaff9999, 0xaaff9999);
} else {
CraftGUI.Render.gradientRect(getArea().inset(1), 0x80ffffff, 0x80ffffff);
CraftGUI.render.gradientRect(getArea().inset(1), 0x80ffffff, 0x80ffffff);
}
}
@@ -96,8 +96,8 @@ public class ControlLiquidTank extends Control implements ITooltip {
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
IPoint pos = getAbsolutePosition();
IPoint offset = new IPoint(0.0f, height - squaled);
IArea limited = getArea().inset(1);
@@ -105,34 +105,35 @@ public class ControlLiquidTank extends Control implements ITooltip {
limited.setSize(new IPoint(limited.w() - 1.0f, limited.h()));
}
CraftGUI.Render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)));
GL11.glEnable(3089);
CraftGUI.render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)));
GL11.glEnable(GL11.GL_SCISSOR_TEST);
BinnieCore.proxy.bindTexture(TextureMap.locationItemsTexture);
for (int y = 0; y < height; y += 16) {
for (int x = 0; x < (horizontal ? 58 : 16); x += 16) {
IIcon icon = fluid.getIcon();
CraftGUI.Render.iconBlock(new IPoint(1 + x, 1 + y), icon);
CraftGUI.render.iconBlock(new IPoint(x + 1, y + 1), icon);
}
}
GL11.glDisable(3089);
GL11.glDisable(3042);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1, 1, 1, 1.0f);
}
}
@Override
public void onRenderForeground() {
CraftGUI.Render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
CraftGUI.render.texture(horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
if (isMouseOver() && Window.get(this).getGui().isHelpMode()) {
IArea area = getArea();
CraftGUI.Render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.color(MinecraftTooltip.getOutline(Tooltip.Type.HELP));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
if (ControlLiquidTank.tankError.contains(tankID)) {
IArea area = getArea();
CraftGUI.Render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.color(MinecraftTooltip.getOutline(MinecraftTooltip.Type.ERROR));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
}
@@ -21,7 +21,7 @@ public class ControlPowerSystem extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.PowerButton, getArea());
CraftGUI.render.texture(CraftGUITexture.PowerButton, getArea());
}
@Override
@@ -20,7 +20,7 @@ public class ControlProgress extends ControlProgressBase {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(progressBlank, getArea());
CraftGUI.Render.texturePercentage(progressBar, getArea(), direction, progress);
CraftGUI.render.texture(progressBlank, getArea());
CraftGUI.render.texturePercentage(progressBar, getArea(), direction, progress);
}
}
@@ -37,17 +37,17 @@ public class ControlSlide extends Control {
public void onRenderBackground() {
super.onRenderBackground();
if (label != null) {
float lw = CraftGUI.Render.textWidth(label) + 16;
float lh = CraftGUI.Render.textHeight() + 16;
float lw = CraftGUI.render.textWidth(label) + 16;
float lh = CraftGUI.render.textHeight() + 16;
boolean hor = anchor.x() != 0;
IArea ar = isSlideActive() ? expanded : shrunk;
IArea tabArea = new IArea(hor ? (-lh / 2.0f) : (-lw / 2.0f), hor ? (-lw / 2.0f) : (-lh / 2.0f), hor ? lh : lw, hor ? lw : lh);
IPoint shift = new IPoint(ar.w() * (1 - anchor.x()) / 2.0f, ar.h() * (1 - anchor.y()) / 2.0f);
tabArea = tabArea.shift(shift.x() - (-3.0f + lh / 2.0f) * anchor.x(), shift.y() - (-3.0f + lh / 2.0f) * anchor.y());
Texture texture = CraftGUI.Render.getTexture(isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(anchor.opposite(), 8.0f);
CraftGUI.Render.texture(texture, tabArea);
texture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline).crop(anchor.opposite(), 8.0f);
CraftGUI.Render.texture(texture, tabArea.inset(2));
Texture texture = CraftGUI.render.getTexture(isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(anchor.opposite(), 8.0f);
CraftGUI.render.texture(texture, tabArea);
texture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline).crop(anchor.opposite(), 8.0f);
CraftGUI.render.texture(texture, tabArea.inset(2));
IArea labelArea = new IArea(-lw / 2.0f, 0.0f, lw, lh);
GL11.glPushMatrix();
GL11.glTranslatef(shift.x() + anchor.x() * 2.0f, shift.y() + anchor.y() * 2.0f, 0.0f);
@@ -57,12 +57,12 @@ public class ControlSlide extends Control {
if (anchor.y() > 0) {
GL11.glTranslatef(0.0f, -lh, 0.0f);
}
CraftGUI.Render.text(labelArea, TextJustification.MIDDLE_CENTER, label, 16777215);
CraftGUI.render.text(labelArea, TextJustification.MIDDLE_CENTER, label, 16777215);
GL11.glPopMatrix();
}
CraftGUI.Render.texture(CraftGUITexture.Window, getArea());
CraftGUI.render.texture(CraftGUITexture.Window, getArea());
Object slideTexture = (anchor == Position.BOTTOM) ? CraftGUITexture.SlideDown : ((anchor == Position.TOP) ? CraftGUITexture.SlideUp : ((anchor == Position.LEFT) ? CraftGUITexture.SlideLeft : CraftGUITexture.SlideRight));
CraftGUI.Render.texture(slideTexture, new IPoint((anchor.x() + 1.0f) * w() / 2.0f - 8.0f, (anchor.y() + 1.0f) * h() / 2.0f - 8.0f));
CraftGUI.render.texture(slideTexture, new IPoint((anchor.x() + 1.0f) * w() / 2.0f - 8.0f, (anchor.y() + 1.0f) * h() / 2.0f - 8.0f));
}
public boolean isSlideActive() {
@@ -66,7 +66,7 @@ public class ControlSlot extends ControlSlotBase {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.Slot, IPoint.ZERO);
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
if (slot == null) {
return;
}
@@ -75,7 +75,7 @@ public class ControlSlot extends ControlSlotBase {
if (islot != null && islot.getValidator() != null) {
IIcon icon = islot.getValidator().getIcon(!islot.getInputSides().isEmpty());
if (icon != null) {
CraftGUI.Render.iconItem(new IPoint(1.0f, 1.0f), icon);
CraftGUI.render.iconItem(new IPoint(1.0f, 1.0f), icon);
}
}
@@ -90,13 +90,13 @@ public class ControlSlot extends ControlSlotBase {
highlighted = true;
int c = 0xaa000000 + Math.min(highlight.getKey().getColour(), 0xffffff);
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), c, c);
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), c, c);
}
if (!highlighted && getSuperParent().getMousedOverWidget() == this) {
if (Window.get(this).getGui().getDraggedItem() != null && !slot.isItemValid(Window.get(this).getGui().getDraggedItem())) {
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0xaaff9999, 0xaaff9999);
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0xaaff9999, 0xaaff9999);
} else {
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0x80ffffff, 0x80ffffff);
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), 0x80ffffff, 0x80ffffff);
}
}
}
@@ -123,8 +123,8 @@ public class ControlSlot extends ControlSlotBase {
area = getParent().getArea();
area.setPosition(IPoint.ZERO.sub(getPosition()));
}
CraftGUI.Render.color(c);
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.color(c);
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
}
@@ -40,9 +40,9 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.Slot, getArea());
CraftGUI.render.texture(CraftGUITexture.Slot, getArea());
if (getSuperParent().getMousedOverWidget() == this) {
CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))), 0x80ffffff, 0x80ffffff);
CraftGUI.render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), getArea().size().sub(new IPoint(2.0f, 2.0f))), 0x80ffffff, 0x80ffffff);
}
}
@@ -25,8 +25,8 @@ public class ControlSlotCharge extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
CraftGUI.Render.texturePercentage(CraftGUI.Render.getTexture(CraftGUITexture.SlotCharge), getArea().inset(1), Position.BOTTOM, getCharge());
CraftGUI.render.texture(CraftGUITexture.PanelBlack, getArea());
CraftGUI.render.texturePercentage(CraftGUI.render.getTexture(CraftGUITexture.SlotCharge), getArea().inset(1), Position.BOTTOM, getCharge());
}
@Override
@@ -23,7 +23,7 @@ public class ControlUser extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.UserButton, getArea());
CraftGUI.render.texture(CraftGUITexture.UserButton, getArea());
}
@Override
@@ -18,12 +18,12 @@ import java.util.List;
public class Renderer {
protected GuiCraftGUI gui;
protected int currentColour;
protected int currentColor;
protected Texture currentTexture;
protected IStyleSheet stylesheet;
public Renderer(GuiCraftGUI gui) {
currentColour = 16777215;
currentColor = 0xffffff;
this.gui = gui;
}
@@ -31,37 +31,38 @@ public class Renderer {
GL11.glPushMatrix();
GL11.glTranslatef(widget.getPosition().x(), widget.getPosition().y(), 0.0f);
color(widget.getColor());
if (widget.isCroppedWidet()) {
if (widget.isCroppedWidget()) {
IWidget cropRelative = (widget.getCropWidget() != null) ? widget.getCropWidget() : widget;
IPoint pos = cropRelative.getAbsolutePosition();
IArea cropZone = widget.getCroppedZone();
GL11.glEnable(3089);
GL11.glEnable(GL11.GL_SCISSOR_TEST);
limitArea(new IArea(pos.add(cropZone.pos()), cropZone.size()));
}
GL11.glDisable(2929);
GL11.glDisable(GL11.GL_DEPTH_TEST);
}
public void postRender(IWidget widget) {
if (widget.isCroppedWidet()) {
GL11.glDisable(3089);
if (widget.isCroppedWidget()) {
GL11.glDisable(GL11.GL_SCISSOR_TEST);
}
GL11.glEnable(2929);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glPopMatrix();
}
public void color(int hex) {
currentColour = hex;
currentColor = hex;
int a = (hex & 0xFF000000) >> 24;
int r = (hex & 0xFF0000) >> 16;
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
if (a < 0) {
a += 256;
}
if (a > 0 && a != 255) {
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
GL11.glEnable(3042);
} else {
GL11.glColor3f(r / 255.0f, g / 255.0f, b / 255.0f);
}
@@ -78,7 +79,7 @@ public class Renderer {
if (texture != currentTexture && texture != null) {
BinnieCore.proxy.bindTexture(texture.getFilename());
}
color(currentColour);
color(currentColor);
}
public void texture(Object texture, IPoint position) {
@@ -89,6 +90,7 @@ public class Renderer {
if (texture == null) {
return;
}
setTexture(texture);
IPoint point = position.sub(new IPoint(texture.getBorder().l(), texture.getBorder().t()));
IArea textureArea = texture.getArea().outset(texture.getBorder());
@@ -103,6 +105,7 @@ public class Renderer {
if (texture == null) {
return;
}
setTexture(texture);
IArea textureArea = texture.getArea().outset(texture.getBorder());
IArea targetArea = area.outset(texture.getBorder());
@@ -146,7 +149,7 @@ public class Renderer {
float stringWidth = textWidth(string);
float posX = area.size().x() - stringWidth;
posX *= justification.getXOffset();
GL11.glDisable(2929);
GL11.glDisable(GL11.GL_DEPTH_TEST);
gui.getFontRenderer().drawString(string, (int) (pos.x() + posX), (int) posY, colour);
posY += textHeight();
}
@@ -16,7 +16,7 @@ public class StyleSheetManager {
private static class DefaultStyleSheet implements IStyleSheet {
@Override
public Texture getTexture(Object key) {
return CraftGUI.ResourceManager.getTexture(key.toString());
return CraftGUI.resourceManager.getTexture(key.toString());
}
}
}
@@ -34,7 +34,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
public CraftGUIResourceManager() {
textureSheets = new HashMap<>();
textures = new HashMap<>();
CraftGUI.ResourceManager = this;
CraftGUI.resourceManager = this;
}
@Override
@@ -92,7 +92,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
throw new RuntimeException("Parameter must have between one and four numbers");
}
List<Float> f = new ArrayList<Float>();
List<Float> f = new ArrayList<>();
for (String string : split) {
f.add(Float.parseFloat(string));
}
@@ -113,7 +113,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
if (split.length < 1 || split.length > 4) {
throw new RuntimeException("Parameter must have between one and four numbers");
}
List<Float> f = new ArrayList<Float>();
List<Float> f = new ArrayList<>();
for (String string : split) {
f.add(Float.parseFloat(string));
}
@@ -26,6 +26,6 @@ public enum CraftGUITextureSheet implements IBinnieTexture {
if (BinnieCore.proxy.isServer()) {
return null;
}
return CraftGUI.ResourceManager.getTextureSheet(name).getTexture();
return CraftGUI.resourceManager.getTextureSheet(name).getTexture();
}
}
@@ -25,23 +25,23 @@ public class Panel extends Control {
if (panelType instanceof MinecraftGUI.PanelType) {
switch ((MinecraftGUI.PanelType) panelType) {
case Black:
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, getArea());
CraftGUI.render.texture(CraftGUITexture.PanelBlack, getArea());
break;
case Gray:
CraftGUI.Render.texture(CraftGUITexture.PanelGray, getArea());
CraftGUI.render.texture(CraftGUITexture.PanelGray, getArea());
break;
case Tinted:
CraftGUI.Render.texture(CraftGUITexture.PanelTinted, getArea());
CraftGUI.render.texture(CraftGUITexture.PanelTinted, getArea());
break;
case Outline:
CraftGUI.Render.texture(CraftGUITexture.Outline, getArea());
CraftGUI.render.texture(CraftGUITexture.Outline, getArea());
break;
case TabOutline:
CraftGUI.Render.texture(CraftGUITexture.TabOutline, getArea());
CraftGUI.render.texture(CraftGUITexture.TabOutline, getArea());
break;
}
}
@@ -92,6 +92,10 @@ public class ManagerGenetics extends ManagerBase {
}
public BreedingSystem getSystem(ISpeciesRoot root) {
// Fix NPE
if (root == null) {
return null;
}
return getSystem(root.getUID());
}
@@ -203,10 +207,10 @@ public class ManagerGenetics extends ManagerBase {
throw new NullPointerException("Allele is null!");
}
if (o1 instanceof IAlleleFloat && o2 instanceof IAlleleFloat) {
return Float.valueOf(((IAlleleFloat) o1).getValue()).compareTo(Float.valueOf(((IAlleleFloat) o2).getValue()));
return Float.valueOf(((IAlleleFloat) o1).getValue()).compareTo(((IAlleleFloat) o2).getValue());
}
if (o1 instanceof IAlleleInteger && o2 instanceof IAlleleInteger && !(o1 instanceof AlleleColor)) {
return Integer.valueOf(((IAlleleInteger) o1).getValue()).compareTo(Integer.valueOf(((IAlleleInteger) o2).getValue()));
return Integer.valueOf(((IAlleleInteger) o1).getValue()).compareTo(((IAlleleInteger) o2).getValue());
}
if (o1.getName() != null && o2.getName() != null) {
return o1.getName().compareTo(o2.getName());
@@ -226,7 +226,7 @@ public class TreeBreedingSystem extends BreedingSystem {
return new ArrayList<>();
}
Collection<IAlleleSpecies> set = nei ? getAllSpecies() : getDiscoveredSpecies(world, player);
List<IAlleleSpecies> found = new ArrayList<IAlleleSpecies>();
List<IAlleleSpecies> found = new ArrayList<>();
for (IAlleleSpecies species : set) {
IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies) species;
ITreeGenome genome = TreeManager.treeRoot.templateAsGenome(TreeManager.treeRoot.getTemplate(tSpecies.getUID()));
@@ -3,11 +3,11 @@ package binnie.core.item;
import binnie.botany.Botany;
import binnie.botany.api.IFlower;
import binnie.botany.flower.TileEntityFlower;
import binnie.botany.items.ItemFieldKit;
import binnie.botany.network.PacketID;
import binnie.core.BinnieCore;
import binnie.core.IInitializable;
import binnie.core.network.packet.MessageNBT;
import binnie.genetics.item.ItemFieldKit;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.entity.player.EntityPlayer;
@@ -24,13 +24,16 @@ public class MachineComponent implements INBTTagable {
@Override
public void readFromNBT(NBTTagCompound nbttagcompound) {
// ignored
}
@Override
public void writeToNBT(NBTTagCompound nbttagcompound) {
// ignored
}
public void onUpdate() {
// ignored
}
public Class[] getComponentInterfaces() {
@@ -38,6 +41,7 @@ public class MachineComponent implements INBTTagable {
}
public void onInventoryUpdate() {
// ignored
}
public MachinePayload getPayload() {
@@ -164,9 +164,9 @@ public class MachineUtil {
return machine.getInterface(IProcess.class);
}
public List<ItemStack> getNonNullStacks(int[] slotAcclimatiser) {
List<ItemStack> stacks = new ArrayList<ItemStack>();
for (ItemStack stack : getStacks(slotAcclimatiser)) {
public List<ItemStack> getNonNullStacks(int[] slot) {
List<ItemStack> stacks = new ArrayList<>();
for (ItemStack stack : getStacks(slot)) {
if (stack != null) {
stacks.add(stack);
}
@@ -46,8 +46,8 @@ public class ManagerMachine extends ManagerBase {
return;
}
Set<Class<?>> interfaces = new HashSet<Class<?>>();
for (Class<?> currentClass = component; currentClass != null; currentClass = null) {
Set<Class<?>> interfaces = new HashSet<>();
for (Class<?> currentClass = component; currentClass != null; currentClass = currentClass.getSuperclass()) {
Collections.addAll(interfaces, currentClass.getInterfaces());
}
@@ -19,7 +19,7 @@ class SidedAccess {
}
public AccessDirection getAccess(ForgeDirection side) {
return accesses.containsKey(side) ? accesses.get(side) : base;
return accesses.getOrDefault(side, base);
}
public boolean canInsert(ForgeDirection side) {
@@ -25,10 +25,10 @@ public abstract class ComponentProcessIndefinate extends MachineComponent implem
public ComponentProcessIndefinate(IMachine machine, float energyPerTick) {
super(machine);
this.energyPerTick = energyPerTick;
actionPauseProcess = 0.0f;
actionCancelTask = 0.0f;
clientEnergyPerSecond = 0;
this.energyPerTick = energyPerTick;
}
protected IPoweredMachine getPower() {
@@ -52,6 +52,7 @@ public abstract class ComponentProcessIndefinate extends MachineComponent implem
} else if (isInProgress()) {
onCancelTask();
}
if (actionPauseProcess > 0.0f) {
actionPauseProcess--;
}
@@ -37,6 +37,6 @@ class ControlColourSelector extends Control implements ITooltip, IControlValue<E
@Override
public void onRenderBackground() {
super.onRenderBackground();
CraftGUI.Render.gradientRect(getArea(), 0xff000000 + value.getColor(), 0xff000000 + value.getColor());
CraftGUI.render.gradientRect(getArea(), 0xff000000 + value.getColor(), 0xff000000 + value.getColor());
}
}
@@ -51,7 +51,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
@@ -142,7 +141,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
@Override
public void onEvent(EventValueChanged event) {
NBTTagCompound nbt = new NBTTagCompound();
int i = ((Integer) event.getValue()).intValue();
int i = (Integer) event.getValue();
nbt.setByte("i", (byte) i);
Window.get(tab).sendClientAction("tab-change", nbt);
currentTab = i;
@@ -150,10 +149,10 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
}.setOrigin(EventHandler.Origin.DirectChild, tab));
x += 24;
ControlPages<Integer> compartmentPages = new ControlPages<Integer>(controlCompartment, 24.0f, 0.0f, compartmentPageWidth, compartmentPageHeight);
ControlPages<Integer> compartmentPages = new ControlPages<>(controlCompartment, 24.0f, 0.0f, compartmentPageWidth, compartmentPageHeight);
ControlPage[] page = new ControlPage[inv.getTabNumber()];
for (int p = 0; p < inv.getTabNumber(); ++p) {
page[p] = new ControlPage(compartmentPages, Integer.valueOf(p));
page[p] = new ControlPage(compartmentPages, p);
}
CraftGUIUtil.linkWidgets(tab, compartmentPages);
int i = 0;
@@ -162,9 +161,9 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
Panel panel = new Panel(thisPage, 0.0f, 0.0f, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black) {
@Override
public void onRenderForeground() {
Texture iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
CraftGUI.Render.color(getTab(panels.get(this)).getColor().getColor());
CraftGUI.Render.texture(iTexture, getArea().inset(3));
Texture iTexture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline);
CraftGUI.render.color(getTab(panels.get(this)).getColor().getColor());
CraftGUI.render.texture(iTexture, getArea().inset(3));
}
};
@@ -210,7 +209,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
@Override
public void onEvent(EventValueChanged event) {
NBTTagCompound nbt = new NBTTagCompound();
int i = ((Integer) event.getValue()).intValue();
int i = (Integer) event.getValue();
nbt.setByte("i", (byte) i);
Window.get(tab).sendClientAction("tab-change", nbt);
currentTab = i;
@@ -314,8 +313,8 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
ControlScrollableContent<IWidget> scroll = new ControlScrollableContent<IWidget>(this, 124.0f, 16.0f, 116.0f, 92.0f, 6.0f) {
@Override
public void onRenderBackground() {
CraftGUI.Render.color(11184810);
CraftGUI.Render.texture(CraftGUITexture.Outline, getArea().inset(new IBorder(0.0f, 6.0f, 0.0f, 0.0f)));
CraftGUI.render.color(11184810);
CraftGUI.render.texture(CraftGUITexture.Outline, getArea().inset(new IBorder(0.0f, 6.0f, 0.0f, 0.0f)));
}
};
slotGrid = new Control(scroll, 1.0f, 1.0f, 108.0f, 18.0f);
@@ -374,7 +373,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
if (sortByName) {
List<Entry<Integer, String>> list = new LinkedList(slotIds.entrySet());
Collections.sort(list, new Comparator<Entry<Integer, String>>() {
list.sort(new Comparator<Entry<Integer, String>>() {
@Override
public int compare(Entry<Integer, String> o1, Entry<Integer, String> o2) {
return -o2.getValue().compareTo(o1.getValue());
@@ -482,7 +481,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
@Override
public void onRenderBackground() {
Object texture = isMouseOver() ? CraftGUITexture.TabHighlighted : CraftGUITexture.Tab;
CraftGUI.Render.texture(CraftGUI.Render.getTexture(texture).crop(Position.BOTTOM, 8.0f), getArea());
CraftGUI.render.texture(CraftGUI.render.getTexture(texture).crop(Position.BOTTOM, 8.0f), getArea());
}
}
}
@@ -32,30 +32,32 @@ public enum BinnieCorePacketID implements IPacketID {
((INetworkedEntity) tile).readFromPacket(packet.payload);
}
} else if (this == BinnieCorePacketID.TileMetadata) {
MessageMetadata packet2 = new MessageMetadata(message);
TileEntity tile = packet2.getTileEntity(BinnieCore.proxy.getWorld());
MessageMetadata packet = new MessageMetadata(message);
TileEntity tile = packet.getTileEntity(BinnieCore.proxy.getWorld());
if (tile instanceof TileEntityMetadata) {
((TileEntityMetadata) tile).setTileMetadata(packet2.meta, true);
((TileEntityMetadata) tile).setTileMetadata(packet.meta, true);
}
} else if (this == BinnieCorePacketID.CraftGUIAction && context.side == Side.CLIENT) {
MessageCraftGUI packet3 = new MessageCraftGUI(message);
EntityPlayer player = BinnieCore.proxy.getPlayer();
if (player.openContainer instanceof ContainerCraftGUI && packet3.getTagCompound() != null) {
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.CLIENT, player, packet3.getTagCompound());
}
} else if (this == BinnieCorePacketID.CraftGUIAction && context.side == Side.SERVER && context.netHandler instanceof NetHandlerPlayServer) {
MessageCraftGUI packet3 = new MessageCraftGUI(message);
EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).playerEntity;
if (player.openContainer instanceof ContainerCraftGUI && packet3.getTagCompound() != null) {
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.SERVER, player, packet3.getTagCompound());
} else if (this == BinnieCorePacketID.CraftGUIAction) {
if (context.side == Side.CLIENT) {
MessageCraftGUI packet = new MessageCraftGUI(message);
EntityPlayer player = BinnieCore.proxy.getPlayer();
if (player.openContainer instanceof ContainerCraftGUI && packet.getTagCompound() != null) {
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.CLIENT, player, packet.getTagCompound());
}
} else if (context.netHandler instanceof NetHandlerPlayServer) {
MessageCraftGUI packet = new MessageCraftGUI(message);
EntityPlayer player = ((NetHandlerPlayServer) context.netHandler).playerEntity;
if (player.openContainer instanceof ContainerCraftGUI && packet.getTagCompound() != null) {
((ContainerCraftGUI) player.openContainer).recieveNBT(Side.SERVER, player, packet.getTagCompound());
}
}
} else if (this == BinnieCorePacketID.TileDescriptionSync && context.side == Side.CLIENT) {
MessageTileNBT packet4 = new MessageTileNBT(message);
TileEntity tile = packet4.getTarget(BinnieCore.proxy.getWorld());
if (tile != null && packet4.getTagCompound() != null) {
MessageTileNBT packet = new MessageTileNBT(message);
TileEntity tile = packet.getTarget(BinnieCore.proxy.getWorld());
if (tile != null && packet.getTagCompound() != null) {
IMachine machine = Machine.getMachine(tile);
if (machine != null && machine instanceof INetwork.TilePacketSync) {
((INetwork.TilePacketSync) machine).syncFromNBT(packet4.getTagCompound());
((INetwork.TilePacketSync) machine).syncFromNBT(packet.getTagCompound());
}
}
}
@@ -69,11 +69,6 @@ public class ComponentBeeModifier extends MachineComponent implements IBeeModifi
// ignored
}
// TODO unused method?
public void onPostQueenDeath(IBee queen) {
// ignored
}
// TODO unused method?
public boolean onEggLaid(IBee queen) {
return false;
@@ -25,7 +25,7 @@ public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier {
}
@Override
public String getItemStackDisplayName(ItemStack par1ItemStack) {
public String getItemStackDisplayName(ItemStack stack) {
return frame.getName();
}
@@ -77,7 +77,6 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements
public void onMachineBroken() {
min = null;
max = null;
}
@Override
@@ -93,13 +92,11 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements
@Override
public void updateClient(int arg0) {
super.updateEntity();
}
@Override
public void updateServer(int arg0) {
super.updateEntity();
}
@Override
@@ -18,6 +18,6 @@ public class FrameSlotValidator extends SlotValidator {
@Override
public String getTooltip() {
return I18N.localise("extrabees.achine.alveay.frame.tooltip");
return I18N.localise("extrabees.machine.alveay.frame.tooltip");
}
}
@@ -2,7 +2,6 @@ package binnie.extrabees.apiary.machine.mutator;
import binnie.core.machines.Machine;
import binnie.extrabees.apiary.ComponentBeeModifier;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeListener;
import forestry.api.apiculture.IBeeModifier;
@@ -23,7 +22,7 @@ public class MutatorModifierComponent extends ComponentBeeModifier implements IB
}
@Override
public void onPostQueenDeath(IBee queen) {
public void onQueenDeath() {
getUtil().decreaseStack(AlvearyMutator.SLOT_MUTATOR, 1);
}
}
@@ -26,7 +26,7 @@ public class TransmissionModifierComponent extends ComponentBeeModifier implemen
}
TileExtraBeeAlveary tile = (TileExtraBeeAlveary) getMachine().getTileEntity();
List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
List<IEnergyHandler> handlers = new ArrayList<>();
for (TileEntity alvearyTile : tile.getAlvearyBlocks()) {
if (alvearyTile instanceof IEnergyHandler && alvearyTile != tile) {
handlers.add((IEnergyHandler) alvearyTile);
@@ -71,7 +71,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
@Override
public String getDescription() {
return I18N.localise("extrabees.flowers." + name().toString().toLowerCase() + ".name");
return I18N.localise("extrabees.flowers." + name().toLowerCase() + ".name");
}
public void register() {
@@ -70,7 +70,7 @@ public class ControlClimateBar extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarBack, getArea());
int types = isHumidity ? 3 : 6;
int w = (int) ((getSize().x() - 2.0f) / types);
for (int i = 0; i < types; ++i) {
@@ -82,10 +82,10 @@ public class ControlClimateBar extends Control implements ITooltip {
} else {
color = TEMP_COLORS[i];
}
CraftGUI.Render.solid(new IArea(x + 1, 1.0f, w, getSize().y() - 2.0f), color.getRGB());
CraftGUI.render.solid(new IArea(x + 1, 1.0f, w, getSize().y() - 2.0f), color.getRGB());
}
}
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlass, getArea());
}
public void setSpecies(IAlleleBeeSpecies species) {
@@ -1,11 +1,8 @@
package binnie.extrabees.products;
import binnie.core.IInitializable;
import binnie.core.Mods;
import binnie.extrabees.ExtraBees;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
public class ModuleProducts implements IInitializable {
@@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import java.util.ArrayList;
import java.util.Collections;
public class HiveDrop implements IHiveDrop {
private IAllele[] template;
@@ -27,9 +28,7 @@ public class HiveDrop implements IHiveDrop {
}
this.template = template;
this.chance = chance;
for (ItemStack stack : bonus) {
additional.add(stack);
}
Collections.addAll(additional, bonus);
}
@Override
@@ -48,7 +47,7 @@ public class HiveDrop implements IHiveDrop {
@Override
public ArrayList<ItemStack> getAdditional(World world, int x, int y, int z, int fortune) {
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
ArrayList<ItemStack> ret = new ArrayList<>();
for (ItemStack stack : additional) {
ret.add(stack.copy());
}
@@ -51,10 +51,10 @@ public class ExtraTrees extends AbstractMod {
public static Block blockLog;
public static BlockCarpentry blockCarpentry;
public static Block blockPlanks;
public static Block blockShrubLeaves;
public static Block blockMachine;
public static Block blockFence;
public static BlockCarpentry blockPanel;
public static Block blockKitchen;
public static Block blockSlab;
public static Block blockDoubleSlab;
public static Item itemHammer;
@@ -30,7 +30,8 @@ import java.util.List;
public class BlockETDoor extends BlockDoor implements IBlockMetadata {
protected BlockETDoor() {
super(Material.wood);
setHardness(3.0f).setStepSound(Block.soundTypeWood);
setHardness(3.0f);
setStepSound(Block.soundTypeWood);
setCreativeTab(Tabs.tabArboriculture);
setBlockName("door");
}
@@ -58,23 +59,23 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int par5) {
if (par5 != 1 && par5 != 0) {
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int meta) {
if (meta != 1 && meta != 0) {
int i1 = getFullMetadata(blockAccess, x, y, z);
int j1 = i1 & 0x3;
boolean flag = (i1 & 0x4) != 0;
boolean flag2;
boolean flag3 = (i1 & 0x8) != 0;
if (flag) {
flag2 = (j1 == 0 && par5 == 2)
|| (j1 == 1 && par5 == 5)
|| (j1 == 2 && par5 == 3)
|| (j1 == 3 && par5 == 4);
flag2 = (j1 == 0 && meta == 2)
|| (j1 == 1 && meta == 5)
|| (j1 == 2 && meta == 3)
|| (j1 == 3 && meta == 4);
} else {
flag2 = (j1 == 0 && par5 == 5)
|| (j1 == 1 && par5 == 3)
|| (j1 == 2 && par5 == 4)
|| (j1 == 3 && par5 == 2);
flag2 = (j1 == 0 && meta == 5)
|| (j1 == 1 && meta == 3)
|| (j1 == 2 && meta == 4)
|| (j1 == 3 && meta == 2);
if ((i1 & 0x10) != 0) {
flag2 = !flag2;
@@ -121,38 +122,70 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
return WoodManager.getPlankType(meta & 0xFF).getColor();
}
public int getFullMetadata(IBlockAccess blockAccess, int x, int y, int pzr4) {
int l = blockAccess.getBlockMetadata(x, y, pzr4);
public int getFullMetadata(IBlockAccess blockAccess, int x, int y, int z) {
int l = blockAccess.getBlockMetadata(x, y, z);
boolean flag = (l & 0x8) != 0x0;
int i1;
int j1;
if (flag) {
i1 = blockAccess.getBlockMetadata(x, y - 1, pzr4);
i1 = blockAccess.getBlockMetadata(x, y - 1, z);
j1 = l;
} else {
i1 = l;
j1 = blockAccess.getBlockMetadata(x, y + 1, pzr4);
j1 = blockAccess.getBlockMetadata(x, y + 1, z);
}
boolean flag2 = (j1 & 0x1) != 0x0;
return (i1 & 0x7) | (flag ? 8 : 0) | (flag2 ? 16 : 0);
}
@Override
@SideOnly(Side.CLIENT)
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
if (player.capabilities.isCreativeMode && (meta & 0x8) != 0x0 && world.getBlock(x, y - 1, z) == this) {
world.setBlockToAir(x, y - 1, z);
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
int meta = world.getBlockMetadata(x, y, z);
if ((meta & 8) == 0) {
boolean flag = false;
if (world.getBlock(x, y + 1, z) != this) {
world.setBlockToAir(x, y, z);
flag = true;
}
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)) {
flag = true;
}
if (flag) {
if (!world.isRemote) {
dropBlockAsItem(world, x, y, z, meta, 0);
}
} else {
boolean flag1 = world.isBlockIndirectlyGettingPowered(x, y, z) || world.isBlockIndirectlyGettingPowered(x, y + 1, z);
if ((flag1 || block.canProvidePower()) && block != this) {
func_150014_a(world, x, y, z, flag1);
}
}
if (!World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)) {
world.setBlockToAir(x, y, z);
if (world.getBlock(x, y + 1, z) == this) {
world.setBlockToAir(x, y + 1, z);
}
}
} else {
if (world.getBlock(x, y - 1, z) != this) {
world.setBlockToAir(x, y, z);
}
if (block != this) {
onNeighborBlockChange(world, x, y - 1, z, block);
}
}
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
int yCoord = y;
if ((meta & 0x08) != 0) {
yCoord -= 1;
y -= 1;
}
return BlockMetadata.getBlockDropped(this, world, x, yCoord, z, meta);
return BlockMetadata.getBlockDropped(this, world, x, y, z, meta);
}
@Override
@@ -170,13 +203,6 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
return true;
}
@Override
public boolean onBlockEventReceived(World world, int x, int y, int z, int eventId, int eventType) {
super.onBlockEventReceived(world, x, y, z, eventId, eventType);
TileEntity tileentity = world.getTileEntity(x, y, z);
return tileentity != null && tileentity.receiveClientEvent(eventId, eventType);
}
@Override
public int getPlacedMeta(ItemStack stack, World world, int x, int y, int z, ForgeDirection direction) {
return TileEntityMetadata.getItemDamage(stack);
@@ -188,24 +214,24 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
}
@Override
public String getBlockName(ItemStack itemStack) {
int meta = TileEntityMetadata.getItemDamage(itemStack);
public String getBlockName(ItemStack stack) {
int meta = TileEntityMetadata.getItemDamage(stack);
String typeName = getDoorType(meta).getName();
String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
if (typeName.equals("")) {
if (typeName.isEmpty()) {
return I18N.localise("extratrees.block.door.name", woodName);
}
return I18N.localise("extratrees.block.door.name.adv", woodName, typeName);
}
@Override
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
public void addBlockTooltip(ItemStack stack, List tooltip) {
// ignored
}
@Override
public void dropAsStack(World world, int x, int y, int z, ItemStack itemStack) {
dropBlockAsItem(world, x, y, z, itemStack);
public void dropAsStack(World world, int x, int y, int z, ItemStack stack) {
dropBlockAsItem(world, x, y, z, stack);
}
@Override
@@ -226,11 +252,6 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
}
}
@Override
public boolean isWood(IBlockAccess world, int x, int y, int z) {
return true;
}
@Override
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
return 20;
@@ -247,13 +268,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
}
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int par6) {
super.breakBlock(world, x, y, z, block, par6);
world.removeTileEntity(x, y, z);
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
return BlockMetadata.getPickBlock(world, x, y, z);
}
}
@@ -0,0 +1,15 @@
package binnie.extratrees.block;
import forestry.arboriculture.blocks.BlockForestryLeaves;
import net.minecraft.world.World;
public class BlockShrubLeaves extends BlockForestryLeaves {
public BlockShrubLeaves() {
super();
}
@Override
public void beginLeavesDecay(World world, int x, int y, int z) {
// ignored, no able decay
}
}
@@ -5,7 +5,6 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
@@ -40,12 +40,14 @@ public class ModuleBlocks implements IInitializable {
ExtraTrees.blockPlanks = new BlockETPlanks();
ExtraTrees.blockFence = new BlockFence();
ExtraTrees.blockLog = new BlockETLog();
ExtraTrees.blockShrubLeaves = new BlockShrubLeaves();
ExtraTrees.blockGate = new BlockGate();
ExtraTrees.blockDoor = new BlockETDoor();
ExtraTrees.blockMultiFence = new BlockMultiFence();
ExtraTrees.blockSlab = new BlockETSlab(false);
ExtraTrees.blockDoubleSlab = new BlockETSlab(true);
ExtraTrees.blockStairs = new BlockETStairs(ExtraTrees.blockPlanks);
GameRegistry.registerBlock(ExtraTrees.blockPlanks, ItemMetadata.class, "planks");
GameRegistry.registerBlock(ExtraTrees.blockFence, ItemMetadata.class, "fence");
GameRegistry.registerBlock(ExtraTrees.blockMultiFence, ItemMetadata.class, "multifence");
@@ -56,6 +58,7 @@ public class ModuleBlocks implements IInitializable {
GameRegistry.registerBlock(ExtraTrees.blockDoubleSlab, ItemETSlab.class, "doubleSlab");
GameRegistry.registerBlock(ExtraTrees.blockDoor, ItemETDoor.class, "door");
GameRegistry.registerBlock(ExtraTrees.blockStairs, ItemETStairs.class, "stairs");
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockStairs), new StairItemRenderer());
BinnieCore.proxy.registerCustomItemRenderer(Item.getItemFromBlock(ExtraTrees.blockGate), new GateItemRenderer());
for (ILogType plank : ILogType.ExtraTreeLog.values()) {
@@ -31,41 +31,41 @@ public class PlankType {
}
public enum ExtraTreePlanks implements IPlankType, IFenceProvider {
Fir(12815444),
Cedar(14181940),
Hemlock(13088108),
Cypress(16169052),
Fig(13142058),
Beech(14784849),
Alder(12092755),
Hazel(13480341),
Hornbeam(12818528),
Box(16511430),
Butternut(15510138),
Hickory(14333070),
Whitebeam(13222585),
Elm(15772004),
Apple(6305064),
Yew(14722426),
Pear(12093805),
Hawthorn(13402978),
Rowan(13610394),
Elder(12489337),
Maclura(15970862),
Syzgium(15123393),
Brazilwood(7487063),
Logwood(10762028),
Iroko(7681024),
Locust(12816736),
Eucalyptus(16165771),
Purpleheart(5970991),
Ash(16107368),
Holly(16512743),
Olive(11578760),
Sweetgum(13997656),
Rosewood(7738624),
Gingko(16050106),
PinkIvory(15502496);
Fir(0xc38c54),
Cedar(0xd86634),
Hemlock(0xc7b56c),
Cypress(0xf6b85c),
Fig(0xc8882a),
Beech(0xe19951),
Alder(0xb88553),
Hazel(0xcdb195),
Hornbeam(0xc39860),
Box(0xfbf1c6),
Butternut(0xecaa7a),
Hickory(0xdab48e),
Whitebeam(0xc9c2b9),
Elm(0xf0a964),
Apple(0x603528),
Yew(0xe0a57a),
Pear(0xb8896d),
Hawthorn(0xcc8362),
Rowan(0xcfad9a),
Elder(0xbe9279),
Maclura(0xf3b22e),
Syzgium(0xe6c3c1),
Brazilwood(0x723e57),
Logwood(0xa4372c),
Iroko(0x753400),
Locust(0xc39160),
Eucalyptus(0xf6ab8b),
Purpleheart(0x5b1c2f),
Ash(0xf5c768),
Holly(0xfbf6e7),
Olive(0xb0ad88),
Sweetgum(0xd59658),
Rosewood(0x761500),
Gingko(0xf4e7ba),
PinkIvory(0xec8ca0);
protected int color;
protected IIcon icon;
@@ -109,7 +109,7 @@ public class PlankType {
}
}
public enum VanillaPlanks implements IPlankType {
public enum VanillaPlanks implements IPlankType, IFenceProvider {
OAK(0xb4905a),
SPRUCE(0x805e36),
BIRCH(0xd7c185),
@@ -149,6 +149,11 @@ public class PlankType {
Block block = Blocks.planks;
return block.getIcon(2, meta);
}
@Override
public ItemStack getFence() {
return TileEntityMetadata.getItemStack(ExtraTrees.blockFence, WoodManager.getPlankTypeIndex(this));
}
}
public enum ForestryPlanks implements IPlankType, IFenceProvider {
@@ -55,6 +55,12 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
for (IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
list.add(type.getFence());
}
for (IFenceProvider type : PlankType.VanillaPlanks.values()) {
if (type != PlankType.VanillaPlanks.OAK) {
list.add(type.getFence());
}
}
}
@Override
@@ -22,7 +22,7 @@ public class FenceType {
}
public static Collection<FenceType> values() {
List<FenceType> list = new ArrayList<FenceType>();
List<FenceType> list = new ArrayList<>();
for (int size = 0; size < 3; ++size) {
for (boolean solid : new boolean[]{false, true}) {
for (boolean embedded : new boolean[]{false, true}) {
@@ -17,7 +17,7 @@ public class MultiFenceRecipeSize implements IRecipe {
@Override
public boolean matches(InventoryCrafting inv, World world) {
StringBuilder pattern = new StringBuilder();
List<IPlankType> types = new ArrayList<IPlankType>();
List<IPlankType> types = new ArrayList<>();
for (int i = 0; i < inv.getSizeInventory(); ++i) {
ItemStack stack = inv.getStackInSlot(i);
IPlankType type = (stack == null) ? null : WoodManager.get(stack);
@@ -60,7 +60,7 @@ public class NBTShapedRecipe implements IRecipe {
for (int i2 = 0; i2 < j * k; ++i2) {
char c0 = s.charAt(i2);
if (hashmap.containsKey(c0)) {
aitemstack[i2] = ((ItemStack) hashmap.get(Character.valueOf(c0))).copy();
aitemstack[i2] = ((ItemStack) hashmap.get(c0)).copy();
} else {
aitemstack[i2] = null;
}
@@ -135,7 +135,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
tooltip.add(I18N.localise(
"extratrees.block.tooltip.twoColors",
"extratrees.block.tooltip.twoMaterials",
block.getPrimaryMaterial().getName(),
block.getSecondaryMaterial().getName()
));
@@ -1,6 +1,7 @@
package binnie.extratrees.carpentry;
import binnie.botany.Botany;
import binnie.core.block.TileEntityMetadata;
import binnie.core.util.I18N;
import binnie.extratrees.api.IDesign;
import cpw.mods.fml.relauncher.Side;
@@ -11,6 +12,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import java.util.List;
import java.util.Random;
public class BlockStainedDesign extends BlockDesign {
@@ -60,4 +62,18 @@ public class BlockStainedDesign extends BlockDesign {
public String getBlockName(DesignBlock design) {
return I18N.localise("extratrees.block.stainedglass.name", design.getDesign().getName());
}
@Override
public void addBlockTooltip(ItemStack stack, List tooltip) {
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
tooltip.add(I18N.localise(
"extratrees.block.tooltip.twoColors",
block.getPrimaryMaterial().getName(),
block.getSecondaryMaterial().getName()
));
} else {
tooltip.add(block.getPrimaryMaterial().getName());
}
}
}
Loaded 100 of 242 files, more files were not shown because too many files have changed in this diff. Show more