use of buildcraft.api.filler.IFillerPattern in project BuildCraft by BuildCraft.
the class BuildCraftCore method init.
@Mod.EventHandler
public void init(FMLInitializationEvent evt) {
BuildCraftAPI.fakePlayerProvider = CoreProxy.proxy;
EntityRegistry.registerModEntity(EntityResizableCuboid.class, "bcResizCuboid", EntityIds.RESIZABLE_CUBOID, instance, 0, 100, false);
ChannelHandler coreChannelHandler = new ChannelHandler();
coreChannelHandler.registerPacketType(PacketTabletMessage.class);
channels = NetworkRegistry.INSTANCE.newChannel(DefaultProps.NET_CHANNEL_NAME + "-CORE", coreChannelHandler, handler = new PacketHandler());
achievementManager = new AchievementPageManager("BuildCraft");
MinecraftForge.EVENT_BUS.register(achievementManager);
woodenGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.woodenGear", "woodenGearAchievement", 0, 0, woodenGearItem, null));
stoneGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.stoneGear", "stoneGearAchievement", 2, 0, stoneGearItem, woodenGearAchievement));
ironGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.ironGear", "ironGearAchievement", 4, 0, ironGearItem, stoneGearAchievement));
goldGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.goldGear", "goldGearAchievement", 6, 0, goldGearItem, ironGearAchievement));
diamondGearAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.diamondGear", "diamondGearAchievement", 8, 0, diamondGearItem, goldGearAchievement));
wrenchAchievement = achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.wrench", "wrenchAchievement", 3, 2, wrenchItem, stoneGearAchievement));
engineRedstoneAchievement = BuildCraftCore.achievementManager.registerAchievement(new Achievement("buildcraft|core:achievement.redstoneEngine", "engineAchievement1", 1, -2, new ItemStack(engineBlock, 1, 0), BuildCraftCore.woodenGearAchievement));
StatementManager.registerParameterClass(StatementParameterItemStack.class);
StatementManager.registerParameterClass(StatementParameterItemStackExact.class);
StatementManager.registerParameterClass(StatementParameterDirection.class);
StatementManager.registerParameterClass(StatementParamGateSideOnly.class);
StatementManager.registerParameterClass(StatementParameterRedstoneLevel.class);
StatementManager.registerTriggerProvider(new CoreTriggerProvider());
StatementManager.registerActionProvider(new CoreActionProvider());
if (BuildCraftCore.modifyWorld) {
MinecraftForge.EVENT_BUS.register(new SpringPopulate());
}
if (mainConfiguration.hasChanged()) {
mainConfiguration.save();
}
if (BuildCraftCore.loadDefaultRecipes) {
loadRecipes();
}
BCCreativeTab.get("main").setIcon(new ItemStack(BuildCraftCore.wrenchItem, 1));
EntityList.stringToClassMapping.remove("BuildCraft|Core.bcLaser");
EntityList.stringToClassMapping.remove("BuildCraft|Core.bcEnergyLaser");
BuilderAPI.schematicRegistry.registerSchematicBlock(engineBlock, SchematicEngine.class);
CoreProxy.proxy.init();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new CoreGuiHandler());
MinecraftForge.EVENT_BUS.register(TabletManagerClient.INSTANCE);
MinecraftForge.EVENT_BUS.register(TabletManagerServer.INSTANCE);
MinecraftForge.EVENT_BUS.register(TickHandlerCore.INSTANCE);
TabletAPI.registerProgram(new TabletProgramMenuFactory());
// Create filler registry
try {
FillerManager.registry = new FillerRegistry();
// INIT FILLER PATTERNS
IFillerPattern[] patterns = { PatternFill.INSTANCE, PatternNone.INSTANCE, new PatternFlatten(), new PatternHorizon(), new PatternClear(), new PatternBox(), new PatternPyramid(), new PatternStairs(), new PatternCylinder(), new PatternFrame() };
for (IFillerPattern pattern : patterns) {
FillerManager.registry.addPattern(pattern);
}
ActionFiller.resetMap();
} catch (Error error) {
BCLog.logErrorAPI(error, IFillerPattern.class);
throw error;
}
StatementManager.registerParameterClass(PatternParameterYDir.class);
StatementManager.registerParameterClass(PatternParameterXZDir.class);
StatementManager.registerParameterClass(PatternParameterCenter.class);
StatementManager.registerParameterClass(PatternParameterHollow.class);
ListRegistry.registerHandler(new ListMatchHandlerClass());
ListRegistry.registerHandler(new ListMatchHandlerFluid());
ListRegistry.registerHandler(new ListMatchHandlerTools());
ListRegistry.registerHandler(new ListMatchHandlerArmor());
// ListRegistry.registerHandler(new ListMatchHandler());
ListRegistry.itemClassAsType.add(ItemFood.class);
DebuggingTools.fmlInit();
}
use of buildcraft.api.filler.IFillerPattern in project BuildCraft by BuildCraft.
the class BuildersActionProvider method addExternalActions.
@Override
public void addExternalActions(Collection<IActionExternal> actions, EnumFacing side, TileEntity tile) {
if (tile instanceof TileFiller) {
for (IFillerPattern p : FillerManager.registry.getPatterns()) {
if (p instanceof FillerPattern) {
FillerPattern pattern = (FillerPattern) p;
if (!actionMap.containsKey(p.getUniqueTag())) {
actionMap.put(p.getUniqueTag(), ActionFiller.getForPattern(pattern));
}
actions.add(actionMap.get(p.getUniqueTag()));
}
}
}
}
use of buildcraft.api.filler.IFillerPattern in project BuildCraft by BuildCraft.
the class GuiFiller method updateScreen.
@Override
public void updateScreen() {
super.updateScreen();
IFillerPattern pattern = container.getPatternStatementClient().get();
SPRITE_PATTERN.delegate = pattern == null ? null : pattern.getSprite();
SPRITE_CONTROL_MODE.delegate = BCCoreSprites.ACTION_MACHINE_CONTROL.get(container.tile.getControlMode());
}
use of buildcraft.api.filler.IFillerPattern in project BuildCraft by BuildCraft.
the class FillerType method readFromBuffer.
@Override
public IFillerPattern readFromBuffer(PacketBufferBC buffer) {
String kind = buffer.readString();
IFillerPattern pattern = FillerManager.registry.getPattern(kind);
if (pattern == null) {
return defaultStatement;
}
return pattern;
}
use of buildcraft.api.filler.IFillerPattern in project BuildCraft by BuildCraft.
the class FillerType method readFromNbt.
@Override
public IFillerPattern readFromNbt(NBTTagCompound nbt) {
String kind = nbt.getString("kind");
IFillerPattern pattern = FillerManager.registry.getPattern(kind);
if (pattern == null) {
return defaultStatement;
}
return pattern;
}
Aggregations