fix license headers, restore IOverrideDefaultStatements

This commit is contained in:
asiekierka 2014-10-29 09:33:27 +01:00
parent e146d1b46d
commit 054524754d
7 changed files with 73 additions and 1 deletions

View file

@ -1,3 +1,11 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.gates;
import net.minecraftforge.common.util.ForgeDirection;

View file

@ -1,3 +1,11 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.statements;
import net.minecraft.tileentity.TileEntity;

View file

@ -1,3 +1,11 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.statements;
public interface IActionInternal extends IStatement {

View file

@ -0,0 +1,16 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.statements;
import java.util.List;
public interface IOverrideDefaultStatements {
List<ITriggerExternal> overrideTriggers();
List<IActionExternal> overrideActions();
}

View file

@ -1,3 +1,11 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.statements;
import net.minecraft.tileentity.TileEntity;

View file

@ -1,3 +1,11 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.api.statements;
import net.minecraft.tileentity.TileEntity;

View file

@ -56,8 +56,17 @@ public final class StatementManager {
}
public static List<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity entity) {
List<ITriggerExternal> result = new LinkedList<ITriggerExternal>();
List<ITriggerExternal> result;
if (entity instanceof IOverrideDefaultStatements) {
result = ((IOverrideDefaultStatements) entity).overrideTriggers();
if (result != null) {
return result;
}
}
result = new LinkedList<ITriggerExternal>();
for (ITriggerProvider provider : triggerProviders) {
Collection<ITriggerExternal> toAdd = provider.getExternalTriggers(side, entity);
@ -76,6 +85,13 @@ public final class StatementManager {
public static List<IActionExternal> getExternalActions(ForgeDirection side, TileEntity entity) {
List<IActionExternal> result = new LinkedList<IActionExternal>();
if (entity instanceof IOverrideDefaultStatements) {
result = ((IOverrideDefaultStatements) entity).overrideActions();
if (result != null) {
return result;
}
}
for (IActionProvider provider : actionProviders) {
Collection<IActionExternal> toAdd = provider.getExternalActions(side, entity);