Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ All changes are toggleable via config files.
* **Duplication Fixes:** Fixes various duplication exploits
* **Industrial Foregoing**
* **Duplication Fixes:** Fixes various duplication exploits
* **Fix Black Hole Tank Bucket Voiding:** Fix the Black Hole Tank voiding buckets if the player inventory is full by dropping the buckets on the ground
* **Machines Max Range Off-By-One Fix:** Fixes an off-by-one error where IF Machines would display the max tier of range addon as one less than the actual maximum
* **Infernal Mobs**
* **Better Entity Names:** Gets the actual display names of entities for improved naming
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,11 @@ public static class IndustrialForegoingCategory
@Config.Comment("Fixes various duplication exploits")
public boolean utDuplicationFixesToggle = true;

@Config.RequiresMcRestart
@Config.Name("Fix Black Hole Tank Bucket Voiding")
@Config.Comment("Fix the Black Hole Tank voiding buckets if the player inventory is full by dropping the buckets on the ground")
public boolean utFixBlackHoleTankVoiding = true;

@Config.RequiresMcRestart
@Config.Name("Machines Max Range Off-By-One Fix")
@Config.Comment("Fixes an off-by-one error where IF Machines would display the max tier of range addon as one less than the actual maximum")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public class UTMixinLoader implements ILateMixinLoader
put("mixins/mods/mixins.incontrol.rule.json", c -> regularInControlLoaded() && UTConfigMods.INCONTROL.utStatsFixToggle);
put("mixins/mods/mixins.incontrol.handler_crash.json", c -> regularInControlLoaded() && UTConfigMods.INCONTROL.utClientCrash);
put("mixins/mods/mixins.industrialcraft.dupes.json", c -> c.isModPresent("ic2") && UTConfigMods.INDUSTRIALCRAFT.utDuplicationFixesToggle);
put("mixins/mods/mixins.industrialforegoing.blackholetank.json", c -> c.isModPresent("industrialforegoing") && UTConfigMods.INDUSTRIAL_FOREGOING.utFixBlackHoleTankVoiding);
put("mixins/mods/mixins.industrialforegoing.dupes.json", c -> c.isModPresent("industrialforegoing") && UTConfigMods.INDUSTRIAL_FOREGOING.utDuplicationFixesToggle);
put("mixins/mods/mixins.industrialforegoing.rangeaddon.json", c -> c.isModPresent("industrialforegoing") && UTConfigMods.INDUSTRIAL_FOREGOING.utRangeAddonNumberFix);
put("mixins/mods/mixins.infernalmobs.json", c -> c.isModPresent("infernalmobs"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package mod.acgaming.universaltweaks.mods.industrialforegoing.blackholetank.mixin;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

import com.buuz135.industrial.tile.block.BlackHoleTankBlock;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

// Courtesy of WaitingIdly
@Mixin(value = BlackHoleTankBlock.class, remap = false)
public class UTBlackHoleTankBlockMixin
{
/**
* @author WaitingIdly
* @reason If the player inventory is full, {@link EntityPlayer#addItemStackToInventory(ItemStack)} will return false.
* In that situation, the item is supposed to be dropped onto the ground.
* The current code voids buckets if the inventory is full.
*/
@WrapOperation(method = "onBlockActivated", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;addItemStackToInventory(Lnet/minecraft/item/ItemStack;)Z"))
private boolean utDropFallback(EntityPlayer instance, ItemStack p_191521_1_, Operation<Boolean> original)
{
if (!original.call(instance, p_191521_1_))
{
instance.dropItem(p_191521_1_, false);
}
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.mods.industrialforegoing.blackholetank.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTBlackHoleTankBlockMixin"]
}
Loading