Commit Graph

182 Commits

Author SHA1 Message Date
ichttt 196e03c921 Fix forge fluids being treated as solid blocks (#4606) 2018-01-18 13:14:00 -08:00
jabelar 07c4da8f36 Added color as field with setter to Fluid class. (#4460) 2017-12-08 02:18:45 -08:00
mcenderdragon f97c535fa4 [1.12.x] Added BucketUse event to ForgeUniversal Bucket (#4454) 2017-11-17 13:10:23 -08:00
jabelar 61dea7f4c0 Changed BlockFluidBase "fog" color use color from Fluid getColor() method (#4462) 2017-10-31 10:46:40 -07:00
mezz cf39ff18e1 Add Item.getModId to show which mod is associated with a subitem (#4330) 2017-10-02 22:08:16 -07:00
mezz ee27276ba2 Fix typo in CapabiltyFluidHandler (#4306) 2017-08-14 21:32:52 -07:00
rslink 4d327df383 Fixed swapping of finite fluids with negative densities. (#4237) 2017-07-29 22:24:24 -07:00
mezz 9675585891 Use lambdas for short anonymous methods 2017-06-27 23:18:09 -07:00
Ben Staddon 9a09ff68aa Remove some deprecated methods and clean up 2017-06-25 22:30:18 -07:00
Ben Staddon 51aa029bb1 Add a FluidUtil method to interact with an arbitrary IFluidHandler (#4080) 2017-06-25 18:22:52 -07:00
LexManos efd8b38be9 Make getSubItems non-client only. Use it for Ingredient iteration. 2017-06-24 14:47:48 -07:00
LexManos a26d89c876 First pass of registry rewrite.
Tests do not run yet.
Things of note:
Removed the idea of substitutions, just register multiple items with the same name they will override each other like a normal map.
Decoupled Forge registries from vanilla classes. They now use bouncer classes. MODDERS SHOULD NEVER USE THESE
Introduced more stringent registry locking. As it sits things are only allowed to be registered during the RegistryEvent.Registry phases!
This is to force modders to split up their registrations, and pave the way for calling these functions multiple times during a single MC lifecycle.
ObjectHolder, Missing Mappings, etc... *should* now work for all registry types, nothing should be special cased to Blocks/Items anymore.
Added optional generic dummy factory to registries, to allow registry creators the ability to dummy more then just Blocks.
Re-worked the ItemStack transformer and applied it to ItemBlock and ItemBlockSpecial. Allowing us to cleanup reflective hacks in Block callbacks.
Registry onAdd callback is now only fired on the ACTIVE registry, fixing any issues of temp registries overriding active objects.
2017-06-23 16:59:57 -05:00
mezz 423f9fc04b Fix Universal bucket handling for Fluids with NBT (Fix #3757) 2017-06-22 23:40:49 -07:00
diesieben07 0e9820c51c Clean up Logging (#3953)
# Conflicts:
#	patches/minecraft/net/minecraft/client/renderer/texture/Stitcher.java.patch
#	patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch
#	patches/minecraft/net/minecraft/entity/EntityList.java.patch
#	patches/minecraft/net/minecraft/tileentity/TileEntity.java.patch
#	src/main/java/net/minecraftforge/oredict/OreDictionary.java
2017-06-22 23:18:49 -07:00
mezz e3777f4559 Add missing Override annotations 2017-06-17 18:24:17 -07:00
mezz c2845967cc Update MCP mappings to 20170617 2017-06-17 18:06:04 -07:00
mezz 3d322ef925 Update mcp mappings to 20170611 2017-06-17 17:13:44 -07:00
LexManos f1cca475ea Initial patch update to 1.12.
Some things to note:
Netty is screwy so currently can't join single player. @cpw
Crafting has been MAJORY reworked. The current GameRegistry functions are nooped, this is IN THE WORKS.
  Just need to move the recipe list to a full class registry, and then re implement the in-code recipe registration.
  Also, it IS advised that modders move to JSON, because ideally we'll see a S->C recipe syncing system in 1.13
  which would allow servers to have custom recipes.
  OreDictionary currently 1/2 works, need to write a better algorithm for replacing ingredients.
  Please be patient
Rendering:
  A lot of functions got a new float parameter, this is similar to partial ticks, needs more research
2017-06-10 22:22:02 -04:00
Luke Gilfoyle 5198b4d690 Fixes BlockLiquidWrapper placing a Static fluid where it should place a Flowing one (#3893) 2017-05-21 22:10:44 -07:00
mezz 56ed8fec1e Improvements to FluidUtil (#3839) 2017-05-01 17:25:45 -07:00
bogger33 3eb7b59cf4 Fix Fluid models rendering with gaps (#3747) Closes #2993 2017-04-07 17:57:00 -07:00
James Mitchell c545b8ecd4 Clean up null issues, add more annotations (#3590) 2017-01-11 15:17:56 -08:00
Ben Staddon c4dea9fc66 Fix a couple more ItemStack null checks (#3586) 2017-01-11 15:15:47 -08:00
James Mitchell 5165dc52bf Update MCP mappings to snapshot_nodoc_20161220 (#3551) 2016-12-21 15:52:30 -08:00
mezz 8eea766288 [1.11.x] Refine fluid placement utilities (#3509) 2016-12-05 20:17:47 -08:00
mezz 2bd8b95a3b Cleanup some null checks and remove deprecated methods in Item and Block (#3429) 2016-11-22 15:20:05 -08:00
Shadowfacts 9cf74914e7 Initial annotations/nullability changes (#3392) 2016-11-18 13:24:03 -08:00
mezz 150566d9a3 [1.11] Fix nullability issues around ForgeHooks and Capabilities (#3395) 2016-11-17 10:44:31 -08:00
mezz eb6b3ea228 Implement fluid item capabilities without item swapping 2016-11-16 16:17:21 -08:00
mezz 6f1a44a405 Remove deprecated Fluid stuff 2016-11-16 16:17:21 -08:00
cpw 4e6a774075 Initial 1.11-pre1 update 2016-11-13 17:09:55 -05:00
cpw 9ab96fbda6 Update to 20161111 mcp names 2016-11-12 10:05:32 -05:00
LexManos 159ca09c54 Special case not drooping snowballs for water and snow layers. Closes #3326 2016-10-23 14:07:24 -07:00
Marvin Rösch bf6437c12a Fix universal bucket not being returned in crafting recipes (#3234) 2016-09-13 00:02:01 -07:00
James Mitchell f20d728ed7 Fix #3165 Dispensers with buckets can destroy fluid handler blocks (#3180) 2016-08-12 01:36:18 -07:00
LexManos 7c4ffde39c Fix Forge fluids not serializing properly. Closes #3152 2016-08-02 15:55:46 -07:00
Joseph C. Sible fc43ebbd7e Use CreateFluidSourceEvent for mod fluids as well 2016-07-23 22:39:54 -04:00
mezz 18b2eeef90 Fix milk bucket is fillable with water or lava when milk is unregistered (#3039) 2016-06-26 12:19:04 -07:00
mezz 1871cf1b02 Fix FluidContainerRegistry handling potions as water bottles (#3037) 2016-06-26 12:18:11 -07:00
mezz 99616a503f Remove duplicated universal buckets from the creative list (#3035) 2016-06-26 12:18:02 -07:00
cpw 260be68723 Update to 1.10 2016-06-23 02:39:55 -04:00
cpw c8d775c865 In accordance with our stated goal of relicensing Forge to LGPL v2.1, this commit enacts that change. Although it is using the 1.9.4 codebase, it is intended that this branch become public with the 1.10 changes, as such the license will take effect at that time. The three commits from persons who have failed to accept the new license, as documented in #2789, have had their commits reverted. This should complete the license transition. Commits after the commit date of this commit should be considered licensed by LGPLv2.1, as indicated in LICENSE-new.txt. All patches are now considered owned by the Forge project and Forge Development LLC in particular (note that they will not get the license boilerplate, as they are machine generated files). 2016-06-22 23:49:48 -04:00
mezz ba9ec61648 Fix incorrect FluidUtil doc (#2996) 2016-06-22 22:20:50 -04:00
mezz eca97de272 Fix #2918 Make dispensers with buckets work with modded fluids (#2947) 2016-06-18 16:29:28 -07:00
mezz 9cd2c697e5 Fix #2961 Capability data is not preserved by fluid handler interactions (#2976) 2016-06-13 20:01:28 -07:00
mezz c776d97691 Add methods to Fluid to allow custom vaporization overrides (#2959) 2016-06-09 02:30:06 -07:00
RainWarrior 883bfe57ab Fixes #1984. 2016-06-05 11:15:05 +03:00
mezz 14ee316d06 Make it easier to use FluidTanks that have input/output restrictions (#2945)
These internal function should NOT be used by anything except the owner of the tank.
2016-06-04 01:29:44 -07:00
mezz 92914f82ae Add new IFluidHandler for capabilities. (#2942)
Old fluid system is deprecated and slated for removal in the next cleanup cycle.
2016-06-03 18:26:41 -07:00
LexManos 8432f95223 Fix BlockFluidBase having collision. Closes #2932 2016-06-01 13:58:05 -07:00
cpw caa61e1be9 Merge branch '1.9.4' 2016-05-31 00:34:03 -04:00
mezz 86baf7462f Improve JavaDoc links, fix some broken JavaDocs (#2833)
Improve JavaDoc links, fix broken JavaDocs
2016-05-29 14:05:07 -07:00
LexManos aef721a248 Fixed FluidUtil.tryEmptyFluidContainerItem not checking if the tank can accept fluids first. Closes #2527 2016-05-28 23:06:42 -07:00
LexManos cdc86e9af6 Update mappoings snapshot to 20160518 2016-05-18 05:23:30 -07:00
LexManos b9ac73b0f1 1.9.4 Update.
Major things to note:
Class renames: https://gist.github.com/LexManos/44dd211f90f498ad4015279b103dff86
Tile Entities are now packed in the ChunkData packet.
Forge intends to work around this to better support large moded worlds, but for the time being modders should implement the new function carefully and only send what data they need to!
Minecraft's codebase now has annotations, these are directly from Mojang and should be adheared to!
Added support for package-info.java's containing @Nullable information for all MC code base.
2016-05-18 03:29:10 -07:00
boni 5d5c005aae Fix Bucket rendering and add sound (#2865)
* Adjust generated quads from texture to take texture size into account #2858

*  Fix universal bucket not passing through when rightclicking on a non-block
Add proper sound events when picking up modded fluids #2821

* Have FluidUtil execute properly on both sides and sync as expected. Add default sounds to interacting with tanks

* Save sound for filling/emptying in the fluid
2016-05-16 13:20:31 -07:00
RainWarrior cb7685a3b0 Fixed forge fluid having a collision box. 2016-04-05 18:55:42 +03:00
cpw 6e04a6c572 Squashed commit of the following:
commit b3b290aec9d3010a134859da6001ea28a96c2fdc
Merge: c6ce6a0 d803f7d
Author: cpw <cpw@weeksfamily.ca>
Date:   Fri Mar 25 13:28:04 2016 -0400

    Merge branch 'RegistryRework' of https://github.com/LexManos/MinecraftForge into LexManos-RegistryRework

    Implement proper registry slaves. Should help with rollback related issues.

    Missing patch

commit d803f7db76f65db9d27302c9804a643bc853dc22
Author: LexManos <LexManos@gmail.com>
Date:   Tue Mar 22 03:36:14 2016 -0700

    Update VillagerRegistry and use it. Should in theory make custom villagers work now. Using string version instead of int id for networking.

commit eb5e5b4b42fdca26d2a104e4dc1e6a3ea3051a7b
Author: LexManos <LexManos@gmail.com>
Date:   Tue Mar 22 02:14:16 2016 -0700

    More cleanup.

commit edbc56b2ff314629d0e402709f3cf29fc79c4a3d
Author: LexManos <LexManos@gmail.com>
Date:   Tue Mar 22 02:05:23 2016 -0700

    More cleanups, removed deprecated UniqueIdentifier {ResourceLocation now}

commit e2df8d1be3c97601508f83dc97b0e8853fa1e271
Author: LexManos <LexManos@gmail.com>
Date:   Tue Mar 22 01:29:19 2016 -0700

    Stupid generics....

commit 46d57dc4677fa5ff3923e64eaccfb33d7e5aad8d
Author: LexManos <LexManos@gmail.com>
Date:   Tue Mar 22 01:00:25 2016 -0700

    Some registry tweaking to provde a non-complicated API modders can use.
2016-04-01 20:56:06 -04:00
RainWarrior 75032ebf9c Made some more public fields either private or final. 2016-03-24 22:22:21 +03:00
RainWarrior 756c58d5cb Removed RenderWorldEvent, encapsulated all public event fields. 2016-03-24 22:22:21 +03:00
RainWarrior a9d23f5e78 Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos. 2016-03-24 22:22:20 +03:00
LexManos d878c866b3 Allow finite fluids to be drained correctly 2016-03-21 19:56:31 -07:00
RainWarrior 4650ee2789 Updated to latest mappings. Exc is broken, some anonymous classes didn't map to srg names. 2016-03-13 04:40:03 +03:00
LexManos 206a21d563 Fixed errrors in Fluids package. TODO: Make BlockLiquid implement IFluidBlock and REMOVE FluidContainerRegsitry. Everything *should* be able to use IFluidContainer directly. 2016-03-06 16:54:47 -08:00
LexManos ad788880e5 Some entity patches. 2016-03-01 20:42:36 -08:00
LexManos ac7c4d2f6c Some import renames and compile error fixes, killed ~800. 2016-03-01 04:58:03 -08:00
Bernhard Bonigl eb879b3020 Fix customized bucket names not getting translated correctly 2016-02-16 09:39:33 +01:00
Bernhard Bonigl 1055206ba8 Add universal bucket 2016-02-16 00:49:01 +01:00
LexManos dcda451a0a Deprecate int IDs in FluidRegistry. Modders should only ever use the String name. Also add a 'friendly' exception when attempting to get an ID for a unregistered fluid. Closes #1374 2015-12-10 02:54:00 -08:00
cpw 97ef6a5d1f Giant registry fixup 2015-11-28 03:07:53 -05:00
LexManos 5549b06f96 Compiler warnings pass, undeprecated SplashProgress related stuff. 2015-11-26 19:38:21 -08:00
cpw 44c4011575 Yeah, amount is NOT deprecated. 2015-11-24 15:30:22 -05:00
cpw b4dc15a9cb Cleanup Fluid deprecations stuff. 2015-11-24 10:05:35 -05:00
cpw 5045d8df68 Merge branch '1.7.10' 2015-08-01 20:30:22 -04:00
Ruben Taelman 0cf1f0d51c Fix source block check for BlockFluidClassic 2015-07-21 10:51:53 +02:00
cpw 50677ad87a Actually rebuild the fluidNames each rebuild, don't just try and force changes in. Should fix #1973 2015-07-09 16:40:51 -04:00
RainWarrior 07038f8342 Added fluid renderer. 2015-06-18 14:26:53 +03:00
cpw db42d1f532 Merge branch '1.7.10' 2015-06-09 17:57:35 -04:00
cpw 63f2300794 Fix up the client/server fluid race condition that could cause the game to bail when an SSP game connects.
There's still a teeny gap, but it's MUCH less prominent than it was before.
2015-06-03 19:26:53 -04:00
cpw d02636213a Merge branch '1.7.10' - imports all the fluid fixups and other stuff from 1.7 into 1.8
Conflicts:
	fml/src/main/java/net/minecraftforge/fml/common/FMLCommonHandler.java
	fml/src/main/java/net/minecraftforge/fml/common/Loader.java
	patches/minecraft/net/minecraft/client/Minecraft.java.patch
	patches/minecraft/net/minecraft/client/renderer/texture/TextureMap.java.patch
	patches/minecraft/net/minecraft/item/ItemArmor.java.patch
	patches/minecraft/net/minecraft/nbt/CompressedStreamTools.java.patch
	patches/minecraft/net/minecraft/nbt/NBTTagCompound.java.patch
	patches/minecraft/net/minecraft/nbt/NBTTagList.java.patch
	patches/minecraft/net/minecraft/world/World.java.patch
	patches/minecraft/net/minecraft/world/WorldProvider.java.patch
	src/main/java/net/minecraftforge/common/ForgeVersion.java
	src/main/java/net/minecraftforge/common/network/ForgeMessage.java
	src/main/java/net/minecraftforge/fluids/BlockFluidBase.java
	src/main/java/net/minecraftforge/fluids/FluidContainerRegistry.java
	src/main/java/net/minecraftforge/fluids/FluidRegistry.java
	src/main/java/net/minecraftforge/oredict/OreDictionary.java
2015-06-01 16:29:34 -04:00
cpw 96cbadb874 Expose the fluid that a block was constructed with, useful for 'non-default'
configuration of fluidblocks. Shouldn't be used outside of this purpose.
2015-04-20 10:29:04 -04:00
cpw 50608986fe Replace the OLD fluid in the fluidID map, not the new one.. 2015-04-20 10:01:36 -04:00
cpw 7bbe8df2b8 Fix static initializer derp. 2015-04-20 09:26:27 -04:00
cpw 0543828603 Make FluidStack hold a delegate for the fluid. This can then float based on what is "live" at present. 2015-04-20 09:06:23 -04:00
cpw 54af750717 Verify that the fluid registry doesn't contain "junk" fluids thru reflection. 2015-04-18 21:37:45 -04:00
King Lemming 3cd7f6bd87 Adjusts OreDictionary to prevent invalid registrations.
Getting Ore Names for a non-existent ore will no longer automatically add that Name to the list nor generate an ID.

Tweaks a warning message in the FluidContainerRegistry. No functionality change.

Signed-off-by: King Lemming <kinglemming@gmail.com>
2015-04-13 22:40:38 -04:00
cpw 5c88164211 And handle the null case in the constructor itself. Closes #1794 (again) 2015-04-11 17:38:15 -04:00
cpw 230d757a89 Fix NPE - Closes #1794 2015-04-11 17:27:14 -04:00
cpw 9671179453 Fluids are now tracked internally by mod. This allows for the server and the world to specify a "default"
in the case of a possible alternative fluid implementation. If you always called registerFluid, things
should work pretty seamlessly, but if you didn't (gating with an isFluidRegistered check for example)
you should change to register anyway. This way, even if you're not default in the overall instance, you may
become default if you're the only mod present on a server, for example, or in a world save.

This should radically decrease the mixups caused by mod load ordering problems, and other issues around fluid
tracking.
2015-04-11 17:18:53 -04:00
King Lemming 37d63b3fe9 Adds a warning to the FluidContainerRegistry when a mod does something stupid! Also denies the registration.
Signed-off-by: King Lemming <kinglemming@gmail.com>
2015-04-10 20:09:58 -04:00
King Lemming 186f92479d Fixes FluidContainerRegistry properly - no more corner case where client/server mods disagree.
Also clarifies the 2x Fluid registration error message somewhat.

Signed-off-by: King Lemming <kinglemming@gmail.com>
2015-04-10 16:38:45 -04:00
King Lemming 433b7ca589 Fixes #1782
Signed-off-by: King Lemming <kinglemming@gmail.com>
2015-04-09 17:28:20 -04:00
Sergey Shatunov a42cf1ae37 Fix FluidRegsitry.registerFluid
FluidRegistry:
```java
    static BiMap<String, Fluid> fluids = HashBiMap.create();
    static BiMap<Fluid, Integer> fluidIDs = HashBiMap.create();
...
    public static boolean registerFluid(Fluid fluid)
    {
        if (fluidIDs.containsKey(fluid.getName()))
            ^^^^^^^
```
There is definitely should be fluids instead fluidIDs. This mistake broke many mods.
2015-04-08 17:26:40 +06:00
Lex Manos 02ebc9ca21 Restore binary compatibility issues in FluidRegistry caused by recent changes. 2015-04-07 20:06:55 -07:00
cpw 4f0e2fb9c4 You shouldn't be creating FluidStacks from unregistered Fluids. Warn clearly on failed registrations, and make a useful log message for failed fluidstack
creations. Should help a lot with tracking down broken mods that are doing this wrongly.
2015-04-05 22:48:09 -04:00
King Lemming f7395f517b Allow for duplicate Fluid Blocks. It's annoying to be sure but just as with the OreDictionary, we'll have to handle it.
Signed-off-by: King Lemming <kinglemming@gmail.com>
2015-04-05 22:30:39 -04:00
cpw defaddecec Fix formatting 2015-04-05 22:30:39 -04:00
King Lemming 3fc40b955a Removed fluidID from ItemStack.
This fixes a rather huge issue where FluidStacks on the client could be desynced if a modder was unaware of it.

This is a breaking change but can be mitigated with a transformer to the getter getFluidID().

Signed-off-by: King Lemming <kinglemming@gmail.com>
2015-04-05 22:30:39 -04:00
Lex Manos c374ba5463 Merge remote-tracking branch 'origin/1.8' 2015-01-31 18:56:00 -08:00
TechStack 146b08a8cd Closes #1552
Set the destination block the to the fluid.
In the previous code the destination block was still Air and would would
cause a crash because air doesn't have a property for LEVEL
2015-01-29 17:11:22 -05:00