Compare commits

...

205 Commits

Author SHA1 Message Date
fscan 548af3c6cc Use standard inheritance to propagage NBT events (#3058)
* Remove the old annotation system
* Use TileEntity#onLoad instead of onChunkLoad event
* Do not call invalidate in onChunkUnload and validate in onLoad
2017-08-28 09:34:09 +02:00
yueh 98b9380494 Fixes machines not extracting power from the local grid.
There is currently no difference between an external grid and the local
machines trying to extract power from the grid. Thus preventing any
external grid from stealing power also does prevent machines from
extracting, if there is no other provider available.

Also a small change to use a priorityqueue with the lowest percentage
stored first. This can better utilize the upper limit by reaching it
faster and exiting earlier.
2017-08-27 15:01:07 +02:00
fscan bbf4d4a9ce Spatial rework (#3048)
* Moved all spatial cells into a single dimension instead of one dimension per cell

Each cell will now be backed by a single region file each. So  backups and restores can still be done on a per cell level.

Old cells will not be migrated.

* Moved custom cell tracking to a capability based one on the world

The size and owner of a cell is now stored inside the capabilities of the world/dimension not a custom system and we can rely on forge handling the persistence of it.

* Added the cell id to the actual item tooltip, as this is now a real identifier and not an arbitrary dimension id.

* Added vanilla banners to the whitelist

* Added unittests to the dimension manager to ensure the algorithm mapping to the correct region file

* Updated the API to conform with the new dimenion/types/biomes registration and mappings

* Fixed a couple of bugs related to world/dimension/biome registration 

* Fixed a bug when transfering certain blocks due to passing missing/incorrect blockstate
2017-08-24 11:24:33 +02:00
yueh 1513ba3f6a Performance improvements for the energygrid (#3051)
* Performance improvements for the energygrid

Reworked the old recursive approach to a queue based loop.
Extract will try to prefer the next grid with the hightest amount of
stored energy.
Inject will try to prefer the grid with the lowest percentage stored.
Other operations are first come, first serve.

* Added a local buffer storage to EnergyGrid

This replaces the old not really working buffer with a special
IAEPowerStorage acting as buffer/proxy for the local energy demand as
well as temporary overflow should something provide more energy than
requested.

Currently it set to hold a maximum of 200 AE (+ optional overflow until
consumed). It will only be used locally, no other grid can use it to
avoid starving the neighbor grids before finding a energy cell.

* Fixes IExternalPowerSink

All implementations currently depend on the network demand being a valid
source, which might not be true.

Further it can cause the sink to iterate the network twice (demand and
inject) and both again for simulate and modulate.

Also it did not return the actual leftover amount instead of relying on
the demand matching it.

* Minor fixes related to removing nodes from a grid.

The grid did remove IStackWatcherHost not IEnergyWatcherHost, this was
fine for AE2 as only level emitters use it and they implement both.
But not for potential addons.

Also they would potentually not being removed as the are indexed by the
gridnodes not the machine.

Fixes #1004
2017-08-24 11:06:31 +02:00
yueh f03f8ec432 Remove RF dependency 2017-08-22 11:07:00 +02:00
Florian Scandella e1dcd588b7 add particle texture to charged quartz 2017-08-21 20:11:20 +02:00
fscan 8338a7d13e Fixes #3049: JEI recipe transfer can voiding items (#3053) 2017-08-21 14:39:29 +02:00
yueh b8e685b1b6 Fixes #3040: Cache recipe and revalidate it (#3042)
* Fixes #3040: Cache recipe and revalidate it

This caches the last used recipe instead of only the result. Which
allows to revalidate the crafting grid against the recipe itself before
hitting the CraftingManager again. Therefore avoiding a high performance
hit for recipe lookups, just find the potential same recipe again.

* Remove old recipe lookup as forge provides it now.

* Further optimizations.

These are a bit quick'n'dirty and need a better solution with a full
container/gui refactoring. But for now they provide some great benefits
in terms of performance.
2017-08-20 21:31:30 +02:00
yueh d84500c5b7 Fixes FE P2P tunnel drain issues
Only queue drain on modulate, also queue it for extracting from the
input side.
2017-08-20 14:35:31 +02:00
yueh a1679c944b Added SCS size to the Spatial IO Port. (#3045)
Uses the same format as the cells display in their tooltip for easy comparison.
2017-08-20 13:14:27 +02:00
fscan a3a39201d1 Missed vibration chamber when fixing the others. (#3050) 2017-08-19 21:31:16 +02:00
Emanuele Torre d788da687e Update it_it.lang (#3041) 2017-08-18 10:31:15 +02:00
yueh 030e0c6a14 Updated gradle.properties for deploying to multiple minecraft versions 2017-08-18 00:47:31 +02:00
fscan 8e4265aa33 P2P Tunnel improvements (#3039)
* Fix P2P Tunnels randomly resetting to ME
* Allow one way push and pull. Outputs can pull from the input side, input can push into outputs.
2017-08-18 00:44:19 +02:00
Gunther De Wachter 80eaa032b9 Fixes #3011: placing the last part in off-hand clearing main hand as well 2017-08-17 22:19:50 +02:00
yueh bee9c70497 Added 1.12.1 as accepted version. 2017-08-17 21:17:55 +02:00
yueh c4fa21c193 Removes coremod (#3038)
From now on every integration must not rely on method stripping through
a coremod or @Optional. Notable example for a very good solution is IC2.

As consequence this drops all support for RF and mods must support on of
our supported energy types. At the time of writing, ForgeEnergy and
IC2/EU.
2017-08-17 21:16:57 +02:00
Gunther De Wachter 8a7450168b Updated JEI plugin to newer API methods. 2017-08-17 20:41:20 +02:00
Gunther De Wachter 7cb641cdc8 Fix shift clicking memory card still triggering off-hand item/block usage. 2017-08-17 20:41:20 +02:00
Gunther De Wachter b5b8050c4c Added workaround for sorting items on amount with fake amount when showing crafting label 2017-08-17 20:41:20 +02:00
Gunther De Wachter e65083b045 Fixed dropping items on the ground when clicking on a crafting label with items in hand 2017-08-17 20:41:20 +02:00
yueh b61219ef88 Covered dense cables (#3030)
* Renamed all dense smart cable related things to include smart
* Added dense covered cables
* Added abstract PartDenseCable to reduce redundant code
* Added dense covered recipes

* Ensures ItemPart ordering to be consitent.

Now takes the metadata into account to preserve the ordering for colored
items instead of just the part type name and depend on the insertion
order of a hashmap.
2017-08-17 18:41:39 +02:00
yueh 4f9fd1b369 IC2 rework to avoid a coremod or @Optional (#3034)
* IC2 rework to avoid a coremod or @Optional

Updated IC2 dependency

Refactored IC2 itemcharging to use an IBackupElectricManager.
Allows charging any ae powered item by using an IBackupElectricManager
instead of having to implement IElectricItem and stripping it by some
sort.

Updated IAEItemPowerStorage to use Actionable for an easier handling
with power APIs supporting a simulation.

Refactored EU P2P to avoid method stripping
Use a modified internal BasicSinkSource instead of implementing
IEnergySource and IEnergySink directly on the tunnel.

Removed the superfluous EU P2P layers.

* Removed internalBattery due to being too complex

* Creative Energy Cell is not a chargeable item
2017-08-17 17:35:34 +02:00
yueh 630fae3f73 Fixes #3024: Crash on recipe lookup for disabled features (#3026)
* Fixes #3024: Crash on recipe lookup for disabled features

Adds a new recipe condition for a single AEFeature or a list of them.
Moved the factories to their own package, in preparation of phasing out
the old recipe handling.
2017-08-17 17:17:26 +02:00
yueh 488ef1b544 Fixes recipes to use correct ingredients
Fluix Pearls instead of Fluix Crystals for spatial related items.
Fluix cables for most items, not any cable to avoid loops or unwanted
crafting steps.
2017-08-17 15:12:34 +02:00
fscan 098ee2f000 Making charged certus ore glow again (#3035) 2017-08-17 11:01:31 +02:00
fscan 04d2b06c0d Ignore MOVE_REGION when clicking on crafting slots (#3032)
Exclude crafting slots from list of slots to move on space click.

Fixes #3031
2017-08-15 15:07:42 +02:00
fscan ac48ab02fc Fix crash in clearStack (#3033) 2017-08-15 15:05:12 +02:00
fscan 9022150e38 Fill existing stacks first when adding to player inventory. (#3025) 2017-08-14 11:03:53 +02:00
yueh 65c6d2249a Fixes encoding issues with spatial cell names 2017-08-13 19:02:03 +02:00
yueh 8e7f79a9ea Ensure gradle uses UTF-8 2017-08-12 16:35:38 +02:00
fscan 95b48b9438 Registration rework (#3018)
Refactored component registration.

Fixes #3008: crank rendering
2017-08-12 15:02:50 +02:00
yueh cdd76b7b22 Added helpers for hex and color output. (#3027) 2017-08-12 14:52:31 +02:00
fscan 3e2bc0e038 Inscriber improvements and fixes (#3028) 2017-08-12 14:52:01 +02:00
yueh eec3e59eea Add missing annotations 2017-08-11 21:44:30 +02:00
yueh e39855b48f Use qualified method and field access 2017-08-11 21:43:47 +02:00
yueh cdcab7d91c Organise Imports 2017-08-11 21:42:26 +02:00
yueh 27ad2c2b96 Code format 2017-08-11 21:41:51 +02:00
yueh 542a2e5d5a Fixes NPE due to using wrong field. 2017-08-11 21:33:57 +02:00
fscan 3b58f5e8da fix me io port (#3019) 2017-08-09 10:39:07 +02:00
fscan 092afad4a5 Correctly detect redstone updates on all sides. (#3017) 2017-08-09 10:30:44 +02:00
Gunther De Wachter 6aa810d62a Re-add a missing piece of IC2 integration code.
This should fix a bunch of IC2 spam in the console and allow items to be charged in IC2 blocks.
2017-08-07 10:15:26 +02:00
Gunther De Wachter 41d98f9944 Fixed ME Chest visually not updating its cell state 2017-08-05 11:43:57 +02:00
Gunther De Wachter 1b198979fd Fixed export bus never speeding up. 2017-08-05 10:45:13 +02:00
tyra 8d5cc916e0 Adds improved tooltip to invalid encodedPattern (#2992)
* Adds improved tooltip to invalid encodedPattern

This also fixes that encodedPattern might be shown as valid,
even though one or more input or output item is missing.
2017-08-04 21:17:35 +02:00
Gunther De Wachter 5abb8bf886 Removed call to super in Crafting Terminal initialisation code. Fixes #2988 2017-08-04 20:28:11 +02:00
Gunther De Wachter 0bed78a144 Re-enabled JEI search integration in terminals. 2017-08-03 22:00:42 +02:00
fscan 30940e91ea InterfaceTerminal: Put into to cursor, not player hand (#2996) 2017-07-31 17:16:56 +02:00
fscan 0f9ac5fdda Fix Inscriber and Molecular Assembler (#2995)
* Fix inscriber
* Allow GUI extraction for Molecular Assembler
2017-07-31 16:06:39 +02:00
fscan 5e001d86cb Move model loading to the correct event. Fixes #2991 (#2994)
* Use the correct event for loading models.
* Introduce IModelRegistry to wrap the ModelLoader
2017-07-31 15:51:53 +02:00
fscan b13a338948 Fix/Remove storage/import/export bus IItemHandler caching (#2987)
* Fix storage/import/export bus IItemHandler caching
2017-07-31 15:51:01 +02:00
yueh 454404b0c1 Changed ItemGen to use IItemHandler 2017-07-30 20:17:23 +02:00
yueh bb1e191666 Changed IPart#onNeighborChanged() to add vanilla arguments (#2985)
Allows more precise checks to limit an update to the facing side.
2017-07-29 15:45:18 +02:00
yueh b72fce97db Removes random energy P2P behaviour (#2986)
Energy P2P now try to evenly distribute over all outputs (to a certain
limit)
Fixes some NPE regarding the caches.

Closes #2969
2017-07-29 15:38:29 +02:00
yueh bcc4a732ed Started P2P rework (#2966)
* First iteration of P2P rework

Changed frequency to short instead of long.
Added a per grid RNG to request a new frequency, hopefully without many collisons.
Added a helper to convert between a frequency and 4 colours
2017-07-28 22:06:19 +02:00
fscan 52d28fabe3 Use IItemHandler instead of IInventory internally (#2971)
* Use IItemHandler instead of IInventory internally
2017-07-28 22:04:32 +02:00
Gunther De Wachter c077840988 Fixed formation plane crashing when placing a block down. 2017-07-26 07:39:59 +02:00
Gunther De Wachter 8f6510aad4 Fixed the spatial cells losing their "cubed" sign because of an encoding issue in the language files. 2017-07-25 02:20:40 +02:00
Gunther De Wachter fa8427dcbd Fixed ItemStack initialisation in ContainerCellWorkbench. 2017-07-23 20:50:30 +02:00
Gunther De Wachter 7eb09fc4db Fixed Container Workbench (and other UI's) giving access to slots that shouldn't be there. 2017-07-23 20:39:01 +02:00
Gunther De Wachter ac528d09ae Fixed empty list when toggling to "Craftable" view in a terminal. 2017-07-23 17:41:05 +02:00
fscan c97165cc63 Fix NPE in MEMonitorIInventory.onTick (#2972) 2017-07-22 21:24:19 +02:00
yueh 08ee8f7656 Updated eclipse codeformat 2017-07-22 21:12:53 +02:00
Gunther De Wachter 727fcc528f Fixed crafting card recipe. 2017-07-22 18:31:30 +02:00
yueh a4c468b9cf Updated caps to be manually disabled via config
Moved the cap injection to a method, allows them to be configurable.
This is not possible for Forge Energy as it is injected before even the
configuration are lodaed, thus violating their own capability contract
to use the method injection to explicitly make it configurable.

Updated the ratio key for forge energy to "ForgeEnergy" without a space
2017-07-22 13:29:14 +02:00
Gunther De Wachter 4ad31f5066 Integrated groups.recipes into the JSON recipes a bit more cleanly.
Groups in groups.recipes that only had 1 item in the group haven't been converted into the JSON system.
That means "monitor" and "densecable" were just left as is.
2017-07-22 02:08:01 +02:00
tyra f70e97046f Fixes PatternTerminal crafting issue (#2964) 2017-07-22 01:12:07 +02:00
tyra 3a053d9ebe Fixes PatternTerminal clearing crafting slot on tried crafting (#2963) 2017-07-22 01:11:42 +02:00
Gunther De Wachter fbaff342e4 Fixed cable anchor recipe. Apparently 32767 is the magic wildcard number we were looking for. 2017-07-22 00:33:16 +02:00
tyra f0baea3be8 Fixes a ItemStack deletion issue in the grindstone (#2962)
Fixes the Grinder eating the item in case of an input ItemStack with size equal to one.
2017-07-21 23:03:13 +02:00
yueh fd7e393d23 Updated github docs 2017-07-21 22:05:38 +02:00
yueh a24ed38e90 Added missing Override annotations 2017-07-20 21:28:16 +02:00
yueh 15582fd1df Always use qualified access for fields and methods 2017-07-20 21:27:22 +02:00
yueh f9cad0758d Always use {} for control statements 2017-07-20 21:24:58 +02:00
yueh 406013142e Superfluous whitespace removal 2017-07-20 21:23:01 +02:00
yueh 7de90ed0ae Finally use Java7 <> 2017-07-20 21:21:45 +02:00
yueh 8ec8babb6a Organised imports 2017-07-20 21:18:49 +02:00
yueh 621910df91 Format sourcecode 2017-07-20 21:17:10 +02:00
yueh 66437897be Removed superfluous thirdparty sourceset 2017-07-20 20:59:37 +02:00
Gunther De Wachter 7414840530 Fixed facades not showing up before F3+A. This is caused by the BlockRendererDispatcher not existing yet in the ModelBakeEvent event. 2017-07-19 19:08:49 +02:00
Gunther De Wachter 0741e4ae09 Cosmetic change to smart fluix recipe. (Looks nicer in JEI) 2017-07-19 13:55:39 +02:00
Gunther De Wachter 87f6a63f47 Fixed seeds and P2P bus not having a localised name. 2017-07-19 13:55:09 +02:00
Gunther De Wachter b0950683a1 Updated pack.mcmeta to new version. 2017-07-19 13:54:08 +02:00
Gunther De Wachter 009cf8ac40 Fixed fluix pearl and Dense Smart Fluix recipes. 2017-07-19 13:52:25 +02:00
Gunther De Wachter 4c272de77f Temporary fix for serverside JEI and valueconfig packets.
It's not pretty but should do until we rewrite the packet/network handler.
2017-07-19 13:50:21 +02:00
Gunther De Wachter 6648d18f00 Changed the Parts and Material enum to be more java compliant.
Renamed Dense Cables to Dense Smart Cables.
2017-07-16 02:22:30 +02:00
Gunther De Wachter 16b5b5aea2 Fixed setting a Tunnel Type to "Forge Energy". Forgot to edit the part that actually sets the tunnel. 2017-07-15 01:19:29 +02:00
Gunther De Wachter e20697a7d9 Added the Forge Energy line to the language files. 2017-07-15 00:51:08 +02:00
Gunther De Wachter dc0447d137 This layer isn't needed for the traversal of Forge Energy. 2017-07-15 00:49:13 +02:00
Gunther De Wachter 577b1fa757 Add a method to attune the P2P Tunnel by (supported) ModId, or check for ForgeEnergy support if it's not listed. 2017-07-14 22:54:19 +02:00
Gunther De Wachter 3d69dc9bc4 Merge branch 'rv5-1.12' of github.com:GuntherDW/Applied-Energistics-2 into rv5-1.12 2017-07-14 21:52:24 +02:00
Gunther De Wachter 66c87a2fa2 Re-enabled the RF and IC2 handler, as well as their P2P tunnels. Added Forge Energy P2P tunnel. 2017-07-14 21:52:04 +02:00
Gunther De Wachter fdab91323c Re-enabled the WAILA handler, using Hwyla. 2017-07-14 21:48:20 +02:00
Gunther De Wachter 98a8c3d06b Forgot to remove extra debug line before pushing to github. 2017-07-14 16:21:16 +02:00
Gunther De Wachter 458356a2be First attempt at combining the Block registration and TE registration whilst still keeping support for addons.
It might need some refinement in the future.
2017-07-14 04:47:40 +02:00
Gunther De Wachter c91b432e09 Added exceptions to the Recipe handlers. Don't crash, but log to the console what went wrong. 2017-07-13 22:18:59 +02:00
Gunther De Wachter d67d93b343 Fixed a couple recipes that were wrong during the transition. 2017-07-13 11:31:26 +02:00
Gunther De Wachter f6f8da28af Fixed Recipe handler only giving out 1 item instead of the amount specified in the json. 2017-07-13 11:29:00 +02:00
Gunther De Wachter 76fd3c1166 Fix potential crash in the recipes when the material was replaced. 2017-07-13 09:30:39 +02:00
Gunther De Wachter 3da881829e Fixed recipe crash when another mod registers a wooden gear.
I'll have to go through every other recipe later.
2017-07-13 09:03:18 +02:00
Gunther De Wachter 90ee7fb15d Fixed last commit. I should never trust kate's syntax hilighting in the future again. 2017-07-13 04:49:10 +02:00
Gunther De Wachter e5e2714273 Really fixed NotNull this time. My local git repo got desync'ed for a bit. 2017-07-13 04:44:05 +02:00
Gunther De Wachter 1534521362 Fixed wrong interface being used for the NonNull ItemStacks causing issues. 2017-07-13 04:21:15 +02:00
Gunther De Wachter 0f8204cd93 Fixed serversided issue. Forgot to check for uses of isEnabled before changing it to a clientside only method. 2017-07-13 04:18:33 +02:00
Gunther De Wachter eb11845a2f Fixed applying the type of tunnel for P2P tunnels.
This was caused by the enforced lowercase mod id's and item names since 1.11.
2017-07-12 06:04:06 +02:00
Gunther De Wachter fe213e5ac5 Add item handler capabilities to Item P2P tunnels. 2017-07-12 06:02:31 +02:00
Gunther De Wachter 25c82b2c9f Forgot to remove test recipe. 2017-07-11 05:12:47 +02:00
Gunther De Wachter d03faae983 JSON Recipes initial import.
Moved the old recipe handler to a different direct to not confuse the vanilla/forge JSON loader.
2017-07-11 04:50:02 +02:00
Gunther De Wachter 76e19874cf Small code cosmetics and null checks update. 2017-07-09 13:44:11 +02:00
Gunther De Wachter 1975c3c262 Moved makeUnique() a bit back to fix almost every AE item being disabled. 2017-07-09 13:43:16 +02:00
Gunther De Wachter 720feb4f16 Iron nuggets are vanilla nowadays. There's no sense in keeping them around in AE2. 2017-07-09 11:33:22 +02:00
Gunther De Wachter 588579d67f Updated CoFH RF API. Removed the old API from thirdparty/.
Those files are available from their maven server now.
2017-07-09 10:34:34 +02:00
Gunther De Wachter 043f6e9919 Fixed ME Drive not rendering in-world. 2017-07-09 10:10:56 +02:00
Gunther De Wachter cc7824a0e5 Merge remote-tracking branch 'origin/rv5-1.12' into rv5-1.12 2017-07-09 07:18:45 +02:00
Gunther De Wachter a57cd3f580 More 1.12 shenanigans. Still far from done. 2017-07-09 07:17:24 +02:00
GuntherDW 33f54a1bd6 Merge pull request #8 from tyra314/creative-tab-leak
Fixes creative tab leak
2017-07-09 05:53:32 +02:00
tyra314 3008088ad7 Fixes creative tab leak 2017-07-08 11:26:51 +02:00
Gunther De Wachter 198ea9f16e Fixed crash caused by delayed block registration.
Added Callback section for the Model Registry event to the builder setup.
Moved the State Mapper section to the Model Registry Callback section.
2017-07-06 14:05:54 +02:00
Gunther De Wachter d8c5e6a5fa Fixed UI background not being drawn.
Mezz removed said displayGuiScreenWithoutClose() so said workaround can be removed.
2017-07-06 08:07:51 +02:00
Gunther De Wachter fbcf8c4705 Highly incomplete code. First work on porting to 1.12. Still need to rework a LOT of things. 2017-07-06 01:57:19 +02:00
Gunther De Wachter d67f97cd16 FMLRelaunchLog is deprecated in favour of FMLLog. Small grammatical fixed as well.
They want you to get a logger in the PreInit phase, but seeing as we are a coremod we run before those events take place.
2017-07-04 17:50:10 +02:00
Gunther De Wachter 0e2f8a22a2 Decided to go for a more "separated" TE registration.
This will still make it so addons still get to add custom blocks without having to change too much of the internals.

It still needs thorough testing though. I don't want to change this too much because it ruins older worlds.
2017-07-04 15:40:57 +02:00
Gunther De Wachter 20fc0e136d Fixed more bugs caused by the new mappings. 2017-07-03 09:11:06 +02:00
Gunther De Wachter 7f7495f1df Fixed bug caused by mapping update, not being able to rclick on parts on a certain side. 2017-07-03 08:20:13 +02:00
Gunther De Wachter e6e858820f Updated forge and added some more stuff from the new mappings. 2017-07-03 07:34:24 +02:00
Gunther De Wachter 4679b0ee61 Forgot to add this file for the Named Inventories fix. 2017-07-03 06:56:03 +02:00
Gunther De Wachter 890eef1803 Update MCP Mappings to stable_32
Some mapping updates are just straight up weird. 20170516 -> isBlockSolid, 20170517 -> causesDownwardCurrent
2017-07-03 06:54:45 +02:00
Gunther De Wachter 780ce89ac3 Internal change to fix Named Inventories. This change will not affect the reobfed version (much). 2017-07-03 05:54:25 +02:00
Gunther De Wachter e96339dd2b Fix more items and unsafe checks that made items get deleted. 2017-07-02 07:44:21 +02:00
Gunther De Wachter b67d7eed82 Fixed tools getting deleted when being used in off-hand. 2017-07-02 07:33:16 +02:00
Gunther De Wachter 5ebd8452bf Fixed another crash from the Entropy Manipulator.
I have no words for this one.
2017-07-02 06:57:40 +02:00
Gunther De Wachter ee774cd3f8 Even more null fixes. 2017-07-02 06:43:33 +02:00
Gunther De Wachter 0a2f90d115 Fixed Entropy Manipulator crash. 2017-07-02 06:17:23 +02:00
Gunther De Wachter 0f86efa3f5 Added workaround for dispenser logic. 2017-07-02 06:05:43 +02:00
Gunther De Wachter 7398af0e1c Add an ease of use tooltip to the creative cell. Displays the items provided/formatted by the cell. 2017-07-02 05:26:37 +02:00
Gunther De Wachter eb0b304fd9 Even more null fixes. 2017-07-02 04:13:49 +02:00
Gunther De Wachter c455ee69b8 When not shifting an encoded item pattern item should let the right click through. 2017-07-02 04:11:26 +02:00
Gunther De Wachter 820a6bdbd6 Fixed the ME system not finding any Crafting CPU's.
Might have to rework it a bit later. looks kind of ugly like this.
2017-07-01 09:08:43 +02:00
Gunther De Wachter 7a8499c455 Fixed tools not working due to a change in the onItemUse method fields in ItemStack.java
I will have to fix the dispenser logic. Manually right clicking works.
2017-06-30 19:17:06 +02:00
Gunther De Wachter 76f17ba53c Fixed Network Tool crashing on null ItemStacks. 2017-06-30 18:35:38 +02:00
Gunther De Wachter 16a0872d06 Fixed Crafting Multiblocks not forming. I accidentally used the wrong subclass to define the StorageTiles here. 2017-06-30 18:16:02 +02:00
Gunther De Wachter 49a87f62ce More null's and cosmetic fixes. 2017-06-30 17:30:03 +02:00
Gunther De Wachter c382ab7300 Made the SkyChestTE's class names more in line with the other ones. 2017-06-30 17:25:02 +02:00
Gunther De Wachter 49a6df5bc7 Fixed up the Tile Entity mess a bit, still need to look at the CableBus stuff a bit though. 2017-06-30 17:22:06 +02:00
Gunther De Wachter 10e050c35b Fixed potential memory leak in the UI code. 2017-06-30 17:17:34 +02:00
Gunther De Wachter b1e249aad0 Fixed Color Applicator not accepting dyes as valid items 2017-06-29 11:34:39 +02:00
Gunther De Wachter d3bb71d834 Fixed JEI clearing the search bar. That last commit was pushed a bit too hastily. 2017-06-29 10:40:47 +02:00
Gunther De Wachter 3f7051ec8e Fixed clearing of the search bar when looking at recipes
Why mezz why...
2017-06-29 10:30:14 +02:00
Gunther De Wachter 2f1f19bbb3 Fixed ResourceLocation for the items and seeds. 2017-06-29 06:34:02 +02:00
yueh 4c7f065af3 Fixes #2729: Fix transformer regression introduced during FG downtime. (#2730)
Added a unittest to verify the necessary string returns match the actual
existing classes, in case something screws up the refactoring.
2017-06-29 06:00:23 +02:00
yueh 6c52f31686 Replaces old fluid handlers with the new capability based ones. (#2727)
* Changed ME Chest and P2P tunnels to use fluid capabilities.
* Renamed all occurrences of liquid to fluids.
2017-06-29 05:57:43 +02:00
Gunther De Wachter 3ac7e518b1 Fixed compile error from cherry-picked commit. 2017-06-29 05:47:51 +02:00
yueh af85a2bf67 Fixes #2713: Call super#onBlockActivated() for wrench interaction. (#2728) 2017-06-29 05:39:31 +02:00
Gunther De Wachter c4b4a257f3 Removed old ASMIntegration file, the rename didn't get picked up by the cherry-pick 2017-06-29 05:39:11 +02:00
yueh 4eba3bca5b Fixes IDE not correctly cleaning up the list of staged files. 2017-06-29 05:35:50 +02:00
yueh cd78586910 Fixes #2768: Incorrect return value when charging items via Tesla. (#2771) 2017-06-29 05:26:00 +02:00
Gunther De Wachter 178198b0c6 Fixed render issue with cables/certain blocks on a specific side. 2017-06-29 04:16:35 +02:00
Gunther De Wachter bdf46a6ee2 Fixed hoppers continuing to insert when they shouldn't into inscribers. Thanks @fscan
Original pull request : #2933
2017-06-28 18:11:11 +02:00
Gunther De Wachter 0be2011645 Fixed blank patterns in the pattern terminal not decreasing when encoding a pattern. 2017-06-28 06:21:11 +02:00
Gunther De Wachter bce500616c Fixed exception being thrown when placing last item of a stack of parts. 2017-06-28 06:19:17 +02:00
Gunther De Wachter e022c23c8f Fixed crash on startup. Apparently there's still null's lurking in the code. 2017-06-27 20:52:56 +02:00
Gunther De Wachter 61b81fc802 Fix facade recipes. Hopefully the last null check fix. 2017-06-27 20:39:06 +02:00
Gunther De Wachter b819fe4adb Fixed "Air" tooltip displaying in the interface terminal. More missed null checks. 2017-06-27 18:00:55 +02:00
Gunther De Wachter 66a797dd7c Fixed grindstone not working with crank due to missed null checks. 2017-06-27 17:20:13 +02:00
Gunther De Wachter 99c294e948 More aesthetic and typo fixes. 2017-06-27 04:04:48 +02:00
Gunther De Wachter 6529de911a Code aesthetics and typo fixes. 2017-06-26 16:35:50 +02:00
Gunther De Wachter 650edae902 More ItemStack null changes. 2017-06-26 07:07:04 +02:00
Gunther De Wachter 78904204cf Fixed inscriber not starting due to vanilla changes. 2017-06-26 07:06:19 +02:00
Gunther De Wachter df7ab00c37 Fixed a null check when the array wasn't initialised yet. I should fix this up in the future though. 2017-06-26 05:43:08 +02:00
Gunther De Wachter 5432decf95 Fix items showing up as craftable when they weren't after taking out the last one. 2017-06-26 05:42:21 +02:00
Gunther De Wachter da5879b667 First batch of null -> isEmpty() checks.
I most likely still missed a ton of checks...
2017-06-26 05:15:25 +02:00
Gunther De Wachter 370fc49357 Temporary (?) hacky fix to display the craftable items
This is kind of a hackjob IMO but it saves me the trouble of possibly rewriting large portions of either the AE codebase or ASM'ing the vanilla classes.
2017-06-25 18:01:30 +02:00
Gunther De Wachter c74aaddbd3 Fixed texture issue for the crafting window. 2017-06-24 16:50:26 +02:00
Gunther De Wachter 1a4db4b8d7 Fixed taking items out of the AE system
Same issue as last commit. ItemStacks with a count of 0 get "nullified".
2017-06-24 16:45:28 +02:00
Gunther De Wachter d77d21858e Fixed manually crafting items
This can hopefully be done in a more sensible fashion later.
2017-06-24 15:51:03 +02:00
Gunther De Wachter 42bfc549be Fixed drawing of items in storage.
An ItemStack count of 0 trips the check for isEmpty and hence doesn't give us the item we want.
2017-06-24 15:01:06 +02:00
Gunther De Wachter c6bdf845a8 Add a temporary (?) method to register the TileEntities because the Forge method changed from 1.10 to 1.11.2. 2017-06-03 00:53:32 +02:00
Gunther De Wachter ccc46e77a3 Fix the coremod looking for the wrong minecraft version 2017-06-03 00:01:01 +02:00
Gunther De Wachter 7e45cf0e37 Add the remainder of the WAILA/IC2 disable comments for now while we focus on fixing the core mod 2017-06-02 23:57:57 +02:00
Gunther De Wachter 86dd8193f7 Add/Change some missing code for the 1.11.2 upgrade 2017-06-02 23:55:31 +02:00
Gunther De Wachter 5fff8310d6 Update gradle and dependencies for 1.11.2 2017-06-02 23:37:27 +02:00
yueh 1cde7bc933 Changed to Null ItemStack instead of null. 2016-12-21 20:38:37 +01:00
yueh ed9e6dd21c Port to 1.11 2016-12-21 20:38:36 +01:00
yueh 589730bfad Fixes #2707: Calculuate the correct AABB for a rotated skychest. 2016-12-17 23:47:42 +01:00
yueh 8700a79ca6 Fixes #2684: Avoid transforming charged quartz when dead. 2016-12-17 23:04:35 +01:00
yueh a14cf2204d Fixes anchor rendering (#2698)
* Fixes #2680: Use a shorter cable anchor model when blocked by a facade.
* Fixes #2664: Prevent anchors from creating intersection.

Replaced the simple List<ResourceLocation> for the static models with a
new container also indicating a solid part, which can be used to prevent
the creation of an intersection.
2016-12-14 22:37:10 +01:00
yueh 8bed7f223e TheOneProbe integration (#2696)
Displayed information is equal to current the WAILA integration.

Added a preInit stage to IIntegrationModule.
Added a factory method to IntegrationType to avoid touching
IntegrationNode for every new integration.

Fixes #2650
2016-12-14 22:36:40 +01:00
yueh db85419702 Restructured registry packages (#2703)
Moved larger registries together with their related classes instead of putting unrelated classes into the same package.
2016-12-14 22:35:52 +01:00
yueh fb79fd284d Replaced Watcher using Collection with a more fitting interface (#2693)
Replaced the watchers for energy, storage and crafting with a more fitting interface compared to a common collection.

Fixes #229
2016-12-14 18:30:49 +01:00
yueh e3305c1963 Update Forge to latest RB
Updated JEI
2016-12-14 17:46:16 +01:00
yueh a3c85b4a59 Fixes #2699: Do not trust the stackSize in case of internal changes.
An external inventory might change the stacksize of the slot we currently
are extracting from. Thus we have to cache the initial stackSize for a later
calculation of the extracted amount per slot.
As other inventories might NOT change the stacksize after a modification,
we can not use the stack reaching 0 as conditions to break.
2016-12-14 11:25:49 +01:00
yueh a2b20f1d67 Fixes #2689: Do not pass our own blockstate to the adjacent block. 2016-12-08 21:29:46 +01:00
yueh 86908b1ae6 Fixes #2647: Prevent crafting status from crashing due to missing network. 2016-12-08 13:07:25 +01:00
dshadowwolf 6bf52b0b0f Fixes constant reequip animation on portable cells/terminals (#2690)
Fix for portable cell and wireless terminal going into re-equip animations when GUI is open.
2016-12-08 12:34:41 +01:00
yueh eb1e86cacb Refactored GrinderRegistry. (#2644)
* Refactored GrinderRegistry.

Changed IGrinderRegistry#getRecipes to return an unmodifiable collection.
Added a way to remove recipes explicitly instead the internal list.
Added a cache to lookup recipes instead of iterating a list.

Renamed IGrinderEntry to IGrinderRecipe
Made IGrindRecipe immutable for easy caching.

Improved GrinderLogging and Exception Handling
JEI Workaround as it expects a List instead Collection.

* Added blacklist of explicit oredict names for the grindstone.

This can be used should the automatic recipe generation create unintended
loopholes.
2016-12-02 23:47:50 +01:00
yueh c405e725b2 Fixes #2667: Use new IC2 item names for P2P attunement. 2016-12-02 22:16:29 +01:00
yueh d377af9a69 Fixes #2675: Set fullBlock correctly afterwards.
Reduces the visibility of some methods as these should be access through the public methods of Block or the overridden ones.
Removes now useless getCheckedSubBlocks.
2016-12-02 22:15:56 +01:00
yueh 12dbd17320 Fixes #2666: Restore inventory after powerloss and still avoid dupes. 2016-12-01 16:17:46 +01:00
yueh 5028c8025b Fixes #2669: Missing particle texture for pylons. 2016-12-01 10:56:01 +01:00
yueh d11d6e754f Fixes #2655, #2276: Two dupe bugs related to network storage handling
* Fixes #2655: Actually remove an ICellContainer before updating the list.
* Fixes #2276: Apply tracker changes in the correct order.
2016-11-26 14:09:30 +01:00
yueh 887339f7b8 Removed ASMTweaker and replaced it with AT. (#2636)
Added appeng_at.cfg and updated build.gradle to correctly include the AT when building.
Deleted the now useless ASMTweaker.
Moved the coremod from package transformer to coremod as a better matching name.
Updated the old 1.7.10 code using reflection to drop it where forge or vanilla now exposes that functionality directly.
2016-11-26 14:08:10 +01:00
yueh a665200c31 Refactored AEConfig (#2633)
Added a singleton getter instead the public field.
Reduced all fields to private.
Replaced field access with getters.
Added setters where necessary (Dimension/Biome Registration)
Added config options to disable more features.
Splitted Enum name from the config key.
Changed FacadeConfig and Networkhandler similar to AEConfig.init().
2016-11-26 14:07:34 +01:00
yueh 6554e295d5 Updated dependencies.
Updated Forge and MCP Mappings.
Updated JEI, Tesla and IC2 APIs.
2016-11-17 10:50:06 +01:00
yueh 4eeb554dcb Fixes #2623: Network Tool not removing facades with shift rightlick. 2016-11-15 22:48:16 +01:00
yueh 3eae4a7d19 Fixes #2626: Subtract the correct amount from the remaining amount. 2016-11-15 22:14:17 +01:00
1355 changed files with 24331 additions and 17354 deletions
+11 -6
View File
@@ -12,15 +12,18 @@ top of things.
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
* If it is already possible with vanilla and AE2 itself, the suggestion will be considered invalid.
* Asking for a smaller version, more compact version, or more efficient version of something will also be considered invalid.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* The following details are required. Not including them can cause the issue to be closed.
* Do not tag it with something like `[Feature]`, `[Bug]`, or a version.
* Restrict it to a single bug or feature, it makes managing them way easier for us.
* The following details are required. Also refer to the issue template when creating one.
* Forge version
* AE2 version
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Do not post an excerpt of what you consider important, instead:
* Post the full log
* Never post an excerpt of what you consider important
* Always post the full log
* Other mods and their version, when reporting an issue between AE and another mod
* Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
@@ -33,10 +36,12 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
5. Click `Submit New Issue`, and wait for feedback!
4. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
Please note that we might close any issue not matching these requirements.
### Submitting Changes
* Submit an issue to the github project, assuming one does not already exist.
@@ -108,7 +113,7 @@ the styling guidelines used by AE.
PRs that do not conform to these standards will be rejected.
You can find presets for Eclipse and IntelliJ IDEA in the `codeformat` folder.
We try to keep them up to date, but in case you find them not formatting it correctly, then please report it
We try to keep them up to date. Please report any case of maintaining the correct formatting.
### Whitespace
+18 -22
View File
@@ -1,5 +1,5 @@
[![Travis](https://img.shields.io/travis/AppliedEnergistics/Applied-Energistics-2.svg?maxAge=2592000&style=flat-square)](https://travis-ci.org/AppliedEnergistics/Applied-Energistics-2)
[![Latest Release](https://img.shields.io/github/release/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest Release&style=flat-square)](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
[![Latest Release](https://img.shields.io/github/release/AppliedEnergistics/Applied-Energistics-2.svg?label=Latest%20Release&style=flat-square)](https://github.com/AppliedEnergistics/Applied-Energistics-2/releases)
# Applied Energistics 2
@@ -9,7 +9,6 @@
* [Contacts](#contacts)
* [License](#license)
* [Downloads](#downloads)
* [Nightly Builds](#nightly-builds)
* [Installation](#installation)
* [Issues](#issues)
* [Building](#building)
@@ -31,13 +30,13 @@ A Mod about Matter, Energy and using them to conquer the world..
## License
* Applied Energistics 2 API
- (c) 2013 - 2015 AlgorithmX2 et al
- (c) 2013 - 2017 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-MIT-red.svg?style=flat-square)](http://opensource.org/licenses/MIT)
* Applied Energistics 2
- (c) 2013 - 2015 AlgorithmX2 et al
- (c) 2013 - 2017 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-LGPLv3-blue.svg?style=flat-square)](https://raw.githubusercontent.com/AppliedEnergistics/Applied-Energistics-2/rv2/LICENSE)
* Textures and Models
- (c) 2013 - 2015 AlgorithmX2 et al
- (c) 2013 - 2017 AlgorithmX2 et al
- [![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%203.0-yellow.svg?style=flat-square)](https://creativecommons.org/licenses/by-nc-sa/3.0/)
* Text and Translations
- [![License](https://img.shields.io/badge/License-No%20Restriction-green.svg?style=flat-square)](https://creativecommons.org/publicdomain/zero/1.0/)
@@ -46,14 +45,6 @@ A Mod about Matter, Energy and using them to conquer the world..
Downloads can be found on [CurseForge](http://www.curse.com/mc-mods/minecraft/223794-applied-energistics-2) or on the [official website](http://ae-mod.info/Downloads/).
## Nightly Builds
[![Build status](https://ci.appveyor.com/api/projects/status/w0sg7upakn0vj5gc?svg=true)](https://ci.appveyor.com/project/shartte/applied-energistics-2/history)
[Download Latest Nightly Build](https://ci.appveyor.com/api/projects/shartte/applied-energistics-2/artifacts/ae2-rv4-nightly.zip?branch=master)
Nightly builds for the Minecraft 1.10.2 branch of AE2 (rv4-alpha) are available from [AppVeyor](https://ci.appveyor.com/project/shartte/applied-energistics-2/history). These builds are only for testing purposes and might lead to loss of data, and will contain significant bugs. Please see below on how you can report bugs you find during testing.
## Installation
You install this mod by putting it into the `minecraft/mods/` folder. It has no additional hard dependencies.
@@ -63,15 +54,18 @@ You install this mod by putting it into the `minecraft/mods/` folder. It has no
Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue now!
1. Make sure your issue has not already been answered or fixed and you are using the latest version. Also think about whether your issue is a valid one before submitting it.
* If it is already possible with vanilla and AE2 itself, the suggestion will be considered invalid.
* Asking for a smaller version, more compact version, or more efficient version of something will also be considered invalid.
2. Go to [the issues page](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues) and click [new issue](https://github.com/AppliedEnergistics/Applied-Energistics-2/issues/new)
3. Enter your a title of your issue (something that summarizes your issue), and then create a detailed description of the issue.
* Do not tag it with something like `[Feature]` or `[Bug]`. When it is applicable, we will take care of it.
* The following details are required. Not including them can cause the issue to be closed.
* Do not tag it with something like `[Feature]`, `[Bug]`, or a version.
* Restrict it to a single bug or feature, it makes managing them way easier for us.
* The following details are required. Also refer to the issue template when creating one.
* Forge version
* AE2 version
* Crash log, when reporting a crash (Please make sure to use [pastebin](http://pastebin.com/))
* Do not post an excerpt of what you consider important, instead:
* Post the full log
* Never post an excerpt of what you consider important
* Always post the full log
* Other mods and their version, when reporting an issue between AE and another mod
* Also consider updating these before submitting a new issue, it might be already fixed
* A detailed description of the bug or feature
@@ -84,10 +78,12 @@ Applied Energistics 2 crashing, have a suggestion, found a bug? Create an issue
* Mod Pack using and version?
* Keep in mind that some mods might use an outdated version of AE2
* If so you should report it to your modpack
5. Click `Submit New Issue`, and wait for feedback!
4. Click `Submit New Issue`, and wait for feedback!
Providing as many details as possible does help us to find and resolve the issue faster and also you getting a fixed version as fast as possible.
Please note that we might close any issue not matching these requirements.
## Building
1. Clone this repository via
@@ -103,14 +99,14 @@ Providing as many details as possible does help us to find and resolve the issue
- Eclipse: execute `gradlew eclipse`
5. For add-on developer: Core-Mod Detection
- In order to have FML detect AE from your dev environment, add the following VM Option to your run profile
- `-Dfml.coreMods.load=appeng.transformer.AppEngCore`
- `-Dfml.coreMods.load=appeng.coremod.AppEngCore`
## Contribution
Before you want to add major changes, you might want to discuss them with us first, before wasting your time.
If you are still willing to contribute to this project, you can contribute via [Pull-Request](https://help.github.com/articles/creating-a-pull-request).
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
The [guidelines for contributing](https://github.com/AppliedEnergistics/Applied-Energistics-2/blob/master/.github/CONTRIBUTING.md) contain more detailed information about topics like the used code style and should also be considered.
Here are a few things to keep in mind that will help get your PR approved.
@@ -122,7 +118,7 @@ Here are a few things to keep in mind that will help get your PR approved.
- Does your feature simplify another feature of AE2? These changes will not be accepted.
- If your feature can be done by any popular mod, discuss with us first.
Getting Started
**Getting Started**
1. Fork this repository
2. Clone the fork via
@@ -142,7 +138,7 @@ If you are only doing single file pull requests, GitHub supports using a quick w
The API for Applied Energistics 2. It is open source to discuss changes, improve documentation, and provide better add-on support in general.
Development and standard builds can be obtained [Here](http://ae2.ae-mod.info/Downloads/).
Universal builds obtained [Here](http://ae2.ae-mod.info/Downloads/) should work in a development environment.
### Maven
+12 -17
View File
@@ -27,7 +27,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
@@ -45,6 +45,12 @@ apply from: 'gradle/scripts/optional.gradle'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// ensure everything uses UTF-8 and not some random codepage chosen by gradle
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
version = aeversion + "-" + aechannel + "-" + aebuild
group = aegroup
archivesBaseName = aebasename
@@ -52,7 +58,7 @@ archivesBaseName = aebasename
// Add Coremod Manifest
jar {
manifest {
attributes 'FMLCorePluginContainsFMLMod': 'true'
attributes 'FMLAT': 'appeng_at.cfg'
}
from sourceSets.api.output
@@ -63,11 +69,10 @@ jar {
include "assets/**"
include "mcmod.info"
include "pack.mcmeta"
include "META-INF/appeng_at.cfg"
}
minecraft {
coreMod = "appeng.transformer.AppEngCore"
version = minecraft_version + "-" + forge_version
replaceIn "AEConfig.java"
@@ -84,21 +89,8 @@ minecraft {
}
sourceSets {
api
// This source set will contain third party API code that we need to compile, but which is not shipped with the jar
thirdparty {
// Third Party APIs often need access to Minecraft classes (i.e. EnumFacing), so set this up here
compileClasspath += configurations.forgeGradleMc + configurations.forgeGradleMcDeps
}
main
}
dependencies {
compile sourceSets.thirdparty.output
}
processResources
@@ -117,4 +109,7 @@ processResources
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
// move access transformer to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
}
+27 -8
View File
@@ -1,24 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="AE2" version="12">
<profiles version="13">
<profile kind="CodeFormatterProfile" name="AE2" version="13">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
@@ -26,17 +30,19 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
@@ -52,14 +58,16 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
@@ -82,6 +90,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
@@ -93,15 +102,16 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
@@ -112,9 +122,10 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
@@ -153,15 +164,18 @@
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="insert"/>
@@ -183,6 +197,7 @@
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
@@ -194,8 +209,10 @@
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
@@ -256,6 +273,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
@@ -271,6 +289,7 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
+15 -8
View File
@@ -1,4 +1,4 @@
aeversion=rv4
aeversion=rv5
aechannel=alpha
aebuild=0
aegroup=appeng
@@ -7,18 +7,25 @@ aebasename=appliedenergistics2
#########################################################
# Versions #
#########################################################
minecraft_version=1.10.2
mcp_mappings=snapshot_20161018
forge_version=12.18.2.2104
minecraft_version=1.12
mcp_mappings=snapshot_20170704
forge_version=14.21.1.2412
#########################################################
# Installable #
#########################################################
waila_version=1.7.0-B3_1.9.4
hwyla_version=1.8.19-B33_1.12
#########################################################
# Provided APIs #
#########################################################
jei_version=3.12.7.312
tesla_version=1.10.2-1.2.1.49
ic2_version=2.6.96-ex110
jei_version=4.7.1.69
tesla_version=1.0.61
ic2_version=2.8.9-ex112
top_version=1.12-1.4.8-2
#########################################################
# Deployment #
#########################################################
website_version=1.12.x
curse_versions=1.12,1.12.1
+28 -3
View File
@@ -38,6 +38,26 @@ repositories {
name = "IC2 repo"
url = "http://maven.ic2.player.to"
}
maven {
name = "CoFH Maven"
url = "http://maven.covers1624.net"
}
maven { // TheOneProbe
name 'tterrag maven'
url "http://maven.tterrag.com/"
}
maven { // McJtyLib
name 'mcjty'
url "http://maven.k-4u.nl/"
}
maven { // Hwyla
name 'tehnut'
url "http://tehnut.info/maven"
}
}
configurations {
@@ -46,14 +66,19 @@ configurations {
dependencies {
// installable runtime dependencies
mods "mcp.mobius.waila:Waila:${waila_version}"
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
mods "mcjty.theoneprobe:TheOneProbe-${minecraft_version}:${top_version}"
// mods "com.github.mcjty:compatlayer:${compatlayer_version}"
// compile against provided APIs
compileOnly "mezz.jei:jei_${minecraft_version}:${jei_version}:api"
compileOnly "mcp.mobius.waila:Waila:${waila_version}"
compileOnly "net.darkhax.tesla:Tesla:${tesla_version}"
compileOnly "mcp.mobius.waila:Hwyla:${hwyla_version}"
compileOnly "net.darkhax.tesla:Tesla-${minecraft_version}:${tesla_version}"
compileOnly "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
compileOnly "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}:api"
// deobfCompile "mcp.mobius.waila:Hwyla:${hwyla_version}"
// at runtime, use the full JEI jar
runtime "mezz.jei:jei_${minecraft_version}:${jei_version}"
+18 -6
View File
@@ -20,18 +20,18 @@ task wrapper(type: Wrapper) {
gradleVersion = "2.14"
}
// WAILA
task installWaila(type: Copy, dependsOn: "deinstallWaila") {
// HWYLA
task installHwyla(type: Copy, dependsOn: "deinstallHwyla") {
from { configurations.mods }
include "**/*Waila*.jar"
include "**/*Hwyla*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallWaila(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Waila*.jar")
task deinstallHwyla(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*Hwyla*.jar")
}
// IC²
// IC2
task installIC2(type: Copy, dependsOn: "deinstallIC2") {
from { configurations.mods }
include "**/*industrialcraft-2*.jar"
@@ -41,3 +41,15 @@ task installIC2(type: Copy, dependsOn: "deinstallIC2") {
task deinstallIC2(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*industrialcraft-2*.jar")
}
// TOP
task installTop(type: Copy, dependsOn: ["deinstallTop"]) {
from { configurations.mods }
include "**/*TheOneProbe*.jar"
into file(minecraft.runDir + "/mods")
}
task deinstallTop(type: Delete) {
delete fileTree(dir: minecraft.runDir + "/mods", include: "*TheOneProbe*.jar")
}
+1 -1
View File
@@ -1,4 +1,4 @@
#Fri Sep 16 14:56:32 CEST 2016
#Tue Jul 04 22:38:49 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
@@ -54,7 +54,7 @@ public class BakingPipeline<F, T> implements BakingPipelineElement<F, T>
@Override
public List pipe( List things, IBakedModel parent, IBlockState state, EnumFacing side, long rand )
{
for( BakingPipelineElement pipe : pipeline )
for( BakingPipelineElement pipe : this.pipeline )
{
things = pipe.pipe( things, parent, state, side, rand );
}
@@ -28,7 +28,7 @@ public enum TunnelType
{
ME, // Network Tunnel
IC2_POWER, // EU Tunnel
RF_POWER, // RF Tunnel
FE_POWER, // Forge Energy tunnel
REDSTONE, // Redstone Tunnel
FLUID, // Fluid Tunnel
ITEM, // Item Tunnel
@@ -111,8 +111,6 @@ public interface IMaterials
IItemDefinition matterBall();
IItemDefinition ironNugget();
IItemDefinition certusQuartzCrystal();
IItemDefinition certusQuartzCrystalCharged();
@@ -38,7 +38,9 @@ public interface IParts
AEColoredItemDefinition cableGlass();
AEColoredItemDefinition cableDense();
AEColoredItemDefinition cableDenseCovered();
AEColoredItemDefinition cableDenseSmart();
AEColoredItemDefinition lumenCableSmart();
@@ -46,7 +48,7 @@ public interface IParts
AEColoredItemDefinition lumenCableGlass();
AEColoredItemDefinition lumenCableDense();
AEColoredItemDefinition lumenDenseCableSmart();
IItemDefinition quartzFiber();
@@ -76,11 +78,11 @@ public interface IParts
IItemDefinition p2PTunnelItems();
IItemDefinition p2PTunnelLiquids();
IItemDefinition p2PTunnelFluids();
IItemDefinition p2PTunnelEU();
// IItemDefinition p2PTunnelRF();
IItemDefinition p2PTunnelFE();
IItemDefinition p2PTunnelLight();
@@ -24,13 +24,17 @@
package appeng.api.features;
import java.util.Optional;
import javax.annotation.Nonnull;
import net.minecraft.item.ItemStack;
/**
* Registration Records for {@link IGrinderRegistry}
*/
public interface IGrinderEntry
public interface IGrinderRecipe
{
/**
@@ -38,66 +42,40 @@ public interface IGrinderEntry
*
* @return input that the grinder will accept.
*/
@Nonnull
ItemStack getInput();
/**
* lets you change the grinder recipe by changing its input.
*
* @param input input item
*/
void setInput( ItemStack input );
/**
* gets the current output
*
* @return output that the grinder will produce
*/
@Nonnull
ItemStack getOutput();
/**
* allows you to change the output.
* gets the current output
*
* @param output output item
* @return output that the grinder will produce
*/
void setOutput( ItemStack output );
@Nonnull
Optional<ItemStack> getOptionalOutput();
/**
* gets the current output
*
* @return output that the grinder will produce
*/
ItemStack getOptionalOutput();
/**
* gets the current output
*
* @return output that the grinder will produce
*/
ItemStack getSecondOptionalOutput();
/**
* stack, and 0.0-1.0 chance that it will be generated.
*
* @param output output item
* @param chance generation chance
*/
void setOptionalOutput( ItemStack output, float chance );
Optional<ItemStack> getSecondOptionalOutput();
/**
* 0.0 - 1.0 the chance that the optional output will be generated.
*
* @return chance of optional output
*/
@Nonnull
float getOptionalChance();
/**
* stack, and 0.0-1.0 chance that it will be generated.
*
* @param output second optional output item
* @param chance second optional output chance
*/
void setSecondOptionalOutput( ItemStack output, float chance );
/**
* 0.0 - 1.0 the chance that the optional output will be generated.
*
@@ -106,16 +84,10 @@ public interface IGrinderEntry
float getSecondOptionalChance();
/**
* Energy cost, in turns.
* Amount of turns required to process the item.
*
* @return number of turns it takes to produce the output from the input.
*/
int getEnergyCost();
int getRequiredTurns();
/**
* Allows you to adjust the number of turns
*
* @param c number of turns to produce output.
*/
void setEnergyCost( int c );
}
@@ -24,7 +24,10 @@
package appeng.api.features;
import java.util.List;
import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
@@ -36,51 +39,90 @@ public interface IGrinderRegistry
{
/**
* Current list of registered recipes, you can modify this if you want too.
* An immutable list of the currently registered recipes.
*
* @return currentlyRegisteredRecipes
*/
List<IGrinderEntry> getRecipes();
@Nonnull
Collection<IGrinderRecipe> getRecipes();
/**
* add a new recipe the easy way, in &#8594; out, how many turns., duplicates will not be added.
* Add a new recipe with a single input and output and how many turns it requires.
*
* @param in input
* @param out output
* @param turns amount of turns to turn the input into the output
* Will ignore duplicate recipes with the same input item.
*
* @param in The {@link ItemStack} to grind.
* @param out The {@link ItemStack} to output.
* @param turns Amount of turns to turn the input into the output, with turns > 0.
*/
void addRecipe( ItemStack in, ItemStack out, int turns );
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, int turns );
/**
* Add a new recipe with an input, output and a single optional output.
*
* Will ignore duplicate recipes with the same input item.
*
* @param in The {@link ItemStack} to grind.
* @param out The {@link ItemStack} to output.
* @param optional The optional {@link ItemStack} to output of a certain chance.
* @param chance Chance to get the optional output within 0.0 - 1.0
* @param turns Amount of turns to turn the input into the output, with turns > 0.
*/
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, int turns );
/**
* add a new recipe with optional outputs, duplicates will not be added.
*
* @param in input
* @param out output
* @param optional optional output
* @param chance chance to get the optional output within 0.0 - 1.0
* @param turns amount of turns to turn the input into the outputs
*/
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, int turns );
/**
* add a new recipe with optional outputs, duplicates will not be added.
* Will ignore duplicate recipes with the same input item.
*
* @param in input
* @param out output
* @param optional optional output
* @param chance chance to get the optional output within 0.0 - 1.0
* @param optional2 second optional output
* @param in The {@link ItemStack} to grind.
* @param out The {@link ItemStack} to output.
* @param optional The first optional {@link ItemStack} to output of a certain chance.
* @param chance Chance to get the first optional output within 0.0 - 1.0
* @param optional2 The second optional {@link ItemStack} to output of a certain chance.
* @param chance2 chance to get the second optional output within 0.0 - 1.0
* @param turns amount of turns to turn the input into the outputs
* @param turns Amount of turns to turn the input into the output, with turns > 0.
*
*/
void addRecipe( ItemStack in, ItemStack out, ItemStack optional, float chance, ItemStack optional2, float chance2, int turns );
void addRecipe( @Nonnull ItemStack in, @Nonnull ItemStack out, @Nonnull ItemStack optional, float chance, @Nonnull ItemStack optional2, float chance2, int turns );
/**
* Remove the specific from the recipe list.
*
* @param recipe The recipe to be removed.
* @return true, if it was removed
*/
boolean removeRecipe( @Nonnull IGrinderRecipe recipe );
/**
* Searches for a recipe for a given input, and returns it.
*
* @param input input
* @param input The {@link ItemStack} to be grinded.
*
* @return identified recipe or null
*/
IGrinderEntry getRecipeForInput( ItemStack input );
@Nullable
IGrinderRecipe getRecipeForInput( @Nonnull ItemStack input );
/**
* Allows do add a custom ratio from an ore to dust when being grinded.
*
* The default ratio is 1 ore to 2 dusts.
*
* These have to be added before any recipe is registered. Otherwise it will use the default value.
*
* @param oredictName The name of the ore;
* @param ratio The amount, must be > 0;
*/
void addDustRatio( @Nonnull String oredictName, int ratio );
/**
* Remove a custom ratio for a specific ore name.
*
* Will use the default of 2 value afterwards.
*
* @param oredictName The name of the ore;
*/
boolean removeDustRatio( @Nonnull String oredictName );
}
@@ -24,6 +24,7 @@
package appeng.api.features;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.item.ItemStack;
@@ -44,7 +45,8 @@ public interface IP2PTunnelRegistry
* @param trigger - the item which triggers attunement. Nullable, but then ignored
* @param type - the type of tunnel. Nullable, but then ignored
*/
void addNewAttunement( @Nullable ItemStack trigger, @Nullable TunnelType type );
void addNewAttunement( @Nonnull ItemStack trigger, @Nullable TunnelType type );
void addNewAttunement( @Nonnull String ModId, @Nullable TunnelType type );
/**
* returns null if no attunement can be found.
@@ -53,6 +55,6 @@ public interface IP2PTunnelRegistry
*
* @return null if no attunement can be found or attunement
*/
@Nullable
@Nonnull
TunnelType getTunnelTypeByItem( ItemStack trigger );
}
@@ -24,7 +24,7 @@
package appeng.api.implementations.guiobjects;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.items.IItemHandler;
import appeng.api.networking.IGridHost;
@@ -32,8 +32,9 @@ import appeng.api.networking.IGridHost;
/**
* Obtained via {@link IGuiItem} getGuiObject
*/
public interface INetworkTool extends IInventory, IGuiItemObject
public interface INetworkTool extends IGuiItemObject
{
IGridHost getGridHost(); // null for most purposes.
IItemHandler getInventory();
}
@@ -27,6 +27,7 @@ package appeng.api.implementations.items;
import net.minecraft.item.ItemStack;
import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.networking.energy.IAEPowerStorage;
@@ -42,27 +43,27 @@ public interface IAEItemPowerStorage
*
* @return amount unable to be stored
*/
double injectAEPower( ItemStack is, double amt );
double injectAEPower( ItemStack stack, double amount, Actionable mode );
/**
* Attempt to extract power from the device, it will extract what it can and
* return it.
*
* @param amt to be extracted power from device
* @param amount to be extracted power from device
*
* @return what it could extract
*/
double extractAEPower( ItemStack is, double amt );
double extractAEPower( ItemStack stack, double amount, Actionable mode );
/**
* @return the current maximum power ( this can change :P )
*/
double getAEMaxPower( ItemStack is );
double getAEMaxPower( ItemStack stack );
/**
* @return the current AE Power Level, this may exceed getMEMaxPower()
*/
double getAECurrentPower( ItemStack is );
double getAECurrentPower( ItemStack stack );
/**
* Control the power flow by telling what the network can do, either add? or
@@ -70,5 +71,5 @@ public interface IAEItemPowerStorage
*
* @return access restriction of network
*/
AccessRestriction getPowerFlow( ItemStack is );
AccessRestriction getPowerFlow( ItemStack stack );
}
@@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import appeng.api.implementations.TransitionResult;
import appeng.api.storage.ISpatialDimension;
import appeng.api.util.WorldCoord;
@@ -57,7 +58,7 @@ public interface ISpatialStorageCell
*
* @return the world for this cell
*/
World getWorld( ItemStack is );
ISpatialDimension getSpatialDimension();
/**
* get the currently stored size.
@@ -69,22 +70,13 @@ public interface ISpatialStorageCell
WorldCoord getStoredSize( ItemStack is );
/**
* Minimum coordinates in its world for the storage cell.
* get the currently stored Dimension id.
*
* @param is spatial storage cell
*
* @return minimum coordinate of dimension
* @return dimension id or -1
*/
WorldCoord getMin( ItemStack is );
/**
* Maximum coordinates in its world for the storage cell.
*
* @param is spatial storage cell
*
* @return maximum coordinate of dimension
*/
WorldCoord getMax( ItemStack is );
int getStoredDimensionID( ItemStack is );
/**
* Perform a spatial swap with the contents of the cell, and the world.
@@ -93,9 +85,9 @@ public interface ISpatialStorageCell
* @param w world of spatial
* @param min min coord
* @param max max coord
* @param doTransition transition
* @param playerId owner of current grid or -1
*
* @return result of transition
*/
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, boolean doTransition );
TransitionResult doSpatialTransition( ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId );
}
@@ -23,8 +23,7 @@
package appeng.api.implementations.tiles;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.items.IItemHandler;
public interface ISegmentedInventory
@@ -38,5 +37,5 @@ public interface ISegmentedInventory
*
* @return inventory with inventory name
*/
IInventory getInventoryByName( String name );
IItemHandler getInventoryByName( String name );
}
@@ -23,8 +23,7 @@
package appeng.api.implementations.tiles;
import net.minecraft.inventory.IInventory;
import net.minecraftforge.items.IItemHandler;
public interface IViewCellStorage
@@ -35,5 +34,5 @@ public interface IViewCellStorage
*
* @return inventory with at least 5 slot
*/
IInventory getViewCellStorage();
IItemHandler getViewCellStorage();
}
@@ -24,12 +24,36 @@
package appeng.api.networking.crafting;
import java.util.Collection;
import appeng.api.storage.data.IAEStack;
public interface ICraftingWatcher extends Collection<IAEStack>
/**
* DO NOT IMPLEMENT.
*
* Will be injected when adding an {@link ICraftingWatcherHost} to a grid.
*/
public interface ICraftingWatcher
{
/**
* Add a specific {@link IAEStack} to watch.
*
* Supports multiple values, duplicate ones will not be added.
*
* @param stack
* @return true, if successfully added.
*/
boolean add( IAEStack<?> stack );
/**
* Remove a specific {@link IAEStack} from the watcher.
*
* @param stack
* @return true, if successfully removed.
*/
boolean remove( IAEStack<?> stack );
/**
* Removes all watched stacks and resets the watcher to a clean state.
*/
void reset();
}
@@ -24,6 +24,7 @@
package appeng.api.networking.energy;
import java.util.Collection;
import java.util.Set;
import appeng.api.config.Actionable;
@@ -37,15 +38,30 @@ public interface IEnergyGridProvider
/**
* internal use only
*/
double extractAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
Collection<IEnergyGridProvider> providers();
/**
* internal use only
*/
double injectAEPower( double amt, Actionable mode, Set<IEnergyGrid> seen );
double extractProviderPower( double amt, Actionable mode, Set<IEnergyGridProvider> seen );
/**
* internal use only
*/
double getEnergyDemand( double d, Set<IEnergyGrid> seen );
double injectProviderPower( double amt, Actionable mode, Set<IEnergyGridProvider> seen );
/**
* internal use only
*/
double getProviderEnergyDemand( double d, Set<IEnergyGridProvider> seen );
/**
* internal use only
*/
double getProviderStoredEnergy();
/**
* internal use only
*/
double getProviderMaxEnergy();
}
@@ -24,10 +24,34 @@
package appeng.api.networking.energy;
import java.util.Collection;
public interface IEnergyWatcher extends Collection<Double>
/**
* DO NOT IMPLEMENT.
*
* Will be injected when adding an {@link IEnergyWatcherHost} to a grid.
*/
public interface IEnergyWatcher
{
/**
* Add a specific threshold to watch.
*
* Supports multiple values, duplicate ones will not be added.
*
* @param amount
* @return true, if successfully added.
*/
boolean add( double amount );
/**
* Remove a specific threshold from the watcher.
*
* @param amount
* @return true, if successfully removed.
*/
boolean remove( double amount );
/**
* Removes all thresholds and resets the watcher to a clean state.
*/
void reset();
}
@@ -24,12 +24,36 @@
package appeng.api.networking.storage;
import java.util.Collection;
import appeng.api.storage.data.IAEStack;
public interface IStackWatcher extends Collection<IAEStack>
/**
* DO NOT IMPLEMENT.
*
* Will be injected when adding an {@link IStackWatcherHost} to a grid.
*/
public interface IStackWatcher
{
/**
* Add a specific {@link IAEStack} to watch.
*
* Supports multiple values, duplicate ones will not be added.
*
* @param stack
* @return true, if successfully added.
*/
boolean add( IAEStack<?> stack );
/**
* Remove a specific {@link IAEStack} from the watcher.
*
* @param stack
* @return true, if successfully removed.
*/
boolean remove( IAEStack<?> stack );
/**
* Removes all watched stacks and resets the watcher to a clean state.
*/
void reset();
}
@@ -29,5 +29,5 @@ public enum BusSupport
CABLE,
DENSE_CABLE
}
@@ -24,8 +24,6 @@
package appeng.api.parts;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
@@ -71,7 +69,6 @@ public interface IFacadePart
/**
* The item that this facade masquerades as.
*/
@Nullable
ItemStack getTextureItem();
/**
+21 -11
View File
@@ -25,10 +25,11 @@ package appeng.api.parts;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import javax.annotation.Nonnull;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
@@ -39,9 +40,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
@@ -71,7 +72,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
ItemStack getItemStack( PartItemStack type );
/**
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for {@link #requireDynamicRender()} in order for
* Render dynamic portions of this part, as part of the cable bus TESR. This part has to return true for
* {@link #requireDynamicRender()} in order for
* this method to be called.
*/
@SideOnly( Side.CLIENT )
@@ -128,7 +130,7 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
/**
* a block around the bus's host has been changed.
*/
void onNeighborChanged();
void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor );
/**
* @return output redstone on facing side
@@ -267,8 +269,10 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
boolean canBePlacedOn( BusSupport what );
/**
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models should represent the
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4 can be used in the
* This method is used when a chunk is rebuilt to determine how this part should be rendered. The returned models
* should represent the
* part oriented north. They will be automatically rotated to match the part's actual orientation. Tint indices 1-4
* can be used in the
* models to access the parts color.
*
* <dl>
@@ -279,18 +283,23 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
* <dt>Tint Index 3</dt>
* <dd>The {@link AEColor#whiteVariant bright variant color} of the cable that this part is attached to.</dd>
* <dt>Tint Index 4</dt>
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its {@link AEColor#whiteVariant bright variant}.</dd>
* <dd>A color variant that is between the cable's {@link AEColor#mediumVariant color} and its
* {@link AEColor#whiteVariant bright variant}.</dd>
* </dl>
*
* <b>Important:</b> All models must have been registered via the {@link IPartModels} API before use.
*/
default List<ResourceLocation> getStaticModels()
@Nonnull
default IPartModel getStaticModels()
{
return Collections.emptyList();
return new IPartModel()
{
};
}
/**
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
* forwarded to parts on the appropriate
* side.
*
* @see TileEntity#hasCapability(Capability, EnumFacing)
@@ -303,7 +312,8 @@ public interface IPart extends IBoxProvider, ICustomCableConnection
}
/**
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be forwarded to parts on the appropriate
* Implement this method if your part exposes capabilitys. Any requests for capabilities on the cable bus will be
* forwarded to parts on the appropriate
* side.
*
* @see TileEntity#getCapability(Capability, EnumFacing)
@@ -0,0 +1,65 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2013 - 2015 AlgorithmX2
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package appeng.api.parts;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nonnull;
import net.minecraft.util.ResourceLocation;
/**
* A container to store a collection of {@link ResourceLocation} as models for a part as well as other properties.
*/
public interface IPartModel
{
/**
* A solid {@link IPartModel} indicates that the rendering requires a cable connection, which will also result in
* creating an intersection for the cable.
*
* This should be true for pretty much all parts.
*
* @return true for a solid part.
*/
default boolean requireCableConnection()
{
return true;
}
/**
* A collection of {@link ResourceLocation} used as models for a part.
*
* @return a collection of models, never null.
*/
@Nonnull
default List<ResourceLocation> getModels()
{
return Collections.emptyList();
}
}
@@ -24,8 +24,8 @@
package appeng.api.storage;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.data.IAEItemStack;
@@ -52,12 +52,12 @@ public interface ICellInventory extends IMEInventory<IAEItemStack>
/**
* @return access configured list
*/
IInventory getConfigInventory();
IItemHandler getConfigInventory();
/**
* @return access installed upgrades.
*/
IInventory getUpgradesInventory();
IItemHandler getUpgradesInventory();
/**
* @return How many bytes are used for each type?
@@ -24,8 +24,8 @@
package appeng.api.storage;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.FuzzyMode;
@@ -48,7 +48,7 @@ public interface ICellWorkbenchItem
*
* onInventoryChange will be called when saving is needed.
*/
IInventory getUpgradesInventory( ItemStack is );
IItemHandler getUpgradesInventory( ItemStack is );
/**
* Used to extract, or mirror the contents of the work bench onto the cell.
@@ -57,7 +57,7 @@ public interface ICellWorkbenchItem
*
* onInventoryChange will be called when saving is needed.
*/
IInventory getConfigInventory( ItemStack is );
IItemHandler getConfigInventory( ItemStack is );
/**
* @return the current fuzzy status.
@@ -0,0 +1,41 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2017, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.api.storage;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
public interface ISpatialDimension
{
World getWorld();
int createNewCellDimension( BlockPos contentSize, int playerId );
void deleteCellDimension( int cellDimId );
boolean isCellDimension( int cellDimID );
int getCellDimensionOwner( int cellDimId );
BlockPos getCellDimensionOrigin( int cellDimId );
BlockPos getCellContentSize( int cellDimId );
}
@@ -52,7 +52,7 @@ public class MEMonitorHandler<StackType extends IAEStack> implements IMEMonitor<
private final IMEInventoryHandler<StackType> internalHandler;
private final IItemList<StackType> cachedList;
private final HashMap<IMEMonitorHandlerReceiver<StackType>, Object> listeners = new HashMap<IMEMonitorHandlerReceiver<StackType>, Object>();
private final HashMap<IMEMonitorHandlerReceiver<StackType>, Object> listeners = new HashMap<>();
protected boolean hasChanged = true;
@@ -203,4 +203,15 @@ public interface IAEStack<StackType extends IAEStack>
* @return ITEM or FLUID
*/
StorageChannel getChannel();
/**
* @return true if it should show the crafting label.
*/
boolean getShowCraftingLabel();
/**
* Used internally to show that it should show a Crafting label instead of a "1"
*/
void setShowCraftingLabel( boolean showCraftingLabel );
}
@@ -47,15 +47,21 @@ public enum AECableType
SMART,
/**
* Dense Cable, represents a tier 2 block that can carry 32 channels.
* Smart Dense Cable, represents a tier 2 block that can carry 32 channels.
*/
DENSE;
DENSE_COVERED,
/**
* Smart Dense Cable, represents a tier 2 block that can carry 32 channels.
*/
DENSE_SMART;
public static final AECableType[] VALIDCABLES = {
GLASS,
COVERED,
SMART,
DENSE
DENSE_COVERED,
DENSE_SMART
};
}
+5 -5
View File
@@ -146,14 +146,14 @@ public enum AEColor
case 0:
return -1;
case TINTINDEX_DARK:
return blackVariant;
return this.blackVariant;
case TINTINDEX_MEDIUM:
return mediumVariant;
return this.mediumVariant;
case TINTINDEX_BRIGHT:
return whiteVariant;
return this.whiteVariant;
case TINTINDEX_MEDIUM_BRIGHT:
final int light = whiteVariant;
final int dark = mediumVariant;
final int light = this.whiteVariant;
final int dark = this.mediumVariant;
return ( ( ( ( ( light >> 16 ) & 0xff ) + ( ( dark >> 16 ) & 0xff ) ) / 2 ) << 16 ) | ( ( ( ( ( light >> 8 ) & 0xff ) + ( ( dark >> 8 ) & 0xff ) ) / 2 ) << 8 ) | ( ( ( ( light ) & 0xff ) + ( ( dark ) & 0xff ) ) / 2 );
default:
return -1;
+109 -116
View File
@@ -31,10 +31,9 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -65,12 +64,6 @@ public abstract class AEBaseBlock extends Block
protected AxisAlignedBB boundingBox = FULL_BLOCK_AABB;
@Override
public boolean isVisuallyOpaque()
{
return this.isOpaque() && this.isFullSize();
}
protected AEBaseBlock( final Material mat )
{
super( mat );
@@ -96,13 +89,9 @@ public abstract class AEBaseBlock extends Block
this.setLightLevel( 0 );
this.setHardness( 2.2F );
this.setHarvestLevel( "pickaxe", 0 );
}
@Override
public String toString()
{
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
return getClass().getSimpleName() + "[" + regName + "]";
// Workaround as vanilla sets it way too early.
this.fullBlock = this.isFullSize();
}
@Override
@@ -111,50 +100,34 @@ public abstract class AEBaseBlock extends Block
return new BlockStateContainer( this, this.getAEStates() );
}
protected IProperty[] getAEStates()
{
return new IProperty[0];
}
public boolean isOpaque()
{
return this.isOpaque;
}
@SuppressWarnings( "deprecation" )
@Override
public boolean isNormalCube( IBlockState state )
public final boolean isNormalCube( IBlockState state )
{
return this.isFullSize() && this.isOpaque();
}
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
{
if( this instanceof ICustomCollision )
{
return (ICustomCollision) this;
}
return null;
}
@SuppressWarnings( "deprecation" )
@Override
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
{
return boundingBox;
return this.boundingBox;
}
@SuppressWarnings( "deprecation" )
@Override
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_ )
{
final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
if( collisionHandler != null && bb != null )
{
final List<AxisAlignedBB> tmp = new ArrayList<AxisAlignedBB>();
final List<AxisAlignedBB> tmp = new ArrayList<>();
collisionHandler.addCollidingBlockToList( w, pos, bb, tmp, e );
for( final AxisAlignedBB b : tmp )
{
final AxisAlignedBB offset = b.offset( pos.getX(), pos.getY(), pos.getZ() );
if( bb.intersectsWith( offset ) )
if( bb.intersects( offset ) )
{
out.add( offset );
}
@@ -162,10 +135,11 @@ public abstract class AEBaseBlock extends Block
}
else
{
super.addCollisionBoxToList( state, w, pos, bb, out, e );
super.addCollisionBoxToList( state, w, pos, bb, out, e, p_185477_7_ );
}
}
@SuppressWarnings( "deprecation" )
@Override
@SideOnly( Side.CLIENT )
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
@@ -176,10 +150,10 @@ public abstract class AEBaseBlock extends Block
{
if( Platform.isClient() )
{
final EntityPlayer player = Minecraft.getMinecraft().thePlayer;
final EntityPlayer player = Minecraft.getMinecraft().player;
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getMinecraft().thePlayer, true );
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getMinecraft().player, true );
AxisAlignedBB br = null;
double lastDist = 0;
@@ -194,9 +168,9 @@ public abstract class AEBaseBlock extends Block
if( r != null )
{
final double xLen = ( ld.getA().xCoord - r.hitVec.xCoord );
final double yLen = ( ld.getA().yCoord - r.hitVec.yCoord );
final double zLen = ( ld.getA().zCoord - r.hitVec.zCoord );
final double xLen = ( ld.getA().x - r.hitVec.x );
final double yLen = ( ld.getA().y - r.hitVec.y );
final double zLen = ( ld.getA().z - r.hitVec.z );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
@@ -210,7 +184,8 @@ public abstract class AEBaseBlock extends Block
if( br != null )
{
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos.getY(), br.maxZ + pos.getZ() );
br = new AxisAlignedBB( br.minX + pos.getX(), br.minY + pos.getY(), br.minZ + pos.getZ(), br.maxX + pos.getX(), br.maxY + pos
.getY(), br.maxZ + pos.getZ() );
return br;
}
}
@@ -241,7 +216,8 @@ public abstract class AEBaseBlock extends Block
}
else
{
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos.getZ() );
b = new AxisAlignedBB( b.minX + pos.getX(), b.minY + pos.getY(), b.minZ + pos.getZ(), b.maxX + pos.getX(), b.maxY + pos.getY(), b.maxZ + pos
.getZ() );
}
return b;
@@ -250,12 +226,14 @@ public abstract class AEBaseBlock extends Block
return super.getSelectedBoundingBox( state, w, pos );
}
@SuppressWarnings( "deprecation" )
@Override
public final boolean isOpaqueCube( IBlockState state )
{
return this.isOpaque();
}
@SuppressWarnings( "deprecation" )
@Override
public RayTraceResult collisionRayTrace( final IBlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
{
@@ -278,9 +256,9 @@ public abstract class AEBaseBlock extends Block
if( r != null )
{
final double xLen = ( a.xCoord - r.hitVec.xCoord );
final double yLen = ( a.yCoord - r.hitVec.yCoord );
final double zLen = ( a.zCoord - r.hitVec.zCoord );
final double xLen = ( a.x - r.hitVec.x );
final double yLen = ( a.y - r.hitVec.y );
final double zLen = ( a.z - r.hitVec.z );
final double thisDist = xLen * xLen + yLen * yLen + zLen * zLen;
if( br == null || lastDist > thisDist )
@@ -303,25 +281,14 @@ public abstract class AEBaseBlock extends Block
return super.collisionRayTrace( state, w, pos, a, b );
}
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
return false;
}
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void getSubBlocks( final Item item, final CreativeTabs tabs, final List itemStacks )
{
this.getCheckedSubBlocks( item, tabs, itemStacks );
}
@SuppressWarnings( "deprecation" )
@Override
public boolean hasComparatorInputOverride( IBlockState state )
{
return this.isInventory();
}
@SuppressWarnings( "deprecation" )
@Override
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
{
@@ -329,21 +296,11 @@ public abstract class AEBaseBlock extends Block
}
@Override
public boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
public final boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
{
return this.isFullSize();
}
public IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
{
if( this instanceof IOrientableBlock )
{
IOrientableBlock orientable = (IOrientableBlock) this;
return orientable.getOrientable( w, pos );
}
return null;
}
@Override
public boolean rotateBlock( final World w, final BlockPos pos, final EnumFacing axis )
{
@@ -378,21 +335,6 @@ public abstract class AEBaseBlock extends Block
return super.rotateBlock( w, pos, axis );
}
protected boolean hasCustomRotation()
{
return false;
}
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
{
}
public boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
{
return true;
}
@Override
public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
{
@@ -400,28 +342,18 @@ public abstract class AEBaseBlock extends Block
}
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
{
super.getSubBlocks( item, tabs, itemStacks );
}
public String getUnlocalizedName( final ItemStack is )
{
return this.getUnlocalizedName();
}
@Override
public void addInformation( final ItemStack is, final EntityPlayer player, final List<String> lines, final boolean advancedItemTooltips )
public void addInformation( final ItemStack is, final World world, final List<String> lines, final ITooltipFlag advancedItemTooltips )
{
}
public boolean hasSubtypes()
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
return this.hasSubtypes;
return false;
}
public EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
public final EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
{
// case DOWN: return bottomIcon;
// case UP: return blockIcon;
@@ -486,36 +418,97 @@ public abstract class AEBaseBlock extends Block
return null;
}
public boolean isFullSize()
@Override
public String toString()
{
return this.isFullSize;
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
return this.getClass().getSimpleName() + "[" + regName + "]";
}
public boolean setFullSize( final boolean isFullSize )
protected String getUnlocalizedName( final ItemStack is )
{
this.isFullSize = isFullSize;
return isFullSize;
return this.getUnlocalizedName();
}
public boolean setOpaque( final boolean isOpaque )
protected boolean hasCustomRotation()
{
return false;
}
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
{
}
protected IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
{
if( this instanceof IOrientableBlock )
{
IOrientableBlock orientable = (IOrientableBlock) this;
return orientable.getOrientable( w, pos );
}
return null;
}
protected boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
{
return true;
}
protected ICustomCollision getCustomCollision( final World w, final BlockPos pos )
{
if( this instanceof ICustomCollision )
{
return (ICustomCollision) this;
}
return null;
}
protected IProperty[] getAEStates()
{
return new IProperty[0];
}
protected boolean isOpaque()
{
return this.isOpaque;
}
protected boolean setOpaque( final boolean isOpaque )
{
this.isOpaque = isOpaque;
return isOpaque;
}
public boolean isInventory()
protected boolean hasSubtypes()
{
return this.isInventory;
return this.hasSubtypes;
}
public void setInventory( final boolean isInventory )
{
this.isInventory = isInventory;
}
public void setHasSubtypes( final boolean hasSubtypes )
protected void setHasSubtypes( final boolean hasSubtypes )
{
this.hasSubtypes = hasSubtypes;
}
protected boolean isFullSize()
{
return this.isFullSize;
}
protected boolean setFullSize( final boolean isFullSize )
{
this.isFullSize = isFullSize;
return isFullSize;
}
protected boolean isInventory()
{
return this.isInventory;
}
protected void setInventory( final boolean isInventory )
{
this.isInventory = isInventory;
}
}
@@ -23,6 +23,7 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@@ -67,15 +68,15 @@ public class AEBaseItemBlock extends ItemBlock
@Override
@SideOnly( Side.CLIENT )
@SuppressWarnings( "unchecked" )
public final void addInformation( final ItemStack itemStack, final EntityPlayer player, final List toolTip, final boolean advancedTooltips )
public final void addInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
{
this.addCheckedInformation( itemStack, player, toolTip, advancedTooltips );
this.addCheckedInformation( itemStack, world, toolTip, advancedTooltips );
}
@SideOnly( Side.CLIENT )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedToolTips )
public void addCheckedInformation( final ItemStack itemStack, final World world, final List<String> toolTip, final ITooltipFlag advancedTooltips )
{
this.blockType.addInformation( itemStack, player, toolTip, advancedToolTips );
this.blockType.addInformation( itemStack, world, toolTip, advancedTooltips );
}
@Override
@@ -126,7 +127,7 @@ public class AEBaseItemBlock extends ItemBlock
{
up = EnumFacing.UP;
final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
final byte rotation = (byte) ( MathHelper.floor( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
switch( rotation )
{
@@ -23,13 +23,15 @@ import java.text.MessageFormat;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.api.config.AccessRestriction;
import appeng.api.config.Actionable;
import appeng.api.config.PowerUnits;
import appeng.api.definitions.IBlockDefinition;
import appeng.api.implementations.items.IAEItemPowerStorage;
@@ -48,9 +50,9 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
@Override
@SideOnly( Side.CLIENT )
public void addCheckedInformation( final ItemStack itemStack, final EntityPlayer player, final List<String> toolTip, final boolean advancedTooltips )
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
{
final NBTTagCompound tag = itemStack.getTagCompound();
final NBTTagCompound tag = stack.getTagCompound();
double internalCurrentPower = 0;
final double internalMaxPower = this.getMaxEnergyCapacity();
@@ -61,70 +63,43 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
final double percent = internalCurrentPower / internalMaxPower;
toolTip.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
}
private double getMaxEnergyCapacity()
{
final Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
return energyCell.maybeBlock().map( block -> {
if( blockID == block )
{
return 200000;
}
else
{
return 8 * 200000;
}
}
).orElse( 0 );
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform
.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
}
@Override
public double injectAEPower( final ItemStack is, double amt )
public double injectAEPower( final ItemStack is, double amount, Actionable mode )
{
double internalCurrentPower = this.getInternal( is );
final double internalMaxPower = this.getMaxEnergyCapacity();
internalCurrentPower += amt;
if( internalCurrentPower > internalMaxPower )
final double internalCurrentPower = this.getInternal( is );
final double internalMaxPower = this.getAEMaxPower( is );
final double required = internalMaxPower - internalCurrentPower;
final double overflow = Math.max( 0, amount - required );
if( mode == Actionable.MODULATE )
{
amt = internalCurrentPower - internalMaxPower;
internalCurrentPower = internalMaxPower;
this.setInternal( is, internalCurrentPower );
return amt;
final double toAdd = Math.min( required, amount );
final double newPowerStored = internalCurrentPower + toAdd;
this.setInternal( is, newPowerStored );
}
this.setInternal( is, internalCurrentPower );
return 0;
}
private double getInternal( final ItemStack is )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
return nbt.getDouble( "internalCurrentPower" );
}
private void setInternal( final ItemStack is, final double amt )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
nbt.setDouble( "internalCurrentPower", amt );
return overflow;
}
@Override
public double extractAEPower( final ItemStack is, double amt )
public double extractAEPower( final ItemStack is, double amount, Actionable mode )
{
double internalCurrentPower = this.getInternal( is );
if( internalCurrentPower > amt )
final double internalCurrentPower = this.getInternal( is );
final double fulfillable = Math.min( amount, internalCurrentPower );
if( mode == Actionable.MODULATE )
{
internalCurrentPower -= amt;
this.setInternal( is, internalCurrentPower );
return amt;
final double newPowerStored = internalCurrentPower - fulfillable;
this.setInternal( is, newPowerStored );
}
amt = internalCurrentPower;
this.setInternal( is, 0 );
return amt;
return fulfillable;
}
@Override
@@ -144,4 +119,34 @@ public class AEBaseItemBlockChargeable extends AEBaseItemBlock implements IAEIte
{
return AccessRestriction.WRITE;
}
private double getMaxEnergyCapacity()
{
final Block blockID = Block.getBlockFromItem( this );
final IBlockDefinition energyCell = Api.INSTANCE.definitions().blocks().energyCell();
return energyCell.maybeBlock().map( block ->
{
if( blockID == block )
{
return 200000;
}
else
{
return 8 * 200000;
}
} ).orElse( 0 );
}
private double getInternal( final ItemStack is )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
return nbt.getDouble( "internalCurrentPower" );
}
private void setInternal( final ItemStack is, final double amt )
{
final NBTTagCompound nbt = Platform.openNbtData( is );
nbt.setDouble( "internalCurrentPower", amt );
}
}
@@ -43,8 +43,8 @@ public abstract class AEBaseStairBlock extends BlockStairs
@Override
public String toString()
{
String regName = getRegistryName() != null ? getRegistryName().getResourcePath() : "unregistered";
return getClass().getSimpleName() + "[" + regName + "]";
String regName = this.getRegistryName() != null ? this.getRegistryName().getResourcePath() : "unregistered";
return this.getClass().getSimpleName() + "[" + regName + "]";
}
}
+28 -20
View File
@@ -34,8 +34,6 @@ import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -48,6 +46,7 @@ import net.minecraft.world.World;
import net.minecraftforge.common.property.ExtendedBlockState;
import net.minecraftforge.common.property.IExtendedBlockState;
import net.minecraftforge.common.property.IUnlistedProperty;
import net.minecraftforge.items.ItemHandlerHelper;
import appeng.api.implementations.items.IMemoryCard;
import appeng.api.implementations.items.MemoryCardMessages;
@@ -56,6 +55,7 @@ import appeng.api.util.AEColor;
import appeng.api.util.IOrientable;
import appeng.block.networking.BlockCableBus;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseInvTile;
import appeng.tile.AEBaseTile;
import appeng.tile.networking.TileCableBus;
import appeng.tile.storage.TileSkyChest;
@@ -86,7 +86,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return state;
}
AEBaseTile tile = getTileEntity( world, pos );
AEBaseTile tile = this.getTileEntity( world, pos );
if( tile == null )
{
return state; // No info available
@@ -99,7 +99,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
FORWARD,
UP
} );
@@ -111,16 +111,17 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return 0;
}
protected void setTileEntity( final Class<? extends AEBaseTile> c )
// TODO : Was this change needed?
public void setTileEntity( final Class<? extends AEBaseTile> c )
{
this.tileEntityType = c;
this.setInventory( IInventory.class.isAssignableFrom( c ) );
this.setInventory( AEBaseInvTile.class.isAssignableFrom( c ) );
}
@Override
public boolean hasTileEntity( IBlockState state )
{
return hasBlockTileEntity();
return this.hasBlockTileEntity();
}
private boolean hasBlockTileEntity()
@@ -184,7 +185,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
final AEBaseTile te = this.getTileEntity( w, pos );
if( te != null )
{
final ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
final ArrayList<ItemStack> drops = new ArrayList<>();
if( te.dropItems() )
{
te.getDrops( w, pos, drops );
@@ -240,9 +241,13 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
public int getComparatorInputOverride( IBlockState state, final World w, final BlockPos pos )
{
final TileEntity te = this.getTileEntity( w, pos );
if( te instanceof IInventory )
if( te instanceof AEBaseInvTile )
{
return Container.calcRedstoneFromInventory( (IInventory) te );
AEBaseInvTile invTile = (AEBaseInvTile) te;
if( invTile.getInternalInventory().getSlots() > 0 )
{
return ItemHandlerHelper.calcRedstoneFromInventory( invTile.getInternalInventory() );
}
}
return 0;
}
@@ -269,13 +274,16 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public boolean onBlockActivated( World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ )
{
if( player != null && heldItem != null )
ItemStack heldItem;
if( player != null && !player.getHeldItem( hand ).isEmpty() )
{
heldItem = player.getHeldItem( hand );
if( Platform.isWrench( player, heldItem, pos ) && player.isSneaking() )
{
final IBlockState blockState = w.getBlockState( pos );
final IBlockState blockState = world.getBlockState( pos );
final Block block = blockState.getBlock();
if( block == null )
@@ -283,7 +291,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return false;
}
final AEBaseTile tile = this.getTileEntity( w, pos );
final AEBaseTile tile = this.getTileEntity( world, pos );
if( tile == null )
{
@@ -295,7 +303,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
return false;
}
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( w, pos );
final ItemStack[] itemDropCandidates = Platform.getBlockDrops( world, pos );
final ItemStack op = new ItemStack( this );
for( final ItemStack ol : itemDropCandidates )
@@ -310,11 +318,11 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
}
}
if( block.removedByPlayer( blockState, w, pos, player, false ) )
if( block.removedByPlayer( blockState, world, pos, player, false ) )
{
final List<ItemStack> itemsToDrop = Lists.newArrayList( itemDropCandidates );
Platform.spawnDrops( w, pos, itemsToDrop );
w.setBlockToAir( pos );
Platform.spawnDrops( world, pos, itemsToDrop );
world.setBlockToAir( pos );
}
return false;
@@ -323,7 +331,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
if( heldItem.getItem() instanceof IMemoryCard && !( this instanceof BlockCableBus ) )
{
final IMemoryCard memoryCard = (IMemoryCard) heldItem.getItem();
final AEBaseTile tileEntity = this.getTileEntity( w, pos );
final AEBaseTile tileEntity = this.getTileEntity( world, pos );
if( tileEntity == null )
{
@@ -361,7 +369,7 @@ public abstract class AEBaseTileBlock extends AEBaseBlock implements ITileEntity
}
}
return this.onActivated( w, pos, player, hand, heldItem, side, hitX, hitY, hitZ );
return this.onActivated( world, pos, player, hand, player.getHeldItem( hand ), facing, hitX, hitY, hitZ );
}
@Override
@@ -36,7 +36,7 @@ public class UnlistedDirection implements IUnlistedProperty<EnumFacing>
@Override
public String getName()
{
return name;
return this.name;
}
@Override
@@ -19,14 +19,12 @@
package appeng.block.crafting;
import java.util.List;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.property.ExtendedBlockState;
@@ -48,13 +46,12 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
public BlockCraftingMonitor()
{
super( CraftingUnitType.MONITOR );
this.setTileEntity( TileCraftingMonitorTile.class );
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
STATE,
COLOR,
FORWARD,
@@ -69,7 +66,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
EnumFacing forward = EnumFacing.NORTH;
EnumFacing up = EnumFacing.UP;
TileCraftingMonitorTile te = getTileEntity( world, pos );
TileCraftingMonitorTile te = this.getTileEntity( world, pos );
if( te != null )
{
color = te.getColor();
@@ -85,7 +82,7 @@ public class BlockCraftingMonitor extends BlockCraftingUnit
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
{
itemStacks.add( new ItemStack( this, 1, 0 ) );
}
@@ -19,16 +19,12 @@
package appeng.block.crafting;
import appeng.tile.crafting.TileCraftingStorageTile;
public class BlockCraftingStorage extends BlockCraftingUnit
{
public BlockCraftingStorage( final CraftingUnitType type )
{
super( type );
this.setTileEntity( TileCraftingStorageTile.class );
}
}
@@ -21,8 +21,6 @@ package appeng.block.crafting;
import java.util.EnumSet;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
@@ -30,7 +28,6 @@ import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -63,7 +60,6 @@ public class BlockCraftingUnit extends AEBaseTileBlock
super( Material.IRON );
this.type = type;
this.setTileEntity( TileCraftingTile.class );
}
@Override
@@ -80,7 +76,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
for( EnumFacing facing : EnumFacing.values() )
{
if( isConnected( world, pos, facing ) )
if( this.isConnected( world, pos, facing ) )
{
connections.add( facing );
}
@@ -100,7 +96,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
}
@Override
@@ -118,7 +114,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public void neighborChanged( final IBlockState state, final World worldIn, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( final IBlockState state, final World worldIn, final BlockPos pos, final Block blockIn, final BlockPos fromPos )
{
final TileCraftingTile cp = this.getTileEntity( worldIn, pos );
if( cp != null )
@@ -146,9 +142,10 @@ public class BlockCraftingUnit extends AEBaseTileBlock
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
final TileCraftingTile tg = this.getTileEntity( w, pos );
if( tg != null && !p.isSneaking() && tg.isFormed() && tg.isActive() )
{
if( Platform.isClient() )
@@ -160,7 +157,7 @@ public class BlockCraftingUnit extends AEBaseTileBlock
return true;
}
return false;
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
}
public enum CraftingUnitType
@@ -19,14 +19,11 @@
package appeng.block.crafting;
import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -42,6 +39,7 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.crafting.TileMolecularAssembler;
import appeng.util.Platform;
public class BlockMolecularAssembler extends AEBaseTileBlock
{
@@ -51,7 +49,6 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileMolecularAssembler.class );
this.setOpaque( false );
this.lightOpacity = 1;
}
@@ -66,7 +63,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
{
boolean powered = false;
TileMolecularAssembler te = getTileEntity( worldIn, pos );
TileMolecularAssembler te = this.getTileEntity( worldIn, pos );
if( te != null )
{
powered = te.isPowered();
@@ -88,18 +85,19 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
@SideOnly( Side.CLIENT )
@Override
public boolean canRenderInLayer( BlockRenderLayer layer )
public boolean canRenderInLayer( IBlockState state, BlockRenderLayer layer )
{
return layer == BlockRenderLayer.TRANSLUCENT;
}
public boolean isFullCube(IBlockState state)
@Override
public boolean isFullCube( IBlockState state )
{
return false;
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer p, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
final TileMolecularAssembler tg = this.getTileEntity( w, pos );
if( tg != null && !p.isSneaking() )
@@ -107,6 +105,7 @@ public class BlockMolecularAssembler extends AEBaseTileBlock
Platform.openGUI( p, tg, AEPartLocation.fromFacing( side ), GuiBridge.GUI_MAC );
return true;
}
return false;
return super.onBlockActivated( w, pos, state, p, hand, side, hitX, hitY, hitZ );
}
}
@@ -39,12 +39,12 @@ public class ItemCraftingStorage extends AEBaseItemBlock
@Override
public ItemStack getContainerItem( final ItemStack itemStack )
{
return AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).orElse( null );
return AEApi.instance().definitions().blocks().craftingUnit().maybeStack( 1 ).orElse( ItemStack.EMPTY );
}
@Override
public boolean hasContainerItem( final ItemStack stack )
{
return AEConfig.instance.isFeatureEnabled( AEFeature.EnableDisassemblyCrafting );
return AEConfig.instance().isFeatureEnabled( AEFeature.ENABLE_DISASSEMBLY_CRAFTING );
}
}
@@ -41,6 +41,7 @@ import appeng.core.stats.Stats;
import appeng.tile.AEBaseTile;
import appeng.tile.grindstone.TileCrank;
public class BlockCrank extends AEBaseTileBlock
{
@@ -48,7 +49,6 @@ public class BlockCrank extends AEBaseTileBlock
{
super( Material.WOOD );
this.setTileEntity( TileCrank.class );
this.setLightOpacity( 0 );
this.setHarvestLevel( "axe", 0 );
this.setFullSize( this.setOpaque( false ) );
@@ -78,7 +78,7 @@ public class BlockCrank extends AEBaseTileBlock
private void dropCrank( final World world, final BlockPos pos )
{
world.destroyBlock( pos, true ); // w.destroyBlock( x, y, z, true );
world.notifyBlockUpdate( pos, getDefaultState(), world.getBlockState( pos ), 3 );
world.notifyBlockUpdate( pos, this.getDefaultState(), world.getBlockState( pos ), 3 );
}
@Override
@@ -135,7 +135,7 @@ public class BlockCrank extends AEBaseTileBlock
}
@Override
public void neighborChanged( final IBlockState state, final World world, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final AEBaseTile tile = this.getTileEntity( world, pos );
@@ -35,6 +35,7 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.grindstone.TileGrinder;
import appeng.util.Platform;
public class BlockGrinder extends AEBaseTileBlock
{
@@ -42,7 +43,6 @@ public class BlockGrinder extends AEBaseTileBlock
{
super( Material.ROCK );
this.setTileEntity( TileGrinder.class );
this.setHardness( 3.2F );
}
@@ -35,14 +35,13 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileCellWorkbench;
import appeng.util.Platform;
public class BlockCellWorkbench extends AEBaseTileBlock
{
public BlockCellWorkbench()
{
super( Material.IRON );
this.setTileEntity( TileCellWorkbench.class );
}
@Override
@@ -22,6 +22,7 @@ package appeng.block.misc;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
import org.apache.commons.lang3.tuple.ImmutablePair;
@@ -51,7 +52,7 @@ import appeng.client.render.effects.LightningFX;
import appeng.client.render.renderable.ItemRenderable;
import appeng.client.render.tesr.ModularTESR;
import appeng.core.AEConfig;
import appeng.core.CommonHelper;
import appeng.core.AppEng;
import appeng.helpers.ICustomCollision;
import appeng.tile.AEBaseTile;
import appeng.tile.misc.TileCharger;
@@ -65,7 +66,6 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
super( Material.IRON );
this.setTileEntity( TileCharger.class );
this.setLightOpacity( 2 );
this.setFullSize( this.setOpaque( false ) );
}
@@ -94,7 +94,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
@@ -109,7 +109,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
final TileCharger tc = (TileCharger) tile;
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getStackInSlot( 0 ) ) )
if( AEApi.instance().definitions().materials().certusQuartzCrystalCharged().isSameAs( tc.getInternalInventory().getStackInSlot( 0 ) ) )
{
final double xOff = 0.0;
final double yOff = 0.0;
@@ -117,9 +117,10 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
if( AppEng.proxy.shouldAddParticles( r ) )
{
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos
.getZ(), 0.0D, 0.0D, 0.0D );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -200,7 +201,7 @@ public class BlockCharger extends AEBaseTileBlock implements ICustomCollision
{
Matrix4f transform = new Matrix4f();
transform.translate( new Vector3f( 0.5f, 0.4f, 0.5f ) );
return new ImmutablePair<>( tile.getStackInSlot( 0 ), transform );
return new ImmutablePair<>( tile.getInternalInventory().getStackInSlot( 0 ), transform );
}
}
@@ -42,8 +42,6 @@ public class BlockCondenser extends AEBaseTileBlock
public BlockCondenser()
{
super( Material.IRON );
this.setTileEntity( TileCondenser.class );
}
@Override
@@ -37,6 +37,7 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileInscriber;
import appeng.util.Platform;
public class BlockInscriber extends AEBaseTileBlock
{
@@ -44,7 +45,6 @@ public class BlockInscriber extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileInscriber.class );
this.setLightOpacity( 2 );
this.setFullSize( this.setOpaque( false ) );
}
@@ -49,8 +49,6 @@ public class BlockInterface extends AEBaseTileBlock
public BlockInterface()
{
super( Material.IRON );
this.setTileEntity( TileInterface.class );
}
@Override
@@ -63,7 +61,7 @@ public class BlockInterface extends AEBaseTileBlock
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
// Determine whether the interface is omni-directional or not
TileInterface te = getTileEntity( world, pos );
TileInterface te = this.getTileEntity( world, pos );
boolean omniDirectional = true; // The default
if( te != null )
{
@@ -46,6 +46,7 @@ import appeng.helpers.ICustomCollision;
import appeng.helpers.MetaRotation;
import appeng.tile.misc.TileLightDetector;
public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBlock, ICustomCollision
{
@@ -63,8 +64,6 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
this.setTileEntity( TileLightDetector.class );
}
@Override
@@ -77,7 +76,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
public IBlockState getStateFromMeta( final int meta )
{
EnumFacing facing = EnumFacing.values()[meta];
return getDefaultState().withProperty(FACING, facing);
return this.getDefaultState().withProperty( FACING, facing );
}
@Override
@@ -139,21 +138,21 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{/*
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 *
* getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; out.add(
* AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff +
* (double) y + 0.15, zOff + (double) z + 0.15,// ahh xOff + (double) x
* + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
*/
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 *
* getUp().offsetY; double zOff = -0.15 * getUp().offsetZ; out.add(
* AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff +
* (double) y + 0.15, zOff + (double) z + 0.15,// ahh xOff + (double) x
* + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
*/
}
@Override
public void neighborChanged( IBlockState state, World w, BlockPos pos, Block blockIn )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final EnumFacing up = this.getOrientable( w, pos ).getUp();
if( !this.canPlaceAt( (World) w, pos, up.getOpposite() ) )
final EnumFacing up = this.getOrientable( world, pos ).getUp();
if( !this.canPlaceAt( (World) world, pos, up.getOpposite() ) )
{
this.dropTorch( (World) w, pos );
this.dropTorch( (World) world, pos );
}
}
@@ -190,7 +189,7 @@ public class BlockLightDetector extends AEBaseTileBlock implements IOrientableBl
}
@Override
@SideOnly( Side.CLIENT)
@SideOnly( Side.CLIENT )
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
@@ -45,10 +45,11 @@ import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseBlock;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
import appeng.core.CommonHelper;
import appeng.core.AppEng;
import appeng.helpers.ICustomCollision;
import appeng.helpers.MetaRotation;
public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock, ICustomCollision
{
@@ -75,7 +76,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
{
boolean oddPlacement = ((pos.getX() + pos.getY() + pos.getZ()) % 2) != 0;
boolean oddPlacement = ( ( pos.getX() + pos.getY() + pos.getZ() ) % 2 ) != 0;
return super.getActualState( state, worldIn, pos )
.withProperty( ODD, oddPlacement );
@@ -91,7 +92,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
public IBlockState getStateFromMeta( final int meta )
{
EnumFacing facing = EnumFacing.values()[meta];
return getDefaultState().withProperty(FACING, facing);
return this.getDefaultState().withProperty( FACING, facing );
}
@Override
@@ -125,17 +126,18 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List out, final Entity e )
{/*
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15, zOff
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
*/
* double xOff = -0.15 * getUp().offsetX; double yOff = -0.15 * getUp().offsetY; double zOff = -0.15 *
* getUp().offsetZ; out.add( AxisAlignedBB.getBoundingBox( xOff + (double) x + 0.15, yOff + (double) y + 0.15,
* zOff
* + (double) z + 0.15,// ahh xOff + (double) x + 0.85, yOff + (double) y + 0.85, zOff + (double) z + 0.85 ) );
*/
}
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
@@ -151,7 +153,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
final double zOff = -0.3 * up.getFrontOffsetZ();
for( int bolts = 0; bolts < 3; bolts++ )
{
if( CommonHelper.proxy.shouldAddParticles( r ) )
if( AppEng.proxy.shouldAddParticles( r ) )
{
final LightningFX fx = new LightningFX( w, xOff + 0.5 + pos.getX(), yOff + 0.5 + pos.getY(), zOff + 0.5 + pos.getZ(), 0.0D, 0.0D, 0.0D );
@@ -161,12 +163,12 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos,final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final EnumFacing up = this.getOrientable( w, pos ).getUp();
if( !this.canPlaceAt( w, pos, up.getOpposite() ) )
final EnumFacing up = this.getOrientable( world, pos ).getUp();
if( !this.canPlaceAt( world, pos, up.getOpposite() ) )
{
this.dropTorch( w, pos );
this.dropTorch( world, pos );
}
}
@@ -215,7 +217,7 @@ public class BlockQuartzFixture extends AEBaseBlock implements IOrientableBlock,
}
@Override
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
public BlockRenderLayer getBlockLayer()
{
return BlockRenderLayer.CUTOUT;
@@ -38,7 +38,7 @@ import appeng.api.util.IOrientableBlock;
import appeng.block.AEBaseTileBlock;
import appeng.client.render.effects.LightningFX;
import appeng.core.AEConfig;
import appeng.core.CommonHelper;
import appeng.core.AppEng;
import appeng.tile.misc.TileQuartzGrowthAccelerator;
import appeng.util.Platform;
@@ -52,14 +52,13 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
{
super( Material.ROCK );
this.setSoundType( SoundType.METAL );
this.setTileEntity( TileQuartzGrowthAccelerator.class );
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
}
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
TileQuartzGrowthAccelerator te = getTileEntity( world, pos );
TileQuartzGrowthAccelerator te = this.getTileEntity( world, pos );
boolean powered = te != null && te.isPowered();
return super.getActualState( state, world, pos )
@@ -76,14 +75,14 @@ public class BlockQuartzGrowthAccelerator extends AEBaseTileBlock implements IOr
@Override
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
final TileQuartzGrowthAccelerator cga = this.getTileEntity( w, pos );
if( cga != null && cga.isPowered() && CommonHelper.proxy.shouldAddParticles( r ) )
if( cga != null && cga.isPowered() && AppEng.proxy.shouldAddParticles( r ) )
{
final double d0 = r.nextFloat() - 0.5F;
final double d1 = r.nextFloat() - 0.5F;
@@ -40,6 +40,7 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.misc.TileSecurityStation;
import appeng.util.Platform;
public class BlockSecurityStation extends AEBaseTileBlock
{
@@ -49,8 +50,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
{
super( Material.IRON );
this.setTileEntity( TileSecurityStation.class );
this.setDefaultState( getDefaultState().withProperty( POWERED, false ) );
this.setDefaultState( this.getDefaultState().withProperty( POWERED, false ) );
}
@Override
@@ -69,7 +69,7 @@ public class BlockSecurityStation extends AEBaseTileBlock
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
boolean powered = false;
TileSecurityStation te = getTileEntity( world, pos );
TileSecurityStation te = this.getTileEntity( world, pos );
if( te != null )
{
powered = te.isActive();
@@ -40,6 +40,7 @@ import appeng.block.AEBaseTileBlock;
import appeng.helpers.ICustomCollision;
import appeng.tile.misc.TileSkyCompass;
public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
{
@@ -49,7 +50,6 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
public BlockSkyCompass()
{
super( Material.CIRCUITS );
this.setTileEntity( TileSkyCompass.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
@@ -58,7 +58,7 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { FORWARD, UP, ROTATION } );
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { FORWARD, UP, ROTATION } );
}
@Override
@@ -78,13 +78,13 @@ public class BlockSkyCompass extends AEBaseTileBlock implements ICustomCollision
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final TileSkyCompass sc = this.getTileEntity( w, pos );
final TileSkyCompass sc = this.getTileEntity( world, pos );
final EnumFacing forward = sc.getForward();
if( !this.canPlaceAt( w, pos, forward.getOpposite() ) )
if( !this.canPlaceAt( world, pos, forward.getOpposite() ) )
{
this.dropTorch( w, pos );
this.dropTorch( world, pos );
}
}
@@ -42,14 +42,12 @@ import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import appeng.block.AEBaseBlock;
import appeng.core.AppEng;
import appeng.entity.EntityIds;
import appeng.entity.EntityTinyTNTPrimed;
import appeng.helpers.ICustomCollision;
public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
{
@@ -62,7 +60,9 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
this.setSoundType( SoundType.GROUND );
this.setHardness( 0F );
EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get( EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
// TODO: 1.11
// EntityRegistry.registerModEntity( EntityTinyTNTPrimed.class, "EntityTinyTNTPrimed", EntityIds.get(
// EntityTinyTNTPrimed.class ), AppEng.instance(), 16, 4, true );
}
@Override
@@ -86,18 +86,19 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
if( !w.isRemote )
{
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, igniter );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1, 1 );
w.spawnEntity( primedTinyTNTEntity );
w.playSound( null, primedTinyTNTEntity.posX, primedTinyTNTEntity.posY, primedTinyTNTEntity.posZ, SoundEvents.ENTITY_TNT_PRIMED,
SoundCategory.BLOCKS, 1, 1 );
}
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
if( w.isBlockIndirectlyGettingPowered( pos ) > 0 )
if( world.isBlockIndirectlyGettingPowered( pos ) > 0 )
{
this.startFuse( w, pos, null );
w.setBlockToAir( pos );
this.startFuse( world, pos, null );
world.setBlockToAir( pos );
}
}
@@ -140,9 +141,10 @@ public class BlockTinyTNT extends AEBaseBlock implements ICustomCollision
super.onBlockExploded( w, pos, exp );
if( !w.isRemote )
{
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp.getExplosivePlacedBy() );
final EntityTinyTNTPrimed primedTinyTNTEntity = new EntityTinyTNTPrimed( w, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, exp
.getExplosivePlacedBy() );
primedTinyTNTEntity.setFuse( w.rand.nextInt( primedTinyTNTEntity.getFuse() / 4 ) + primedTinyTNTEntity.getFuse() / 8 );
w.spawnEntityInWorld( primedTinyTNTEntity );
w.spawnEntity( primedTinyTNTEntity );
}
}
@@ -44,6 +44,7 @@ import appeng.tile.AEBaseTile;
import appeng.tile.misc.TileVibrationChamber;
import appeng.util.Platform;
public final class BlockVibrationChamber extends AEBaseTileBlock
{
@@ -53,9 +54,8 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
public BlockVibrationChamber()
{
super( Material.IRON );
this.setTileEntity( TileVibrationChamber.class );
this.setHardness( 4.2F );
this.setDefaultState( getDefaultState().withProperty( ACTIVE, false ) );
this.setDefaultState( this.getDefaultState().withProperty( ACTIVE, false ) );
}
@Override
@@ -71,7 +71,7 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
@Override
protected IProperty[] getAEStates()
{
return new IProperty[]{ ACTIVE };
return new IProperty[] { ACTIVE };
}
@Override
@@ -94,11 +94,11 @@ public final class BlockVibrationChamber extends AEBaseTileBlock
return true;
}
@Override
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
{
if( !AEConfig.instance.enableEffects )
if( !AEConfig.instance().isEnableEffects() )
{
return;
}
@@ -1,3 +1,4 @@
package appeng.block.misc;
@@ -22,6 +22,7 @@ package appeng.block.networking;
import java.util.EnumSet;
import java.util.List;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
@@ -45,6 +46,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
@@ -99,6 +101,7 @@ public class BlockCableBus extends AEBaseTileBlock
// this will actually be overwritten later through setupTile and the
// combined layers
this.setTileEntity( TileCableBus.class );
this.useNeighborBrightness = true;
}
@Override
@@ -116,7 +119,7 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
{
CableBusRenderState renderState = cb( world, pos ).getRenderState();
CableBusRenderState renderState = this.cb( world, pos ).getRenderState();
return ( (IExtendedBlockState) state ).withProperty( RENDER_STATE_PROPERTY, renderState );
}
@@ -129,7 +132,7 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
public void onNeighborChange( final IBlockAccess w, final BlockPos pos, final BlockPos neighbor )
{
this.cb( w, pos ).onNeighborChanged();
this.cb( w, pos ).onNeighborChanged( w, pos, neighbor );
}
@Override
@@ -235,7 +238,7 @@ public class BlockCableBus extends AEBaseTileBlock
return sp.facade.getItemStack();
}
return null;
return ItemStack.EMPTY;
}
@Override
@@ -253,9 +256,9 @@ public class BlockCableBus extends AEBaseTileBlock
ICableBusContainer cb = this.cb( world, target.getBlockPos() );
// Our built-in model has the actual baked sprites we need
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( getDefaultState() );
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );
// We cannot add the effect if we dont have the model
// We cannot add the effect if we don't have the model
if( !( model instanceof CableBusBakedModel ) )
{
return true;
@@ -269,9 +272,9 @@ public class BlockCableBus extends AEBaseTileBlock
TextureAtlasSprite texture = Platform.pickRandom( cableBusModel.getParticleTextures( renderState ) );
if( texture != null )
{
double x = target.hitVec.xCoord;
double y = target.hitVec.yCoord;
double z = target.hitVec.zCoord;
double x = target.hitVec.x;
double y = target.hitVec.y;
double z = target.hitVec.z;
Particle fx = new DestroyFX( world, x, y, z, 0.0D, 0.0D, 0.0D, state ).setBlockPos( target.getBlockPos() ).multipleParticleScaleBy( 0.8F );
fx.setParticleTexture( texture );
@@ -288,7 +291,7 @@ public class BlockCableBus extends AEBaseTileBlock
ICableBusContainer cb = this.cb( world, pos );
// Our built-in model has the actual baked sprites we need
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( getDefaultState() );
IBakedModel model = Minecraft.getMinecraft().getBlockRendererDispatcher().getModelForState( this.getDefaultState() );
// We cannot add the effect if we dont have the model
if( !( model instanceof CableBusBakedModel ) )
@@ -317,7 +320,8 @@ public class BlockCableBus extends AEBaseTileBlock
double d0 = (double) pos.getX() + ( (double) j + 0.5D ) / 4.0D;
double d1 = (double) pos.getY() + ( (double) k + 0.5D ) / 4.0D;
double d2 = (double) pos.getZ() + ( (double) l + 0.5D ) / 4.0D;
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, getDefaultState() ).setBlockPos( pos );
ParticleDigging particle = new DestroyFX( world, d0, d1, d2, d0 - (double) pos.getX() - 0.5D, d1 - (double) pos
.getY() - 0.5D, d2 - (double) pos.getZ() - 0.5D, this.getDefaultState() ).setBlockPos( pos );
particle.setParticleTexture( texture );
effectRenderer.addEffect( particle );
}
@@ -329,11 +333,11 @@ public class BlockCableBus extends AEBaseTileBlock
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
if( Platform.isServer() )
{
this.cb( w, pos ).onNeighborChanged();
this.cb( world, pos ).onNeighborChanged( world, pos, fromPos );
}
}
@@ -376,7 +380,7 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
{
// do nothing
}
@@ -385,8 +389,9 @@ public class BlockCableBus extends AEBaseTileBlock
{
noTesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBus.class );
this.setTileEntity( noTesrTile );
// TODO: Change after transition phase
GameRegistry.registerTileEntityWithAlternatives( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus", "BlockCableBus" );
GameRegistry.registerTileEntity( noTesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "BlockCableBus" );
if( Platform.isClient() )
{
setupTesr();
@@ -397,8 +402,7 @@ public class BlockCableBus extends AEBaseTileBlock
private static void setupTesr()
{
tesrTile = Api.INSTANCE.partHelper().getCombinedInstance( TileCableBusTESR.class );
// TODO: Change after transition phase
GameRegistry.registerTileEntityWithAlternatives( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus", "ClientOnly_TESR_CableBus" );
GameRegistry.registerTileEntity( tesrTile, AppEng.MOD_ID.toLowerCase() + ":" + "ClientOnly_TESR_CableBus" );
ClientRegistry.bindTileEntitySpecialRenderer( BlockCableBus.getTesrTile(), new CableBusTESR() );
}
@@ -34,6 +34,7 @@ import net.minecraft.world.World;
import appeng.block.AEBaseTileBlock;
import appeng.tile.networking.TileController;
public class BlockController extends AEBaseTileBlock
{
@@ -49,11 +50,11 @@ public class BlockController extends AEBaseTileBlock
}
/**
* Controls the rendering of the controller block (connected texture style).
* inside_a and inside_b are alternating patterns for a controller that is enclosed by other controllers,
* and since they are always offline, they do not have the usual sub-states.
*/
/**
* Controls the rendering of the controller block (connected texture style).
* inside_a and inside_b are alternating patterns for a controller that is enclosed by other controllers,
* and since they are always offline, they do not have the usual sub-states.
*/
public enum ControllerRenderType implements IStringSerializable
{
block, column_x, column_y, column_z, inside_a, inside_b;
@@ -73,9 +74,8 @@ public class BlockController extends AEBaseTileBlock
public BlockController()
{
super( Material.IRON );
this.setTileEntity( TileController.class );
this.setHardness( 6 );
this.setDefaultState( getDefaultState()
this.setDefaultState( this.getDefaultState()
.withProperty( CONTROLLER_STATE, ControllerBlockState.offline )
.withProperty( CONTROLLER_TYPE, ControllerRenderType.block ) );
}
@@ -89,7 +89,7 @@ public class BlockController extends AEBaseTileBlock
@Override
protected BlockStateContainer createBlockState()
{
return new BlockStateContainer( this, getAEStates() );
return new BlockStateContainer( this, this.getAEStates() );
}
/**
@@ -97,6 +97,7 @@ public class BlockController extends AEBaseTileBlock
* controllers and the network state of this controller (offline, online, conflicted). This is used to
* get a rudimentary connected texture feel for the controller based on how it is placed.
*/
@SuppressWarnings( "deprecation" )
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess world, BlockPos pos )
{
@@ -109,9 +110,12 @@ public class BlockController extends AEBaseTileBlock
int z = pos.getZ();
// Detect whether controllers are on both sides of the x, y, and z axes
final boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y, z ) instanceof TileController;
final boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1, z ) instanceof TileController;
final boolean zz = this.getTileEntity( world, x, y, z - 1 ) instanceof TileController && this.getTileEntity( world, x, y, z + 1 ) instanceof TileController;
final boolean xx = this.getTileEntity( world, x - 1, y, z ) instanceof TileController && this.getTileEntity( world, x + 1, y,
z ) instanceof TileController;
final boolean yy = this.getTileEntity( world, x, y - 1, z ) instanceof TileController && this.getTileEntity( world, x, y + 1,
z ) instanceof TileController;
final boolean zz = this.getTileEntity( world, x, y, z - 1 ) instanceof TileController && this.getTileEntity( world, x, y,
z + 1 ) instanceof TileController;
if( xx && !yy && !zz )
{
@@ -156,6 +160,7 @@ public class BlockController extends AEBaseTileBlock
return state.getValue( CONTROLLER_STATE ).ordinal();
}
@SuppressWarnings( "deprecation" )
@Override
public IBlockState getStateFromMeta( final int meta )
{
@@ -169,10 +174,11 @@ public class BlockController extends AEBaseTileBlock
return BlockRenderLayer.CUTOUT;
}
@SuppressWarnings( "deprecation" )
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final TileController tc = this.getTileEntity( w, pos );
final TileController tc = this.getTileEntity( world, pos );
if( tc != null )
{
tc.onNeighborChange( false );
@@ -21,7 +21,7 @@ package appeng.block.networking;
import appeng.block.AEBaseTileBlock;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.networking.TileCreativeEnergyCell;
public class BlockCreativeEnergyCell extends AEBaseTileBlock
{
@@ -29,6 +29,5 @@ public class BlockCreativeEnergyCell extends AEBaseTileBlock
public BlockCreativeEnergyCell()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileCreativeEnergyCell.class );
}
}
@@ -19,14 +19,12 @@
package appeng.block.networking;
import appeng.tile.networking.TileDenseEnergyCell;
public class BlockDenseEnergyCell extends BlockEnergyCell
{
public BlockDenseEnergyCell()
{
this.setTileEntity( TileDenseEnergyCell.class );
}
@Override
@@ -22,7 +22,6 @@ package appeng.block.networking;
import net.minecraft.block.material.Material;
import appeng.block.AEBaseTileBlock;
import appeng.tile.networking.TileEnergyAcceptor;
public class BlockEnergyAcceptor extends AEBaseTileBlock
@@ -31,6 +30,5 @@ public class BlockEnergyAcceptor extends AEBaseTileBlock
public BlockEnergyAcceptor()
{
super( Material.IRON );
this.setTileEntity( TileEnergyAcceptor.class );
}
}
@@ -19,21 +19,18 @@
package appeng.block.networking;
import java.util.List;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.block.AEBaseTileBlock;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.networking.TileEnergyCell;
import appeng.util.Platform;
@@ -57,15 +54,13 @@ public class BlockEnergyCell extends AEBaseTileBlock
public BlockEnergyCell()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileEnergyCell.class );
}
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
{
super.getCheckedSubBlocks( item, tabs, itemStacks );
super.getSubBlocks( tabs, itemStacks );
final ItemStack charged = new ItemStack( this, 1 );
final NBTTagCompound tag = Platform.openNbtData( charged );
@@ -57,7 +57,7 @@ public class BlockEnergyCellRendering extends BlockRenderingCustomizer
double fillFactor = getFillFactor( is );
int storageLevel = TileEnergyCell.getStorageLevelFromFillFactor( fillFactor );
return new ModelResourceLocation( baseModel, "fullness=" + storageLevel );
return new ModelResourceLocation( this.baseModel, "fullness=" + storageLevel );
}
/**
@@ -21,14 +21,12 @@ package appeng.block.networking;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
@@ -46,6 +44,7 @@ import appeng.helpers.ICustomCollision;
import appeng.tile.networking.TileWireless;
import appeng.util.Platform;
public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
{
@@ -58,21 +57,19 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
@Override
public String getName()
{
return name().toLowerCase();
return this.name().toLowerCase();
}
}
public static final PropertyEnum<State> STATE = PropertyEnum.create( "state", State.class );
public BlockWireless()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileWireless.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
this.setDefaultState( getDefaultState().withProperty( STATE, State.OFF ) );
this.setDefaultState( this.getDefaultState().withProperty( STATE, State.OFF ) );
}
@Override
@@ -86,7 +83,7 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
{
State teState = State.OFF;
TileWireless te = getTileEntity( worldIn, pos );
TileWireless te = this.getTileEntity( worldIn, pos );
if( te != null )
{
if( te.isActive() )
@@ -110,15 +107,11 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
@Override
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public boolean onBlockActivated( final World w, final BlockPos pos, final IBlockState state, final EntityPlayer player, final EnumHand hand, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
if( player.isSneaking() )
{
return false;
}
final TileWireless tg = this.getTileEntity( w, pos );
if( tg != null )
if( tg != null && !player.isSneaking() )
{
if( Platform.isServer() )
{
@@ -126,7 +119,8 @@ public class BlockWireless extends AEBaseTileBlock implements ICustomCollision
}
return true;
}
return false;
return super.onBlockActivated( w, pos, state, player, hand, side, hitX, hitY, hitZ );
}
@Override
@@ -45,7 +45,7 @@ public class CableBusRendering extends BlockRenderingCustomizer
@SideOnly( Side.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.builtInModel( "models/block/builtin/cable_bus", new CableBusModel( partModels ) );
rendering.builtInModel( "models/block/builtin/cable_bus", new CableBusModel( this.partModels ) );
rendering.blockColor( new CableBusColor() );
rendering.modelCustomizer( ( loc, model ) -> model );
}
@@ -1,3 +1,4 @@
package appeng.block.networking;
@@ -21,7 +21,6 @@ package appeng.block.paint;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
@@ -34,6 +33,7 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@@ -49,6 +49,7 @@ import appeng.helpers.Splotch;
import appeng.tile.misc.TilePaint;
import appeng.util.Platform;
public class BlockPaint extends AEBaseTileBlock
{
@@ -58,7 +59,6 @@ public class BlockPaint extends AEBaseTileBlock
{
super( new MaterialLiquid( MapColor.AIR ) );
this.setTileEntity( TilePaint.class );
this.setLightOpacity( 0 );
this.setFullSize( false );
this.setOpaque( false );
@@ -75,7 +75,7 @@ public class BlockPaint extends AEBaseTileBlock
{
IExtendedBlockState extState = (IExtendedBlockState) state;
TilePaint te = getTileEntity( world, pos );
TilePaint te = this.getTileEntity( world, pos );
Collection<Splotch> splotches = Collections.emptyList();
if( te != null )
@@ -94,13 +94,13 @@ public class BlockPaint extends AEBaseTileBlock
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
{
// do nothing
}
@Override
public AxisAlignedBB getCollisionBoundingBox( final IBlockState state, final World worldIn, final BlockPos pos )
public AxisAlignedBB getCollisionBoundingBox( IBlockState blockState, IBlockAccess worldIn, BlockPos pos )
{
return null;
}
@@ -112,9 +112,9 @@ public class BlockPaint extends AEBaseTileBlock
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final TilePaint tp = this.getTileEntity( w, pos );
final TilePaint tp = this.getTileEntity( world, pos );
if( tp != null )
{
@@ -1,12 +1,14 @@
package appeng.block.paint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
import javax.annotation.Nullable;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.state.IBlockState;
@@ -26,7 +28,8 @@ import appeng.helpers.Splotch;
/**
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using a
* Renders paint blocks, which render multiple "splotches" that have been applied to the sides of adjacent blocks using
* a
* matter cannon with paint balls.
*/
class PaintBakedModel implements IBakedModel
@@ -63,7 +66,7 @@ class PaintBakedModel implements IBakedModel
// This is the inventory model which should usually not be used other than in special cases
List<BakedQuad> quads = new ArrayList<>( 1 );
CubeBuilder builder = new CubeBuilder( this.vertexFormat, quads );
builder.setTexture( textures[0] );
builder.setTexture( this.textures[0] );
builder.addCube( 0, 0, 0, 16, 16, 16 );
return quads;
}
@@ -78,10 +81,11 @@ class PaintBakedModel implements IBakedModel
List<Splotch> splotches = splotchesState.getSplotches();
CubeBuilder builder = new CubeBuilder( vertexFormat );
CubeBuilder builder = new CubeBuilder( this.vertexFormat );
float offsetConstant = 0.001f;
for( final Splotch s : splotches) {
for( final Splotch s : splotches )
{
if( s.isLumen() )
{
@@ -105,7 +109,7 @@ class PaintBakedModel implements IBakedModel
pos_x = Math.max( buffer, Math.min( 1.0f - buffer, pos_x ) );
pos_y = Math.max( buffer, Math.min( 1.0f - buffer, pos_y ) );
TextureAtlasSprite ico = textures[s.getSeed() % textures.length];
TextureAtlasSprite ico = this.textures[s.getSeed() % this.textures.length];
builder.setTexture( ico );
builder.setCustomUv( s.getSide().getOpposite(), 0, 0, 16, 16 );
@@ -172,7 +176,7 @@ class PaintBakedModel implements IBakedModel
@Override
public TextureAtlasSprite getParticleTexture()
{
return textures[0];
return this.textures[0];
}
@Override
@@ -190,7 +194,6 @@ class PaintBakedModel implements IBakedModel
static List<ResourceLocation> getRequiredTextures()
{
return ImmutableList.of(
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3
);
TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3 );
}
}
@@ -1,10 +1,10 @@
package appeng.block.paint;
import java.util.Collection;
import java.util.Collections;
import com.google.common.base.Function;
import java.util.function.Function;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
@@ -1,3 +1,4 @@
package appeng.block.paint;
@@ -1,3 +1,4 @@
package appeng.block.paint;
@@ -24,7 +25,7 @@ class PaintSplotches
List<Splotch> getSplotches()
{
return splotches;
return this.splotches;
}
}
@@ -1,3 +1,4 @@
package appeng.block.paint;
@@ -38,6 +38,7 @@ import appeng.block.AEBaseTileBlock;
import appeng.helpers.ICustomCollision;
import appeng.tile.qnb.TileQuantumBridge;
public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICustomCollision
{
@@ -48,12 +49,11 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
public BlockQuantumBase( final Material mat )
{
super( mat );
this.setTileEntity( TileQuantumBridge.class );
final float shave = 2.0f / 16.0f;
this.boundingBox = new AxisAlignedBB( shave, shave, shave, 1.0f - shave, 1.0f - shave, 1.0f - shave );
this.setLightOpacity( 0 );
this.setFullSize( this.setOpaque( false ) );
this.setDefaultState( getDefaultState().withProperty( FORMED, false ) );
this.setDefaultState( this.getDefaultState().withProperty( FORMED, false ) );
}
@Override
@@ -65,7 +65,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { FORMED_STATE } );
}
@Override
@@ -73,7 +73,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
{
IExtendedBlockState extState = (IExtendedBlockState) state;
TileQuantumBridge bridge = getTileEntity( world, pos );
TileQuantumBridge bridge = this.getTileEntity( world, pos );
if( bridge != null )
{
QnbFormedState formedState = new QnbFormedState( bridge.getAdjacentQuantumBridges(), bridge.isCorner(), bridge.isPowered() );
@@ -86,7 +86,7 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
@Override
public IBlockState getActualState( IBlockState state, IBlockAccess worldIn, BlockPos pos )
{
TileQuantumBridge bridge = getTileEntity( worldIn, pos );
TileQuantumBridge bridge = this.getTileEntity( worldIn, pos );
if( bridge != null )
{
state = state.withProperty( FORMED, bridge.isFormed() );
@@ -101,9 +101,9 @@ public abstract class BlockQuantumBase extends AEBaseTileBlock implements ICusto
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final TileQuantumBridge bridge = this.getTileEntity( w, pos );
final TileQuantumBridge bridge = this.getTileEntity( world, pos );
if( bridge != null )
{
bridge.neighborUpdate();
@@ -37,7 +37,7 @@ import net.minecraft.world.World;
import appeng.api.util.AEPartLocation;
import appeng.client.EffectType;
import appeng.core.CommonHelper;
import appeng.core.AppEng;
import appeng.core.sync.GuiBridge;
import appeng.helpers.AEGlassMaterial;
import appeng.tile.qnb.TileQuantumBridge;
@@ -60,9 +60,9 @@ public class BlockQuantumLinkChamber extends BlockQuantumBase
{
if( bridge.hasQES() )
{
if( CommonHelper.proxy.shouldAddParticles( rand ) )
if( AppEng.proxy.shouldAddParticles( rand ) )
{
CommonHelper.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
AppEng.proxy.spawnEffect( EffectType.Energy, w, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, null );
}
}
}
@@ -1,12 +1,14 @@
package appeng.block.qnb;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import javax.annotation.Nullable;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block;
@@ -77,46 +79,47 @@ class QnbFormedBakedModel implements IBakedModel
// Get the correct base model
if( !( state instanceof IExtendedBlockState ) )
{
return baseModel.getQuads( state, side, rand );
return this.baseModel.getQuads( state, side, rand );
}
IExtendedBlockState extendedBlockState = (IExtendedBlockState) state;
QnbFormedState formedState = extendedBlockState.getValue( BlockQuantumBase.FORMED_STATE );
return getQuads( formedState, state, side, rand );
return this.getQuads( formedState, state, side, rand );
}
private List<BakedQuad> getQuads( QnbFormedState formedState, IBlockState state, EnumFacing side, long rand )
{
CubeBuilder builder = new CubeBuilder( vertexFormat );
CubeBuilder builder = new CubeBuilder( this.vertexFormat );
if( state.getBlock() == linkBlock )
if( state.getBlock() == this.linkBlock )
{
Set<EnumFacing> sides = formedState.getAdjacentQuantumBridges();
this.renderCableAt( builder, 0.11f * 16, glassCableTexture, 0.141f * 16, sides );
this.renderCableAt( builder, 0.11f * 16, this.glassCableTexture, 0.141f * 16, sides );
this.renderCableAt( builder, 0.188f * 16, coveredCableTexture, 0.1875f * 16, sides );
this.renderCableAt( builder, 0.188f * 16, this.coveredCableTexture, 0.1875f * 16, sides );
builder.setTexture( linkTexture );
builder.setTexture( this.linkTexture );
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
}
else
{
if( formedState.isCorner() )
{
this.renderCableAt( builder, 0.188f * 16, coveredCableTexture, 0.05f * 16, formedState.getAdjacentQuantumBridges() );
this.renderCableAt( builder, 0.188f * 16, this.coveredCableTexture, 0.05f * 16, formedState.getAdjacentQuantumBridges() );
builder.setTexture( ringTexture );
builder.setTexture( this.ringTexture );
builder.addCube( DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
if( formedState.isPowered() )
{
builder.setTexture( lightCornerTexture );
builder.setTexture( this.lightCornerTexture );
builder.setRenderFullBright( true );
for( EnumFacing facing : EnumFacing.values() )
{
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture (avoids z-fighting)
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
// (avoids z-fighting)
float xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
@@ -124,14 +127,13 @@ class QnbFormedBakedModel implements IBakedModel
builder.setDrawFaces( EnumSet.of( facing ) );
builder.addCube(
DEFAULT_RENDER_MIN - xOffset, DEFAULT_RENDER_MIN - yOffset, DEFAULT_RENDER_MIN - zOffset,
DEFAULT_RENDER_MAX + xOffset, DEFAULT_RENDER_MAX + yOffset, DEFAULT_RENDER_MAX + zOffset
);
DEFAULT_RENDER_MAX + xOffset, DEFAULT_RENDER_MAX + yOffset, DEFAULT_RENDER_MAX + zOffset );
}
}
}
else
{
builder.setTexture( ringTexture );
builder.setTexture( this.ringTexture );
builder.addCube( 0, DEFAULT_RENDER_MIN, DEFAULT_RENDER_MIN, 16, DEFAULT_RENDER_MAX, DEFAULT_RENDER_MAX );
@@ -141,11 +143,12 @@ class QnbFormedBakedModel implements IBakedModel
if( formedState.isPowered() )
{
builder.setTexture( lightTexture );
builder.setTexture( this.lightTexture );
builder.setRenderFullBright( true );
for( EnumFacing facing : EnumFacing.values() )
{
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture (avoids z-fighting)
// Offset the face by a slight amount so that it is drawn over the already drawn ring texture
// (avoids z-fighting)
float xOffset = Math.abs( facing.getFrontOffsetX() * 0.01f );
float yOffset = Math.abs( facing.getFrontOffsetY() * 0.01f );
float zOffset = Math.abs( facing.getFrontOffsetZ() * 0.01f );
@@ -153,8 +156,7 @@ class QnbFormedBakedModel implements IBakedModel
builder.setDrawFaces( EnumSet.of( facing ) );
builder.addCube(
-xOffset, -yOffset, -zOffset,
16 + xOffset, 16 + yOffset, 16 + zOffset
);
16 + xOffset, 16 + yOffset, 16 + zOffset );
}
}
}
@@ -201,7 +203,7 @@ class QnbFormedBakedModel implements IBakedModel
@Override
public boolean isAmbientOcclusion()
{
return baseModel.isAmbientOcclusion();
return this.baseModel.isAmbientOcclusion();
}
@Override
@@ -219,25 +221,24 @@ class QnbFormedBakedModel implements IBakedModel
@Override
public TextureAtlasSprite getParticleTexture()
{
return baseModel.getParticleTexture();
return this.baseModel.getParticleTexture();
}
@Override
public ItemCameraTransforms getItemCameraTransforms()
{
return baseModel.getItemCameraTransforms();
return this.baseModel.getItemCameraTransforms();
}
@Override
public ItemOverrideList getOverrides()
{
return baseModel.getOverrides();
return this.baseModel.getOverrides();
}
public static List<ResourceLocation> getRequiredTextures()
{
return ImmutableList.of(
TEXTURE_LINK, TEXTURE_RING, TEXTURE_CABLE_GLASS, TEXTURE_COVERED_CABLE, TEXTURE_RING_LIGHT, TEXTURE_RING_LIGHT_CORNER
);
TEXTURE_LINK, TEXTURE_RING, TEXTURE_CABLE_GLASS, TEXTURE_COVERED_CABLE, TEXTURE_RING_LIGHT, TEXTURE_RING_LIGHT_CORNER );
}
}
@@ -1,9 +1,10 @@
package appeng.block.qnb;
import java.util.Collection;
import java.util.function.Function;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.block.model.IBakedModel;
@@ -38,7 +39,7 @@ public class QnbFormedModel implements IModel
@Override
public IBakedModel bake( IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter )
{
IBakedModel ringModel = getBaseModel( MODEL_RING, state, format, bakedTextureGetter );
IBakedModel ringModel = this.getBaseModel( MODEL_RING, state, format, bakedTextureGetter );
return new QnbFormedBakedModel( format, ringModel, bakedTextureGetter );
}
@@ -1,3 +1,4 @@
package appeng.block.qnb;
@@ -24,17 +25,17 @@ public class QnbFormedState
public Set<EnumFacing> getAdjacentQuantumBridges()
{
return adjacentQuantumBridges;
return this.adjacentQuantumBridges;
}
public boolean isCorner()
{
return corner;
return this.corner;
}
public boolean isPowered()
{
return powered;
return this.powered;
}
}
@@ -1,3 +1,4 @@
package appeng.block.qnb;
@@ -1,3 +1,4 @@
package appeng.block.qnb;
@@ -18,6 +19,6 @@ public class QuantumBridgeRendering extends BlockRenderingCustomizer
{
rendering.builtInModel( "models/block/qnb/qnb_formed", new QnbFormedModel() );
// Disable auto rotation
rendering.modelCustomizer( (location, model) -> model );
rendering.modelCustomizer( ( location, model ) -> model );
}
}
@@ -26,8 +26,8 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
@@ -39,6 +39,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.block.AEBaseBlock;
import appeng.helpers.ICustomCollision;
public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
{
@@ -53,7 +54,7 @@ public class BlockMatrixFrame extends AEBaseBlock implements ICustomCollision
@Override
@SideOnly( Side.CLIENT )
public void getCheckedSubBlocks( final Item item, final CreativeTabs tabs, final List<ItemStack> itemStacks )
public void getSubBlocks( final CreativeTabs tabs, final NonNullList<ItemStack> itemStacks )
{
// do nothing
}
@@ -37,19 +37,19 @@ import appeng.core.sync.GuiBridge;
import appeng.tile.spatial.TileSpatialIOPort;
import appeng.util.Platform;
public class BlockSpatialIOPort extends AEBaseTileBlock
{
public BlockSpatialIOPort()
{
super( Material.IRON );
this.setTileEntity( TileSpatialIOPort.class );
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final TileSpatialIOPort te = this.getTileEntity( w, pos );
final TileSpatialIOPort te = this.getTileEntity( world, pos );
if( te != null )
{
te.updateRedstoneState();
@@ -44,13 +44,12 @@ public class BlockSpatialPylon extends AEBaseTileBlock
public BlockSpatialPylon()
{
super( AEGlassMaterial.INSTANCE );
this.setTileEntity( TileSpatialPylon.class );
}
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] { STATE } );
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] { STATE } );
}
@Override
@@ -58,13 +57,13 @@ public class BlockSpatialPylon extends AEBaseTileBlock
{
IExtendedBlockState extState = (IExtendedBlockState) state;
return extState.withProperty( STATE, getDisplayState( world, pos ) );
return extState.withProperty( STATE, this.getDisplayState( world, pos ) );
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final TileSpatialPylon tsp = this.getTileEntity( w, pos );
final TileSpatialPylon tsp = this.getTileEntity( world, pos );
if( tsp != null )
{
tsp.neighborChanged();
@@ -84,7 +83,7 @@ public class BlockSpatialPylon extends AEBaseTileBlock
private int getDisplayState( IBlockAccess world, BlockPos pos )
{
TileSpatialPylon te = getTileEntity( world, pos );
TileSpatialPylon te = this.getTileEntity( world, pos );
if( te == null )
{
@@ -52,8 +52,7 @@ public class BlockChest extends AEBaseTileBlock
public BlockChest()
{
super( Material.IRON );
this.setTileEntity( TileChest.class );
this.setDefaultState( getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
this.setDefaultState( this.getDefaultState().withProperty( SLOT_STATE, DriveSlotState.EMPTY ) );
}
@Override
@@ -73,7 +72,7 @@ public class BlockChest extends AEBaseTileBlock
{
DriveSlotState slotState = DriveSlotState.EMPTY;
TileChest te = getTileEntity( worldIn, pos );
TileChest te = this.getTileEntity( worldIn, pos );
if( te != null )
{
@@ -109,8 +108,8 @@ public class BlockChest extends AEBaseTileBlock
}
else
{
final ItemStack cell = tg.getStackInSlot( 1 );
if( cell != null )
final ItemStack cell = tg.getCell();
if( !cell.isEmpty() )
{
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
@@ -118,7 +117,7 @@ public class BlockChest extends AEBaseTileBlock
}
else
{
p.addChatMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
p.sendMessage( PlayerMessages.ChestCannotReadStorageCell.get() );
}
}
@@ -47,12 +47,11 @@ import appeng.util.Platform;
public class BlockDrive extends AEBaseTileBlock
{
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>("drive_slots_state", DriveSlotsState.class);
public static final UnlistedProperty<DriveSlotsState> SLOTS_STATE = new UnlistedProperty<>( "drive_slots_state", DriveSlotsState.class );
public BlockDrive()
{
super( Material.IRON );
this.setTileEntity( TileDrive.class );
}
@Override
@@ -64,7 +63,7 @@ public class BlockDrive extends AEBaseTileBlock
@Override
protected BlockStateContainer createBlockState()
{
return new ExtendedBlockState( this, getAEStates(), new IUnlistedProperty[] {
return new ExtendedBlockState( this, this.getAEStates(), new IUnlistedProperty[] {
SLOTS_STATE,
FORWARD,
UP
@@ -74,7 +73,7 @@ public class BlockDrive extends AEBaseTileBlock
@Override
public IBlockState getExtendedState( IBlockState state, IBlockAccess world, BlockPos pos )
{
TileDrive te = getTileEntity( world, pos );
TileDrive te = this.getTileEntity( world, pos );
if( te == null )
{
return super.getExtendedState( state, world, pos );
@@ -44,13 +44,12 @@ public class BlockIOPort extends AEBaseTileBlock
public BlockIOPort()
{
super( Material.IRON );
this.setTileEntity( TileIOPort.class );
}
@Override
public void neighborChanged( final IBlockState state, final World w, final BlockPos pos, final Block neighborBlock )
public void neighborChanged( IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos )
{
final TileIOPort te = this.getTileEntity( w, pos );
final TileIOPort te = this.getTileEntity( world, pos );
if( te != null )
{
te.updateRedstoneState();
@@ -47,6 +47,10 @@ import appeng.util.Platform;
public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
{
private static final double AABB_OFFSET_BOTTOM = .0625d;
private static final double AABB_OFFSET_SIDES = 0;
private static final double AABB_OFFSET_TOP = .125d;
public enum SkyChestType
{
STONE, BLOCK
@@ -57,7 +61,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
public BlockSkyChest( final SkyChestType type )
{
super( Material.ROCK );
this.setTileEntity( TileSkyChest.class );
this.setOpaque( this.setFullSize( false ) );
this.lightOpacity = 0;
this.setHardness( 50 );
@@ -71,7 +74,6 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
return EnumBlockRenderType.ENTITYBLOCK_ANIMATED;
}
@Override
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
{
@@ -85,6 +87,21 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
@Override
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity thePlayer, final boolean b )
{
final AxisAlignedBB aabb = this.computeAABB( w, pos );
return Collections.singletonList( aabb );
}
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
final AxisAlignedBB aabb = this.computeAABB( w, pos );
out.add( aabb );
}
private AxisAlignedBB computeAABB( final World w, final BlockPos pos )
{
final TileSkyChest sk = this.getTileEntity( w, pos );
EnumFacing o = EnumFacing.UP;
@@ -94,17 +111,19 @@ public class BlockSkyChest extends AEBaseTileBlock implements ICustomCollision
o = sk.getUp();
}
final double offsetX = o.getFrontOffsetX() == 0 ? 0.06 : 0.0;
final double offsetY = o.getFrontOffsetY() == 0 ? 0.06 : 0.0;
final double offsetZ = o.getFrontOffsetZ() == 0 ? 0.06 : 0.0;
final double offsetX = o.getFrontOffsetX() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
final double offsetY = o.getFrontOffsetY() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
final double offsetZ = o.getFrontOffsetZ() == 0 ? AABB_OFFSET_BOTTOM : AABB_OFFSET_SIDES;
final double sc = 0.06;
return Collections.singletonList( new AxisAlignedBB( Math.max( 0.0, offsetX - o.getFrontOffsetX() * sc ), Math.max( 0.0, offsetY - o.getFrontOffsetY() * sc ), Math.max( 0.0, offsetZ - o.getFrontOffsetZ() * sc ), Math.min( 1.0, ( 1.0 - offsetX ) - o.getFrontOffsetX() * sc ), Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * sc ), Math.min( 1.0, ( 1.0 - offsetZ ) - o.getFrontOffsetZ() * sc ) ) );
}
// x/z needs to be multiplied by -1, thus we simply add not substract.
final double minX = Math.max( 0.0, offsetX + o.getFrontOffsetX() * AABB_OFFSET_TOP );
final double minY = Math.max( 0.0, offsetY - o.getFrontOffsetY() * AABB_OFFSET_TOP );
final double minZ = Math.max( 0.0, offsetZ + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
@Override
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
{
out.add( new AxisAlignedBB( 0.05, 0.05, 0.05, 0.95, 0.95, 0.95 ) );
final double maxX = Math.min( 1.0, ( 1.0 - offsetX ) + o.getFrontOffsetX() * AABB_OFFSET_TOP );
final double maxY = Math.min( 1.0, ( 1.0 - offsetY ) - o.getFrontOffsetY() * AABB_OFFSET_TOP );
final double maxZ = Math.min( 1.0, ( 1.0 - offsetZ ) + o.getFrontOffsetZ() * AABB_OFFSET_TOP );
return new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ );
}
}
@@ -53,7 +53,7 @@ public enum DriveSlotState implements IStringSerializable
@Override
public String getName()
{
return name;
return this.name;
}
public static DriveSlotState fromCellStatus( int cellStatus )
@@ -37,16 +37,16 @@ public class DriveSlotsState
public DriveSlotState getState( int index )
{
if( index >= slots.length )
if( index >= this.slots.length )
{
return DriveSlotState.EMPTY;
}
return slots[index];
return this.slots[index];
}
public int getSlotCount()
{
return slots.length;
return this.slots.length;
}
/**
@@ -46,7 +46,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
rendering.tesr( new SkyChestTESR() );
// Register a custom non-tesr item model
String modelName = getModelFromType();
String modelName = this.getModelFromType();
ModelResourceLocation model = new ModelResourceLocation( "appliedenergistics2:" + modelName, "inventory" );
itemRendering.model( model ).variants( model );
}
@@ -54,7 +54,7 @@ public class SkyChestRenderingCustomizer extends BlockRenderingCustomizer
private String getModelFromType()
{
final String modelName;
switch( type )
switch( this.type )
{
default:
case STONE:
@@ -23,9 +23,10 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
@@ -34,7 +35,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -42,6 +42,10 @@ import appeng.api.definitions.IBlockDefinition;
import appeng.block.AEBaseBlock;
import appeng.block.AEBaseItemBlock;
import appeng.block.AEBaseTileBlock;
import appeng.bootstrap.components.IBlockRegistrationComponent;
import appeng.bootstrap.components.IItemRegistrationComponent;
import appeng.bootstrap.components.IPreInitComponent;
import appeng.bootstrap.definitions.TileEntityDefinition;
import appeng.core.AEConfig;
import appeng.core.AppEng;
import appeng.core.CreativeTab;
@@ -63,16 +67,14 @@ class BlockDefinitionBuilder implements IBlockBuilder
private final Supplier<? extends Block> blockSupplier;
private final List<BiConsumer<Block, Item>> preInitCallbacks = new ArrayList<>();
private final List<BiConsumer<Block, Item>> initCallbacks = new ArrayList<>();
private final List<BiConsumer<Block, Item>> postInitCallbacks = new ArrayList<>();
private final List<BiFunction<Block, Item, IBootstrapComponent>> bootstrapComponents = new ArrayList<>();
private final EnumSet<AEFeature> features = EnumSet.noneOf( AEFeature.class );
private CreativeTabs creativeTab = CreativeTab.instance;
private TileEntityDefinition tileEntityDefinition;
private boolean disableItem = false;
private Function<Block, ItemBlock> itemFactory;
@@ -91,29 +93,15 @@ class BlockDefinitionBuilder implements IBlockBuilder
if( Platform.isClient() )
{
blockRendering = new BlockRendering();
itemRendering = new ItemRendering();
this.blockRendering = new BlockRendering();
this.itemRendering = new ItemRendering();
}
}
@Override
public BlockDefinitionBuilder preInit( BiConsumer<Block, Item> callback )
public BlockDefinitionBuilder bootstrap( BiFunction<Block, Item, IBootstrapComponent> callback )
{
preInitCallbacks.add( callback );
return this;
}
@Override
public BlockDefinitionBuilder init( BiConsumer<Block, Item> callback )
{
initCallbacks.add( callback );
return this;
}
@Override
public BlockDefinitionBuilder postInit( BiConsumer<Block, Item> callback )
{
postInitCallbacks.add( callback );
this.bootstrapComponents.add( callback );
return this;
}
@@ -121,7 +109,7 @@ class BlockDefinitionBuilder implements IBlockBuilder
public IBlockBuilder features( AEFeature... features )
{
this.features.clear();
addFeatures( features );
this.addFeatures( features );
return this;
}
@@ -137,22 +125,29 @@ class BlockDefinitionBuilder implements IBlockBuilder
{
if( Platform.isClient() )
{
customizeForClient( callback );
this.customizeForClient( callback );
}
return this;
}
@Override
public IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition )
{
this.tileEntityDefinition = tileEntityDefinition;
return this;
}
@Override
public IBlockBuilder useCustomItemModel()
{
rendering( new BlockRenderingCustomizer()
this.rendering( new BlockRenderingCustomizer()
{
@Override
@SideOnly( Side.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, registryName ), "inventory" );
ModelResourceLocation model = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, BlockDefinitionBuilder.this.registryName ), "inventory" );
itemRendering.model( model ).variants( model );
}
} );
@@ -177,94 +172,102 @@ class BlockDefinitionBuilder implements IBlockBuilder
@SideOnly( Side.CLIENT )
private void customizeForClient( BlockRenderingCustomizer callback )
{
callback.customize( blockRendering, itemRendering );
callback.customize( this.blockRendering, this.itemRendering );
}
@SuppressWarnings( "unchecked" )
@Override
public <T extends IBlockDefinition> T build()
{
if( !AEConfig.instance.areFeaturesEnabled( features ) )
if( !AEConfig.instance().areFeaturesEnabled( this.features ) )
{
return (T) new TileDefinition( registryName, null, null );
return (T) new TileDefinition( this.registryName, null, null );
}
// Create block and matching item, and set factory name of both
Block block = blockSupplier.get();
block.setRegistryName( AppEng.MOD_ID, registryName );
Block block = this.blockSupplier.get();
block.setRegistryName( AppEng.MOD_ID, this.registryName );
block.setUnlocalizedName( "appliedenergistics2." + this.registryName );
ItemBlock item = constructItemFromBlock( block );
ItemBlock item = this.constructItemFromBlock( block );
if( item != null )
{
item.setRegistryName( AppEng.MOD_ID, registryName );
item.setRegistryName( AppEng.MOD_ID, this.registryName );
}
// Register the item and block with the game
factory.addPreInit( side -> {
GameRegistry.register( block );
if( item != null )
{
GameRegistry.register( item );
}
} );
this.factory.addBootstrapComponent( (IBlockRegistrationComponent) ( side, registry ) -> registry.register( block ) );
if( item != null )
{
this.factory.addBootstrapComponent( (IItemRegistrationComponent) ( side, registry ) -> registry.register( item ) );
}
block.setCreativeTab( creativeTab );
block.setUnlocalizedName( "appliedenergistics2." + registryName );
block.setCreativeTab( this.creativeTab );
// Register all extra handlers
preInitCallbacks.forEach( consumer -> factory.addPreInit( side -> consumer.accept( block, item ) ) );
initCallbacks.forEach( consumer -> factory.addInit( side -> consumer.accept( block, item ) ) );
postInitCallbacks.forEach( consumer -> factory.addPostInit( side -> consumer.accept( block, item ) ) );
this.bootstrapComponents.forEach( component -> this.factory.addBootstrapComponent( component.apply( block, item ) ) );
if( this.tileEntityDefinition != null && block instanceof AEBaseTileBlock )
{
( (AEBaseTileBlock) block ).setTileEntity( this.tileEntityDefinition.getTileEntityClass() );
if( this.tileEntityDefinition.getName() == null )
{
this.tileEntityDefinition.setName( this.registryName );
}
}
if( Platform.isClient() )
{
if( block instanceof AEBaseTileBlock )
{
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
blockRendering.apply( factory, block, tileBlock.getTileEntityClass() );
this.blockRendering.apply( this.factory, block, tileBlock.getTileEntityClass() );
}
else
{
blockRendering.apply( factory, block, null );
this.blockRendering.apply( this.factory, block, null );
}
if( item != null )
{
itemRendering.apply( factory, item );
this.itemRendering.apply( this.factory, item );
}
}
if( block instanceof AEBaseTileBlock )
{
AEBaseTileBlock tileBlock = (AEBaseTileBlock) block;
factory.addPreInit( side -> {
Class<? extends AEBaseTile> tileEntityClass = tileBlock.getTileEntityClass();
AEBaseTile.registerTileItem( tileEntityClass, new BlockStackSrc( block, 0, ActivityState.Enabled ) );
// TODO: Change after transition phase
GameRegistry.registerTileEntityWithAlternatives( tileEntityClass, AppEng.MOD_ID.toLowerCase() + ":" + registryName, registryName );
this.factory.addBootstrapComponent( (IPreInitComponent) side ->
{
AEBaseTile.registerTileItem(
this.tileEntityDefinition == null ? ( (AEBaseTileBlock) block ).getTileEntityClass() : this.tileEntityDefinition.getTileEntityClass(),
new BlockStackSrc( block, 0, ActivityState.Enabled ) );
} );
return (T) new TileDefinition( registryName, (AEBaseTileBlock) block, item );
if( this.tileEntityDefinition != null )
{
this.factory.tileEntityComponent.addTileEntity( this.tileEntityDefinition );
}
return (T) new TileDefinition( this.registryName, (AEBaseTileBlock) block, item );
}
else
{
return (T) new BlockDefinition( registryName, block, item );
return (T) new BlockDefinition( this.registryName, block, item );
}
}
@Nullable
private ItemBlock constructItemFromBlock( Block block )
{
if( disableItem )
if( this.disableItem )
{
return null;
}
if( itemFactory != null )
if( this.itemFactory != null )
{
return itemFactory.apply( block );
return this.itemFactory.apply( block );
}
else if( block instanceof AEBaseBlock )
{
@@ -62,7 +62,7 @@ class BlockRendering implements IBlockRendering
@SideOnly( Side.CLIENT )
public IBlockRendering modelCustomizer( BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
{
modelCustomizer = customizer;
this.modelCustomizer = customizer;
return this;
}
@@ -99,36 +99,37 @@ class BlockRendering implements IBlockRendering
void apply( FeatureFactory factory, Block block, Class<?> tileEntityClass )
{
if( tesr != null )
if( this.tesr != null )
{
if( tileEntityClass == null )
{
throw new IllegalStateException( "Tried to register a TESR for " + block + " even though no tile entity has been specified." );
}
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, tesr ) );
factory.addBootstrapComponent( new TesrComponent( tileEntityClass, this.tesr ) );
}
if( modelCustomizer != null )
if( this.modelCustomizer != null )
{
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), modelCustomizer );
factory.addModelOverride( block.getRegistryName().getResourcePath(), this.modelCustomizer );
}
else if( block instanceof AEBaseTileBlock )
{
// This is a default rotating model if the base-block uses an AE tile entity which exposes UP/FRONT as
// extended props
factory.modelOverrideComponent.addOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
factory.addModelOverride( block.getRegistryName().getResourcePath(), ( l, m ) -> new AutoRotatingModel( m ) );
}
builtInModels.forEach( factory::addBuiltInModel );
// TODO : 1.12
this.builtInModels.forEach( factory::addBuiltInModel );
if( blockColor != null )
if( this.blockColor != null )
{
factory.addBootstrapComponent( new BlockColorComponent( block, blockColor ) );
factory.addBootstrapComponent( new BlockColorComponent( block, this.blockColor ) );
}
if( stateMapper != null )
if( this.stateMapper != null )
{
factory.addBootstrapComponent( new StateMapperComponent( block, stateMapper ) );
factory.addBootstrapComponent( new StateMapperComponent( block, this.stateMapper ) );
}
}
}
@@ -20,10 +20,18 @@ package appeng.bootstrap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Supplier;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.fml.relauncher.Side;
@@ -33,10 +41,8 @@ import appeng.api.definitions.IItemDefinition;
import appeng.api.util.AEColor;
import appeng.api.util.AEColoredItemDefinition;
import appeng.bootstrap.components.BuiltInModelComponent;
import appeng.bootstrap.components.InitComponent;
import appeng.bootstrap.components.ModelOverrideComponent;
import appeng.bootstrap.components.PostInitComponent;
import appeng.bootstrap.components.PreInitComponent;
import appeng.bootstrap.components.TileEntityComponent;
import appeng.core.features.AEFeature;
import appeng.core.features.ActivityState;
import appeng.core.features.ColoredItemDefinition;
@@ -49,26 +55,31 @@ public class FeatureFactory
private final AEFeature[] defaultFeatures;
private final List<IBootstrapComponent> bootstrapComponents;
private final Map<Class<? extends IBootstrapComponent>, List<IBootstrapComponent>> bootstrapComponents;
@SideOnly( Side.CLIENT )
ModelOverrideComponent modelOverrideComponent;
private ModelOverrideComponent modelOverrideComponent;
@SideOnly( Side.CLIENT )
private BuiltInModelComponent builtInModelComponent;
public final TileEntityComponent tileEntityComponent;
public FeatureFactory()
{
this.defaultFeatures = new AEFeature[] { AEFeature.Core };
this.bootstrapComponents = new ArrayList<>();
this.defaultFeatures = new AEFeature[] { AEFeature.CORE };
this.bootstrapComponents = new HashMap<>();
this.tileEntityComponent = new TileEntityComponent();
this.addBootstrapComponent( this.tileEntityComponent );
if( Platform.isClient() )
{
modelOverrideComponent = new ModelOverrideComponent();
bootstrapComponents.add( modelOverrideComponent );
this.modelOverrideComponent = new ModelOverrideComponent();
this.addBootstrapComponent( this.modelOverrideComponent );
builtInModelComponent = new BuiltInModelComponent();
bootstrapComponents.add( builtInModelComponent );
this.builtInModelComponent = new BuiltInModelComponent();
this.addBootstrapComponent( this.builtInModelComponent );
}
}
@@ -76,6 +87,7 @@ public class FeatureFactory
{
this.defaultFeatures = defaultFeatures.clone();
this.bootstrapComponents = parent.bootstrapComponents;
this.tileEntityComponent = parent.tileEntityComponent;
if( Platform.isClient() )
{
this.modelOverrideComponent = parent.modelOverrideComponent;
@@ -85,19 +97,20 @@ public class FeatureFactory
public IBlockBuilder block( String id, Supplier<Block> block )
{
return new BlockDefinitionBuilder( this, id, block ).features( defaultFeatures );
return new BlockDefinitionBuilder( this, id, block ).features( this.defaultFeatures );
}
public IItemBuilder item( String id, Supplier<Item> item )
{
return new ItemDefinitionBuilder( this, id, item ).features( defaultFeatures );
return new ItemDefinitionBuilder( this, id, item ).features( this.defaultFeatures );
}
public AEColoredItemDefinition colored( IItemDefinition target, int offset )
{
ColoredItemDefinition definition = new ColoredItemDefinition();
target.maybeItem().ifPresent( targetItem -> {
target.maybeItem().ifPresent( targetItem ->
{
for( final AEColor color : AEColor.VALID_COLORS )
{
final ActivityState state = ActivityState.from( target.isEnabled() );
@@ -114,34 +127,32 @@ public class FeatureFactory
return new FeatureFactory( this, features );
}
void addBootstrapComponent( IBootstrapComponent component )
public void addBootstrapComponent( IBootstrapComponent component )
{
this.bootstrapComponents.add( component );
Arrays.stream( component.getClass().getInterfaces() )
.filter( i -> IBootstrapComponent.class.isAssignableFrom( i ) )
.forEach( i -> this.addBootstrapComponent( (Class<? extends IBootstrapComponent>) i, component ) );
}
void addPreInit( PreInitComponent component )
private <T extends IBootstrapComponent> void addBootstrapComponent( Class<? extends IBootstrapComponent> eventType, T component )
{
this.bootstrapComponents.add( component );
}
void addInit( InitComponent component )
{
this.bootstrapComponents.add( component );
}
void addPostInit( PostInitComponent component )
{
this.bootstrapComponents.add( component );
bootstrapComponents.computeIfAbsent( eventType, c -> new ArrayList<IBootstrapComponent>() ).add( component );
}
@SideOnly( Side.CLIENT )
void addBuiltInModel( String path, IModel model )
{
builtInModelComponent.addModel( path, model );
this.builtInModelComponent.addModel( path, model );
}
public List<IBootstrapComponent> getBootstrapComponents()
@SideOnly( Side.CLIENT )
void addModelOverride( String resourcePath, BiFunction<ModelResourceLocation, IBakedModel, IBakedModel> customizer )
{
return bootstrapComponents;
this.modelOverrideComponent.addOverride( resourcePath, customizer );
}
public <T extends IBootstrapComponent> Iterator<T> getBootstrapComponents( Class<T> eventType )
{
return (Iterator<T>) this.bootstrapComponents.getOrDefault( eventType, Collections.emptyList() ).iterator();
}
}
@@ -19,7 +19,7 @@
package appeng.bootstrap;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import net.minecraft.block.Block;
@@ -27,17 +27,13 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import appeng.api.definitions.IBlockDefinition;
import appeng.bootstrap.definitions.TileEntityDefinition;
import appeng.core.features.AEFeature;
public interface IBlockBuilder
{
IBlockBuilder preInit( BiConsumer<Block, Item> callback );
IBlockBuilder init( BiConsumer<Block, Item> callback );
IBlockBuilder postInit( BiConsumer<Block, Item> callback );
IBlockBuilder bootstrap( BiFunction<Block, Item, IBootstrapComponent> component );
IBlockBuilder features( AEFeature... features );
@@ -45,6 +41,8 @@ public interface IBlockBuilder
IBlockBuilder rendering( BlockRenderingCustomizer callback );
IBlockBuilder tileEntity( TileEntityDefinition tileEntityDefinition );
/**
* Don't register an item for this block.
*/
@@ -19,24 +19,10 @@
package appeng.bootstrap;
import net.minecraftforge.fml.relauncher.Side;
/**
* Bootstrap components can be registered to take part in the various initialization phases of Forge.
* See the individual subclasses for a specific forge initalization event.
*/
public interface IBootstrapComponent
{
default void preInitialize( Side side )
{
}
default void initialize( Side side )
{
}
default void postInitialize( Side side )
{
}
}
@@ -19,7 +19,7 @@
package appeng.bootstrap;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import net.minecraft.creativetab.CreativeTabs;
@@ -36,12 +36,7 @@ import appeng.core.features.ItemDefinition;
*/
public interface IItemBuilder
{
IItemBuilder preInit( Consumer<Item> callback );
IItemBuilder init( Consumer<Item> callback );
IItemBuilder postInit( Consumer<Item> callback );
IItemBuilder bootstrap( Function<Item, IBootstrapComponent> component );
IItemBuilder features( AEFeature... features );

Some files were not shown because too many files have changed in this diff Show More