Revert inventory wrap hook

This reverts commit a122253791.
This commit is contained in:
quat committed 2018-08-16 00:44:38 -04:00
1 parent fae9bcca75
commit 84967e4e2e
2 files changed
+4 -39

No files matched your search

@@ -1,32 +0,0 @@
/**
* This class was created by <quaternary>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package vazkii.botania.api.corporea;
import net.minecraftforge.fml.common.eventhandler.Event;
/**
* InventoryWrapEvent is fired when the corporea system attempts to wrap an inventory for use.
* */
public class InventoryWrapEvent extends Event {
public IWrappedInventory wrapped = null;
final ICorporeaSpark spark;
public InventoryWrapEvent(ICorporeaSpark spark) {
this.spark = spark;
}
public ICorporeaSpark getSpark() {
return spark;
}
public InvWithLocation getInvWithLocation() {
return spark.getSparkInventory();
}
}
@@ -27,7 +27,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.items.IItemHandlerModifiable;
import vazkii.botania.api.BotaniaAPIClient;
@@ -35,7 +34,6 @@ import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.api.corporea.ICorporeaSpark;
import vazkii.botania.api.corporea.IWrappedInventory;
import vazkii.botania.api.corporea.InvWithLocation;
import vazkii.botania.api.corporea.InventoryWrapEvent;
import vazkii.botania.api.internal.DummyMethodHandler;
import vazkii.botania.api.internal.IManaNetwork;
import vazkii.botania.api.lexicon.LexiconPage;
@@ -272,14 +270,13 @@ public class InternalMethodHandler extends DummyMethodHandler {
List<IWrappedInventory> arrayList = new ArrayList<IWrappedInventory>();
for(InvWithLocation inv : inventories) {
ICorporeaSpark spark = CorporeaHelper.getSparkForInventory(inv);
InventoryWrapEvent wrapEvent = new InventoryWrapEvent(spark);
MinecraftForge.EVENT_BUS.post(wrapEvent);
IWrappedInventory wrapped = wrapEvent.wrapped;
IWrappedInventory wrapped = null;
// try integrations
// last chance - this will always work
if(wrapped == null) {
wrapped = WrappedIInventory.wrap(inv, spark);
}
arrayList.add(wrapped);
}
return arrayList;