-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Collecting Placed Fluids Turning Into AR Tanks
- Loading branch information
1 parent
0174956
commit 6672c07
Showing
1 changed file
with
15 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 15 additions & 2 deletions
17
src/main/java/com/nomiceu/nomilabs/mixin/advancedrocketry/AdvancedRocketryMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,38 @@ | ||
package com.nomiceu.nomilabs.mixin.advancedrocketry; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.item.Item; | ||
import net.minecraftforge.fluids.BlockFluidBase; | ||
import net.minecraftforge.fluids.Fluid; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import zmaster587.advancedRocketry.AdvancedRocketry; | ||
import zmaster587.libVulpes.api.LibVulpesBlocks; | ||
import zmaster587.libVulpes.event.BucketHandler; | ||
|
||
/** | ||
* Fixes Fluids Appearing with Null Texture, Prevents Bucket -> Tank when Collecting Placed Fluids | ||
*/ | ||
@Mixin(value = AdvancedRocketry.class, remap = false) | ||
public class AdvancedRocketryMixin { | ||
|
||
@Redirect(method = "registerBlocks", | ||
at = @At(value = "INVOKE", | ||
target = "Lzmaster587/libVulpes/api/LibVulpesBlocks;registerBlock(Lnet/minecraft/block/Block;)Lnet/minecraft/block/Block;")) | ||
public <T extends Block> T registerBlocksProperly(T block) { | ||
target = "Lzmaster587/libVulpes/api/LibVulpesBlocks;registerBlock(Lnet/minecraft/block/Block;)Lnet/minecraft/block/Block;"), | ||
require = 1) | ||
private <T extends Block> T registerBlocksProperly(T block) { | ||
if (block instanceof BlockFluidBase) { | ||
return LibVulpesBlocks.registerBlock(block, null, false); | ||
} | ||
return LibVulpesBlocks.registerBlock(block); | ||
} | ||
|
||
@Redirect(method = "postInit", | ||
at = @At(value = "INVOKE", | ||
target = "Lzmaster587/libVulpes/event/BucketHandler;registerBucket(Lnet/minecraft/block/Block;Lnet/minecraft/item/Item;Lnet/minecraftforge/fluids/Fluid;)V"), | ||
require = 1) | ||
private void cancelBucketHandlingRegister(BucketHandler instance, Block block, Item item, Fluid fluid) {} | ||
} |