fix the work in area and load/unload area allowing non map locations items as parameters

This commit is contained in:
Hea3veN 2015-07-15 01:16:55 -03:00
parent c72a747e4e
commit e3308381ee
4 changed files with 30 additions and 2 deletions

View file

@ -5,3 +5,4 @@ Bugs fixed:
* Rotating pipe orientation not working well in blueprints (asie)
* Void fluid pipe having wrong colours (asie)
* [2889] Fix robots movement desync when going through fluids (hea3ven)
* Fix the work in area and load/unload area allowing non map locations items as parameters (hea3ven)

View file

@ -17,6 +17,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
@ -32,6 +33,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
@ -141,6 +143,7 @@ import buildcraft.robotics.statements.ActionStationRequestItems;
import buildcraft.robotics.statements.ActionStationRequestItemsMachine;
import buildcraft.robotics.statements.RobotsActionProvider;
import buildcraft.robotics.statements.RobotsTriggerProvider;
import buildcraft.robotics.statements.StatementParameterMapLocation;
import buildcraft.robotics.statements.StatementParameterRobot;
import buildcraft.robotics.statements.TriggerRobotInStation;
import buildcraft.robotics.statements.TriggerRobotLinked;
@ -246,6 +249,7 @@ public class BuildCraftRobotics extends BuildCraftMod {
}
StatementManager.registerParameterClass(StatementParameterRobot.class);
StatementManager.registerParameterClass(StatementParameterMapLocation.class);
StatementManager.registerActionProvider(new RobotsActionProvider());
StatementManager.registerTriggerProvider(new RobotsTriggerProvider());
}

View file

@ -16,7 +16,6 @@ import buildcraft.api.items.IMapLocation;
import buildcraft.api.statements.IActionInternal;
import buildcraft.api.statements.IStatementContainer;
import buildcraft.api.statements.IStatementParameter;
import buildcraft.api.statements.StatementParameterItemStack;
import buildcraft.api.statements.StatementSlot;
import buildcraft.core.lib.utils.StringUtils;
import buildcraft.core.statements.BCStatement;
@ -91,7 +90,7 @@ public class ActionRobotWorkInArea extends BCStatement implements IActionInterna
@Override
public IStatementParameter createParameter(int index) {
return new StatementParameterItemStack();
return new StatementParameterMapLocation();
}
@Override

View file

@ -0,0 +1,24 @@
package buildcraft.robotics.statements;
import net.minecraft.item.ItemStack;
import buildcraft.api.items.IMapLocation;
import buildcraft.api.statements.IStatement;
import buildcraft.api.statements.IStatementContainer;
import buildcraft.api.statements.StatementMouseClick;
import buildcraft.api.statements.StatementParameterItemStack;
public class StatementParameterMapLocation extends StatementParameterItemStack {
@Override
public String getUniqueTag() {
return "buildcraft:maplocation";
}
@Override
public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) {
if (stack != null && !(stack.getItem() instanceof IMapLocation)) {
stack = null;
}
super.onClick(source, stmt, stack, mouse);
}
}